diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2018-10-20 14:11:58 -0700 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2018-10-25 10:28:08 -0700 |
| commit | 9b7d93425fd17e1dff982ee13631b4fc18c31bbf (patch) | |
| tree | 219fe9a370377287593cabb3a9087c5b9e45410d | |
| parent | e80548e13df8353ff4b856fc1b1689901774846c (diff) | |
| download | vcpkg-9b7d93425fd17e1dff982ee13631b4fc18c31bbf.tar.gz vcpkg-9b7d93425fd17e1dff982ee13631b4fc18c31bbf.zip | |
[entityx] Fix parallel configure
| -rw-r--r-- | ports/entityx/fix-cmake.patch | 40 | ||||
| -rw-r--r-- | ports/entityx/portfile.cmake | 43 |
2 files changed, 51 insertions, 32 deletions
diff --git a/ports/entityx/fix-cmake.patch b/ports/entityx/fix-cmake.patch new file mode 100644 index 000000000..143cc52b1 --- /dev/null +++ b/ports/entityx/fix-cmake.patch @@ -0,0 +1,40 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 87309bf..23f5063 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -25,6 +25,7 @@ include(${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
+ include(CheckCXXSourceCompiles)
+
+ # Default compiler args
++if(0)
+ if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "(GNU|.*Clang)")
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pedantic -Werror -Wall -Wextra -Wno-unused-parameter -Wno-error=unused-variable -Wno-error=sign-compare -std=c++11")
+ set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
+@@ -41,6 +42,7 @@ elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
+ set(CMAKE_CXX_FLAGS_RELEASE "/Ox -DNDEBUG")
+ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/Ox /Zi /FS /DEBUG")
+ endif()
++endif()
+
+ # if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ # set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Weverything -Wno-c++98-compat -Wno-shadow -Wno-padded -Wno-missing-noreturn -Wno-global-constructors")
+@@ -156,9 +158,9 @@ endif (ENTITYX_BUILD_TESTING)
+
+ configure_file(
+ ${CMAKE_CURRENT_SOURCE_DIR}/entityx/config.h.in
+- ${CMAKE_CURRENT_SOURCE_DIR}/entityx/config.h
++ ${CMAKE_CURRENT_BINARY_DIR}/entityx/config.h
+ )
+-
++include_directories(${CMAKE_CURRENT_BINARY_DIR})
+
+ if (NOT WINDOWS OR CYGWIN)
+ set(entityx_libs -lentityx)
+@@ -179,6 +181,7 @@ install(
+ DESTINATION "include"
+ FILES_MATCHING PATTERN "*.h"
+ )
++install(FILES ${CMAKE_CURRENT_BINARY_DIR}/entityx/config.h DESTINATION include/entityx)
+
+ install(
+ TARGETS ${install_libs}
diff --git a/ports/entityx/portfile.cmake b/ports/entityx/portfile.cmake index d35fb9da3..2c7978849 100644 --- a/ports/entityx/portfile.cmake +++ b/ports/entityx/portfile.cmake @@ -1,42 +1,21 @@ -# Common Ambient Variables: -# VCPKG_ROOT_DIR = <C:\path\to\current\vcpkg> -# TARGET_TRIPLET is the current triplet (x86-windows, etc) -# PORT is the current port name (zlib, etc) -# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT} -# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET} -# - -if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - message(STATUS "Warning: Dynamic building not supported yet. Building static.") - set(VCPKG_LIBRARY_LINKAGE static) -endif() +include(vcpkg_common_functions) -if(NOT VCPKG_CRT_LINKAGE STREQUAL "dynamic") - message(FATAL_ERROR "Entityx only supports dynamic CRT linkage") -endif() +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) -include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/entityx-1.2.0) -vcpkg_download_distfile(ARCHIVE - URLS "https://github.com/alecthomas/entityx/archive/1.2.0.zip" - FILENAME "entityx-1.2.0.zip" - SHA512 4d7009f0412fbccd7bee72713d53424c3b4fa39da62b87729dd84a710a059db27e65ca27b927285c82af09997caea125d85571824133d9b71b4e3c4eebd9917c +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO alecthomas/entityx + REF 1.2.0 + SHA512 682aa302cb4495666aab2c0b39a286f88cb28046bc8b2deb603402105e15e4b9692e32807077abc3f465e42a4e0f34a7e69169bc74fc5579a5c3d0e17b02fdb8 + HEAD_REF master + PATCHES fix-cmake.patch ) -vcpkg_extract_source_archive(${ARCHIVE}) - -if (VCPKG_CRT_LINKAGE STREQUAL dynamic) - SET(SHARED_FLAG ON) -else() - SET(SHARED_FLAG OFF) -endif() vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA OPTIONS - # OPTIONS_RELEASE -DOPTIMIZE=1 - # OPTIONS_DEBUG -DDEBUGGABLE=1 - -DENTITYX_BUILD_SHARED=${SHARED_FLAG} - -DENTITYX_BUILD_TESTING=false + -DENTITYX_BUILD_TESTING=false ) vcpkg_install_cmake() |
