mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-19 02:53:02 +08:00
[entityx] Fix parallel configure
This commit is contained in:
parent
e80548e13d
commit
9b7d93425f
40
ports/entityx/fix-cmake.patch
Normal file
40
ports/entityx/fix-cmake.patch
Normal file
@ -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}
|
@ -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()
|
||||
|
||||
if(NOT VCPKG_CRT_LINKAGE STREQUAL "dynamic")
|
||||
message(FATAL_ERROR "Entityx only supports dynamic CRT linkage")
|
||||
endif()
|
||||
|
||||
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_extract_source_archive(${ARCHIVE})
|
||||
|
||||
if (VCPKG_CRT_LINKAGE STREQUAL dynamic)
|
||||
SET(SHARED_FLAG ON)
|
||||
else()
|
||||
SET(SHARED_FLAG OFF)
|
||||
endif()
|
||||
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
||||
|
||||
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_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()
|
||||
|
Loading…
Reference in New Issue
Block a user