mirror of
https://github.com/cemu-project/vcpkg.git
synced 2025-02-22 02:27:09 +01:00
[tbb]Fix static build. (#8018)
This commit is contained in:
parent
cbf9553c6e
commit
15d747662c
@ -1,4 +1,4 @@
|
||||
Source: tbb
|
||||
Version: 2019_U8
|
||||
Version: 2019_U8-1
|
||||
Homepage: https://github.com/01org/tbb
|
||||
Description: Intel's Threading Building Blocks.
|
||||
|
13
ports/tbb/fix-static-build.patch
Normal file
13
ports/tbb/fix-static-build.patch
Normal file
@ -0,0 +1,13 @@
|
||||
diff --git a/src/tbb/cilk-tbb-interop.h b/src/tbb/cilk-tbb-interop.h
|
||||
index 295734b..f35531e 100644
|
||||
--- a/src/tbb/cilk-tbb-interop.h
|
||||
+++ b/src/tbb/cilk-tbb-interop.h
|
||||
@@ -29,6 +29,8 @@
|
||||
#else
|
||||
#ifdef IN_CILK_RUNTIME
|
||||
#define CILK_EXPORT __declspec(dllexport)
|
||||
+#elif defined(IN_CILK_STATIC)
|
||||
+#define CILK_EXPORT /* nothing */
|
||||
#else
|
||||
#define CILK_EXPORT __declspec(dllimport)
|
||||
#endif // IN_CILK_RUNTIME
|
@ -1,20 +1,17 @@
|
||||
include(vcpkg_common_functions)
|
||||
|
||||
if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
|
||||
endif()
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO intel/tbb
|
||||
REF 4bdba61bafc6ba2d636f31564f1de5702d365cf7
|
||||
SHA512 0b00c9deefdac5dc1f4fbae314e91eb3513b54b47ff6dec08ed2460486fc7d211ab36d6130e5787bfd50523cb613c65f03f9217d967292ca9056e2d3f5010bf8
|
||||
HEAD_REF tbb_2019
|
||||
PATCHES fix-static-build.patch
|
||||
)
|
||||
|
||||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
|
||||
|
||||
if(VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
if (NOT VCPKG_TARGET_IS_WINDOWS)
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
@ -33,6 +30,32 @@ else()
|
||||
set(RELEASE_CONFIGURATION Release)
|
||||
set(DEBUG_CONFIGURATION Debug)
|
||||
endif()
|
||||
|
||||
macro(CONFIGURE_PROJ_FILE arg)
|
||||
set(CONFIGURE_FILE_NAME ${arg})
|
||||
set(CONFIGURE_BAK_FILE_NAME ${arg}.bak)
|
||||
if (NOT EXISTS ${CONFIGURE_BAK_FILE_NAME})
|
||||
configure_file(${CONFIGURE_FILE_NAME} ${CONFIGURE_BAK_FILE_NAME} COPYONLY)
|
||||
endif()
|
||||
configure_file(${CONFIGURE_BAK_FILE_NAME} ${CONFIGURE_FILE_NAME} COPYONLY)
|
||||
if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
||||
file(READ ${CONFIGURE_FILE_NAME} SLN_CONFIGURE)
|
||||
string(REPLACE "<ConfigurationType>DynamicLibrary<\/ConfigurationType>"
|
||||
"<ConfigurationType>StaticLibrary<\/ConfigurationType>" SLN_CONFIGURE "${SLN_CONFIGURE}")
|
||||
string(REPLACE "\/D_CRT_SECURE_NO_DEPRECATE"
|
||||
"\/D_CRT_SECURE_NO_DEPRECATE \/DIN_CILK_STATIC" SLN_CONFIGURE "${SLN_CONFIGURE}")
|
||||
file(WRITE ${CONFIGURE_FILE_NAME} "${SLN_CONFIGURE}")
|
||||
else()
|
||||
file(READ ${CONFIGURE_FILE_NAME} SLN_CONFIGURE)
|
||||
string(REPLACE "\/D_CRT_SECURE_NO_DEPRECATE"
|
||||
"\/D_CRT_SECURE_NO_DEPRECATE \/DIN_CILK_RUNTIME" SLN_CONFIGURE "${SLN_CONFIGURE}")
|
||||
file(WRITE ${CONFIGURE_FILE_NAME} "${SLN_CONFIGURE}")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
CONFIGURE_PROJ_FILE(${SOURCE_PATH}/build/vs2013/tbb.vcxproj)
|
||||
CONFIGURE_PROJ_FILE(${SOURCE_PATH}/build/vs2013/tbbmalloc.vcxproj)
|
||||
CONFIGURE_PROJ_FILE(${SOURCE_PATH}/build/vs2013/tbbmalloc_proxy.vcxproj)
|
||||
|
||||
vcpkg_install_msbuild(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
|
Loading…
x
Reference in New Issue
Block a user