mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-12 04:39:02 +08:00
83f3896fc8
* Add disable-exceptions feature to portfile to pass exceptions=0 to tbb_build in the non-windows case, and set TBB_USE_EXCEPTIONS=0 in the vcxproj files in the windows case. This removes the try/catch(...) wrappers around user code run by TBB. While these exception facilities can be nice in some cases, their removal allows for much easier debugging of a crash due to an unhandled exception in code that a TBB client provides to a TBB algortihm. With the try/catch(...) wrappers removed, the unhandled exception and crash dump are generated at the point of the thrown exception, versus significantly later in a different thread with the originally throwing thread no longer having the stack from when the exception was thrown. * commit for changes from running x-add-version tbb to update for new port version * Remove feature and undo changes made by x-add-version * Rerun x-add-version
45 lines
1.5 KiB
CMake
45 lines
1.5 KiB
CMake
project(tbb CXX)
|
|
|
|
option(DISABLE_EXCEPTIONS "Set exceptions=0 for make to turn off exception support in TBB" OFF)
|
|
file(GLOB SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/*)
|
|
file(COPY ${SOURCES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/src)
|
|
|
|
include(${CMAKE_CURRENT_BINARY_DIR}/src/cmake/TBBBuild.cmake REQUIRED)
|
|
if(DISABLE_EXCEPTIONS)
|
|
set(DISABLE_EXCEPTIONS_ARG exceptions=0)
|
|
endif()
|
|
if(NOT BUILD_SHARED_LIBS)
|
|
set(TBB_STATIC_INCLUDE extra_inc=big_iron.inc)
|
|
endif()
|
|
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
|
set(FORWARD_SDK_ROOT "SDKROOT=${CMAKE_OSX_SYSROOT}")
|
|
if(CMAKE_OSX_ARCHITECTURES STREQUAL "arm64")
|
|
set(arch "arch=arm64")
|
|
endif()
|
|
endif()
|
|
|
|
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
|
if(NOT CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL CMAKE_SYSTEM_PROCESSOR)
|
|
set(arch "arch=${CMAKE_SYSTEM_PROCESSOR}")
|
|
if(CMAKE_CXX_COMPILER)
|
|
set(CPLUS "CPLUS=${CMAKE_CXX_COMPILER}")
|
|
endif()
|
|
if(CMAKE_C_COMPILER)
|
|
set(CONLY "CONLY=${CMAKE_C_COMPILER}")
|
|
endif()
|
|
endif()
|
|
endif()
|
|
|
|
tbb_build(TBB_ROOT ${CMAKE_CURRENT_BINARY_DIR}/src MAKE_ARGS ${arch} ${CPLUS} ${CONLY} ${DISABLE_EXCEPTIONS_ARG} ${TBB_STATIC_INCLUDE} ${FORWARD_SDK_ROOT})
|
|
|
|
set(SUBDIR ${CMAKE_CURRENT_BINARY_DIR}/tbb_cmake_build/tbb_cmake_build_subdir)
|
|
if(CMAKE_BUILD_TYPE STREQUAL "Release")
|
|
set(SUBDIR "${SUBDIR}_release")
|
|
else()
|
|
set(SUBDIR "${SUBDIR}_debug")
|
|
endif()
|
|
|
|
file(GLOB OUTPUTS ${SUBDIR}/*.so.* ${SUBDIR}/*.so ${SUBDIR}/*.a ${SUBDIR}/*.dylib ${SUBDIR}/*.dylib.*)
|
|
|
|
install(FILES ${OUTPUTS} DESTINATION lib)
|