diff --git a/CMakeLists.txt b/CMakeLists.txt index ecaa43b2..a4cb530f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,15 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++20") add_compile_options(/utf-8) ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS) else() -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pthread -g") + +if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pthread -g -stdlib=libc++") +message(STATUS "link libc++") +else() +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pthread -g ") +message(STATUS "link libstdc++") +endif() + set(CMAKE_CXX_FLAGS_RELEASE "-O3") endif(MSVC) set(CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE} -ldl")