From 8097bde738c13fff8d35939e47e55e504576358d Mon Sep 17 00:00:00 2001 From: MCMrARM Date: Sat, 4 Nov 2023 14:23:01 +0100 Subject: [PATCH] Do not force the compiler to clang++ if compiler is already clang --- CMakeLists.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c4193a..45c992c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,10 @@ endif() set(CMAKE_POSITION_INDEPENDENT_CODE ON) #BDS is linked to libc++ since 1.20.40 -set(CMAKE_CXX_COMPILER "clang++") +if(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + message(NOTICE "Setting compiler to clang++") + set(CMAKE_CXX_COMPILER "clang++") +endif() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++")