From 29ba7558b644a5294a7b7654473be86861bd8750 Mon Sep 17 00:00:00 2001 From: Vincent Date: Tue, 30 Apr 2024 11:27:21 +0100 Subject: [PATCH] refactor: compiler check in CMakeLists.txt --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5495c0a..de6eed3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,9 +13,9 @@ FetchContent_Declare( ) FetchContent_MakeAvailable(endstone) -if (MSVC) +if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") add_compile_definitions(_ITERATOR_DEBUG_LEVEL=0) -else () +elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++ -fPIC") link_libraries(-static-libgcc -static-libstdc++ libc++.a libc++abi.a) endif ()