CMakeLists: use --stdlib=libc++ on macOS only with clang

This commit is contained in:
Sergey Fedorov 2024-07-22 16:14:21 +08:00 committed by John Maguire
parent 1506c27696
commit 43826d9277
1 changed files with 3 additions and 4 deletions

View File

@ -18,10 +18,9 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE INTERNAL "")
if (CMAKE_CXX_COMPILER MATCHES ".*clang")
set(CMAKE_COMPILER_IS_CLANGXX 1)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-uninitialized")
endif ()
if (APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --stdlib=libc++")
if (APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --stdlib=libc++")
endif ()
endif ()
find_program(CCACHE_EXECUTABLE NAMES ccache)