This commit is contained in:
yhirose 2020-06-20 12:43:15 +00:00
parent aefeb3ae35
commit 14305f9f53

View File

@ -1,7 +1,6 @@
cmake_minimum_required(VERSION 3.1.0) cmake_minimum_required(VERSION 3.1.0)
project("cpp-peglib") project("cpp-peglib")
find_package(Threads)
# Check if a supported compiler is used to setup the C++ standard to use: # Check if a supported compiler is used to setup the C++ standard to use:
get_property(known_features GLOBAL PROPERTY CMAKE_CXX_KNOWN_FEATURES) get_property(known_features GLOBAL PROPERTY CMAKE_CXX_KNOWN_FEATURES)
list(FIND known_features "cxx_std_17" found) list(FIND known_features "cxx_std_17" found)
@ -31,6 +30,9 @@ elseif(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /wd4503 /wd4512 /utf-8") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /wd4503 /wd4512 /utf-8")
endif() endif()
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux") if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(add_link_deps Threads::Threads) set(add_link_deps Threads::Threads)
endif() endif()