Skip to content

Commit

Permalink
conditionally disable dynamic libbson with ENABLE_SHARED=OFF
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinAlbs committed Nov 16, 2023
1 parent 2416091 commit 736861d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ports/libbson/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ file(WRITE "${SOURCE_PATH}/VERSION_CURRENT" "${VERSION}")

# Cannot use string(COMPARE EQUAL ...)
set(ENABLE_STATIC OFF)
set(ENABLE_SHARED ON)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
set(ENABLE_STATIC ON)
set(ENABLE_SHARED OFF)
endif()

vcpkg_cmake_configure(
Expand All @@ -28,6 +30,7 @@ vcpkg_cmake_configure(
-DENABLE_SRV=OFF
-DENABLE_SSL=OFF
-DENABLE_STATIC=${ENABLE_STATIC}
-DENABLE_SHARED=${ENABLE_SHARED}
-DENABLE_TESTS=OFF
-DENABLE_UNINSTALL=OFF
-DENABLE_ZLIB=SYSTEM
Expand All @@ -54,10 +57,6 @@ file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/share/mongo-c-driver"
)

if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
endif()

file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")

vcpkg_install_copyright(
Expand Down

0 comments on commit 736861d

Please sign in to comment.