DarkflameServer/cmake/toolchains/linux-clang.cmake
2024-04-05 18:06:37 -05:00

15 lines
495 B
CMake

# Try and find a clang-16 install, falling back to a generic clang install otherwise
find_program(CLANG_C_COMPILER clang-16 | clang REQUIRED)
find_program(CLANG_CXX_COMPILER clang++-16 | clang++ REQUIRED)
# Debug messages
message("CLANG_C_COMPILER = ${CLANG_C_COMPILER}")
message("CLANG_CXX_COMPILER = ${CLANG_CXX_COMPILER}")
# Set compilers to clang
set(CMAKE_C_COMPILER ${CLANG_C_COMPILER})
set(CMAKE_CXX_COMPILER ${CLANG_CXX_COMPILER})
# Set linker to lld
add_link_options("-fuse-ld=lld")