From d5f2c9c3a89efa8e8225354081d4bfd48e2b1e68 Mon Sep 17 00:00:00 2001 From: Tomer Lev Date: Wed, 26 Oct 2022 17:45:36 +0300 Subject: [PATCH] binpac: Only adding subdir if running standalone --- tools/binpac/src/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/binpac/src/CMakeLists.txt b/tools/binpac/src/CMakeLists.txt index 74920f3ea8..24529cce6e 100644 --- a/tools/binpac/src/CMakeLists.txt +++ b/tools/binpac/src/CMakeLists.txt @@ -106,6 +106,11 @@ set(binpac_SRCS add_executable(binpac ${binpac_SRCS}) if ( MSVC ) + # If building separately from zeek, we need to add the libunistd subdirectory so + # that linking doesn't fail. + if ("${CMAKE_PROJECT_NAME}" STREQUAL "BinPAC") + add_subdirectory(auxil/libunistd EXCLUDE_FROM_ALL) + endif() target_link_libraries(binpac PRIVATE libunistd) endif()