diff options
Diffstat (limited to 'vcpkg/ports/foonathan-memory')
| -rw-r--r-- | vcpkg/ports/foonathan-memory/config-debug.diff | 15 | ||||
| -rw-r--r-- | vcpkg/ports/foonathan-memory/config_impl.hpp | 13 | ||||
| -rw-r--r-- | vcpkg/ports/foonathan-memory/portfile.cmake | 56 | ||||
| -rw-r--r-- | vcpkg/ports/foonathan-memory/vcpkg.json | 25 |
4 files changed, 109 insertions, 0 deletions
diff --git a/vcpkg/ports/foonathan-memory/config-debug.diff b/vcpkg/ports/foonathan-memory/config-debug.diff new file mode 100644 index 0000000..53fc176 --- /dev/null +++ b/vcpkg/ports/foonathan-memory/config-debug.diff @@ -0,0 +1,15 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index e736ae5..9aa61eb 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -93,6 +93,10 @@ target_compile_definitions(foonathan_memory PUBLIC + if(NOT MSVC) + target_compile_features(foonathan_memory PUBLIC cxx_constexpr) + endif() ++target_compile_definitions(foonathan_memory INTERFACE ++ $<$<CONFIG:DEBUG>:Z_VCPKG_FOONATHAN_MEMORY_DEBUG=1> ++ $<$<NOT:$<CONFIG:DEBUG>>:Z_VCPKG_FOONATHAN_MEMORY_DEBUG=0> ++) + + if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") + if("${CMAKE_CXX_SIMULATE_ID}" STREQUAL "MSVC") diff --git a/vcpkg/ports/foonathan-memory/config_impl.hpp b/vcpkg/ports/foonathan-memory/config_impl.hpp new file mode 100644 index 0000000..da18680 --- /dev/null +++ b/vcpkg/ports/foonathan-memory/config_impl.hpp @@ -0,0 +1,13 @@ +#ifndef Z_VCPKG_FOONATHAN_MEMORY_DEBUG +# if defined(NDEBUG) && !defined(_DEBUG) +# define Z_VCPKG_FOONATHAN_MEMORY_DEBUG 0 +# else +# define Z_VCPKG_FOONATHAN_MEMORY_DEBUG 1 +# endif +#endif + +#if Z_VCPKG_FOONATHAN_MEMORY_DEBUG +# include "config_impl-debug.hpp" +#else +# include "config_impl-release.hpp" +#endif diff --git a/vcpkg/ports/foonathan-memory/portfile.cmake b/vcpkg/ports/foonathan-memory/portfile.cmake new file mode 100644 index 0000000..e558940 --- /dev/null +++ b/vcpkg/ports/foonathan-memory/portfile.cmake @@ -0,0 +1,56 @@ +vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO foonathan/memory
+ REF "v0.7-4"
+ SHA512 fe6d429644c3e5edfb5666e4047ece45766fa5907094903cbd1e5b91e164fa31b7596ea5627e0272cbb8ea0a2b26a1f57564c797874718396ea87d8fad7ab559
+ HEAD_REF master
+ PATCHES
+ config-debug.diff
+)
+
+vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS FEATURES
+ tool FOONATHAN_MEMORY_BUILD_TOOLS
+)
+
+vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ ${FEATURE_OPTIONS}
+ -DFOONATHAN_MEMORY_BUILD_EXAMPLES=OFF
+ -DFOONATHAN_MEMORY_BUILD_TESTS=OFF
+ OPTIONS_DEBUG
+ -DFOONATHAN_MEMORY_BUILD_TOOLS=OFF
+)
+
+vcpkg_cmake_install()
+
+if(VCPKG_TARGET_IS_WINDOWS)
+ vcpkg_cmake_config_fixup(CONFIG_PATH share/foonathan_memory/cmake PACKAGE_NAME foonathan_memory)
+else()
+ vcpkg_cmake_config_fixup(CONFIG_PATH lib/foonathan_memory/cmake PACKAGE_NAME foonathan_memory)
+endif()
+
+vcpkg_copy_pdbs()
+
+if(NOT VCPKG_BUILD_TYPE)
+ file(RENAME "${CURRENT_PACKAGES_DIR}/debug/include/foonathan/memory/config_impl.hpp" "${CURRENT_PACKAGES_DIR}/include/foonathan/memory/config_impl-debug.hpp")
+ file(RENAME "${CURRENT_PACKAGES_DIR}/include/foonathan/memory/config_impl.hpp" "${CURRENT_PACKAGES_DIR}/include/foonathan/memory/config_impl-release.hpp")
+ file(COPY_FILE "${CURRENT_PORT_DIR}/config_impl.hpp" "${CURRENT_PACKAGES_DIR}/include/foonathan/memory/config_impl.hpp")
+endif()
+
+file(REMOVE_RECURSE
+ "${CURRENT_PACKAGES_DIR}/debug/include"
+ "${CURRENT_PACKAGES_DIR}/debug/lib/foonathan_memory"
+ "${CURRENT_PACKAGES_DIR}/debug/share"
+ "${CURRENT_PACKAGES_DIR}/debug/LICENSE"
+ "${CURRENT_PACKAGES_DIR}/debug/README.md"
+ "${CURRENT_PACKAGES_DIR}/lib/foonathan_memory"
+ "${CURRENT_PACKAGES_DIR}/LICENSE"
+ "${CURRENT_PACKAGES_DIR}/README.md"
+)
+
+if("tool" IN_LIST FEATURES)
+ vcpkg_copy_tools(TOOL_NAMES nodesize_dbg AUTO_CLEAN)
+endif()
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
diff --git a/vcpkg/ports/foonathan-memory/vcpkg.json b/vcpkg/ports/foonathan-memory/vcpkg.json new file mode 100644 index 0000000..fe9547f --- /dev/null +++ b/vcpkg/ports/foonathan-memory/vcpkg.json @@ -0,0 +1,25 @@ +{ + "name": "foonathan-memory", + "version": "0.7.4", + "description": "STL compatible C++ memory allocator library", + "homepage": "https://foonathan.net/doc/memory/", + "license": "Zlib", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "default-features": [ + "tool" + ], + "features": { + "tool": { + "description": "Build foonathan memory tool" + } + } +} |