FastSignals: Remove custom C++17 and libc++ build flags.
This commit is contained in:
15
src/3rdParty/FastSignals/cmake/functions.cmake
vendored
15
src/3rdParty/FastSignals/cmake/functions.cmake
vendored
@@ -1,18 +1,3 @@
|
||||
# In the current version, CMake cannot enable C++17 mode for some compilers.
|
||||
# This function uses a workaround.
|
||||
function(custom_enable_cxx17 TARGET)
|
||||
# Enable C++17 where CMake can.
|
||||
target_compile_features(${TARGET} PUBLIC cxx_std_17)
|
||||
# Enable C++latest mode in Visual Studio
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
set_target_properties(${TARGET} PROPERTIES COMPILE_FLAGS "/std:c++latest")
|
||||
# Enable linking with libc++, libc++experimental, and pthread for Clang
|
||||
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
set_target_properties(${TARGET} PROPERTIES COMPILE_FLAGS "-stdlib=libc++ -pthread")
|
||||
target_link_libraries(${TARGET} c++experimental pthread)
|
||||
endif()
|
||||
endfunction(custom_enable_cxx17)
|
||||
|
||||
# Function to add a library target.
|
||||
function(custom_add_library_from_dir TARGET)
|
||||
# Gather files from the current directory
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
|
||||
file(GLOB LIBFASTSIGNALS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp" "${CMAKE_CURRENT_SOURCE_DIR}/include/*.h")
|
||||
add_library(libfastsignals STATIC ${LIBFASTSIGNALS_SRC})
|
||||
custom_enable_cxx17(libfastsignals)
|
||||
set_target_properties(libfastsignals PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||
target_include_directories(libfastsignals INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include")
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
custom_add_test_from_dir(libfastsignals_stress_tests libfastsignals)
|
||||
custom_enable_cxx17(libfastsignals_stress_tests)
|
||||
target_include_directories(libfastsignals_stress_tests PRIVATE "${CMAKE_SOURCE_DIR}/tests")
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
custom_add_test_from_dir(libfastsignals_unit_tests libfastsignals)
|
||||
custom_enable_cxx17(libfastsignals_unit_tests)
|
||||
target_include_directories(libfastsignals_unit_tests PRIVATE "${CMAKE_SOURCE_DIR}/tests")
|
||||
|
||||
Reference in New Issue
Block a user