From 1bfe9561d87602e5650548c1e0c390fd9b7b535c Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Wed, 11 Jan 2023 09:31:07 +1000 Subject: [PATCH] cxx: expose clang's stdlib argument as a cache variable --- nc_cxx.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nc_cxx.cmake b/nc_cxx.cmake index c0b4644..1cf0b58 100644 --- a/nc_cxx.cmake +++ b/nc_cxx.cmake @@ -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 ()