cxx: expose clang's stdlib argument as a cache variable

This commit is contained in:
Danny Robson 2023-01-11 09:31:07 +10:00
parent 3b696fffb4
commit 1bfe9561d8

View File

@ -30,8 +30,12 @@ append_compile_flag ("-fpermissive")
append_compile_flag ("/std:c++latest")
###############################################################################
set(STDLIB "libc++" CACHE STRING "Which stdlib to specify for Clang")
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
append_compile_flag ("-stdlib=libc++")
append_compile_flag ("-stdlib=${STDLIB}")
append_link_flag ("-fuse-ld=lld")
endif ()