cxx: try to enable gold and lld for gcc and clang
This commit is contained in:
parent
93d09dc0dc
commit
a4b3a217d6
11
nc_cxx.cmake
11
nc_cxx.cmake
@ -29,10 +29,15 @@ append_compile_flag ("-std=c++2a")
|
|||||||
append_compile_flag ("-fpermissive")
|
append_compile_flag ("-fpermissive")
|
||||||
append_compile_flag ("/std:c++latest")
|
append_compile_flag ("/std:c++latest")
|
||||||
|
|
||||||
# try to use clangs libc++ under the assumption that gcc will fail this test
|
|
||||||
# and clang will pass (if it is present). this is necessary because some
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||||
# libstdc++ headers don't behave well under c++17/clang.
|
|
||||||
append_compile_flag ("-stdlib=libc++")
|
append_compile_flag ("-stdlib=libc++")
|
||||||
|
append_link_flag ("-fuse-ld=lld")
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||||
|
append_link_flag ("-fuse-ld=gold")
|
||||||
|
endif ()
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
# find the gcc or clang filesystem library and append to libs if needed
|
# find the gcc or clang filesystem library and append to libs if needed
|
||||||
|
Loading…
Reference in New Issue
Block a user