Skip to content

Commit

Permalink
[foonathan-memory] Fix using vcpkg_check_features error (microsoft#8266)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cheney-W authored and Rastaban committed Sep 20, 2019
1 parent bb171a0 commit 0279fd5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion ports/foonathan-memory/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: foonathan-memory
Version: 2019-07-21
Version: 2019-07-21-1
Description: STL compatible C++ memory allocator library
Homepage: https://foonathan.net/doc/memory/
Default-Features: tool
Expand Down
20 changes: 11 additions & 9 deletions ports/foonathan-memory/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,17 @@ vcpkg_from_github(

file(COPY ${COMP_SOURCE_PATH}/comp_base.cmake DESTINATION ${SOURCE_PATH}/cmake/comp)

vcpkg_check_features(tool FOONATHAN_MEMORY_BUILD_TOOLS)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
tool FOONATHAN_MEMORY_BUILD_TOOLS
)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
${FEATURE_OPTIONS}
-DFOONATHAN_MEMORY_BUILD_EXAMPLES=OFF
-DFOONATHAN_MEMORY_BUILD_TESTS=OFF
-DFOONATHAN_MEMORY_BUILD_TOOLS=${FOONATHAN_MEMORY_BUILD_TOOLS}
)

vcpkg_install_cmake()
Expand Down Expand Up @@ -94,14 +96,14 @@ file(REMOVE
${CURRENT_PACKAGES_DIR}/README.md
)

if(FOONATHAN_MEMORY_BUILD_TOOLS)
if(NOT VCPKG_CMAKE_SYSTEM_NAME OR
VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
set(EXECUTABLE_SUFFIX ".exe")
else()
set(EXECUTABLE_SUFFIX "")
endif()
if(NOT VCPKG_CMAKE_SYSTEM_NAME OR
VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
set(EXECUTABLE_SUFFIX ".exe")
else()
set(EXECUTABLE_SUFFIX "")
endif()

if(EXISTS ${CURRENT_PACKAGES_DIR}/bin/nodesize_dbg${EXECUTABLE_SUFFIX})
file(COPY
${CURRENT_PACKAGES_DIR}/bin/nodesize_dbg${EXECUTABLE_SUFFIX}
DESTINATION ${CURRENT_PACKAGES_DIR}/tools/${PORT}
Expand Down

0 comments on commit 0279fd5

Please sign in to comment.