summaryrefslogtreecommitdiffstats
path: root/cmake/ClangToolchain.cmake
blob: b5ae35af20e5eec0542548edbdcbe391b26a71f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
if ($ENV{CLANG_VERSION})
	SET (CLANG_VERSION "-$ENV{CLANG_VERSION}")
endif()

SET (CLANG_WARNINGS "-pedantic -Weverything -Wno-padded -Wno-covered-switch-default -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-cast-align")

SET (CMAKE_C_COMPILER             "/usr/bin/clang${CLANG_VERSION}" CACHE PATH "")
SET (CMAKE_C_FLAGS                ${CLANG_WARNINGS} CACHE STRING "")

SET (CMAKE_CXX_COMPILER             "/usr/bin/clang++${CLANG_VERSION}" CACHE PATH "")
SET (CMAKE_CXX_FLAGS                ${CLANG_WARNINGS} CACHE STRING "")

SET (CMAKE_AR      "/usr/bin/llvm-ar${CLANG_VERSION}" CACHE PATH "")
SET (CMAKE_LINKER  "/usr/bin/llvm-link${CLANG_VERSION}" CACHE PATH "")
SET (CMAKE_NM      "/usr/bin/llvm-nm${CLANG_VERSION}" CACHE PATH "")
SET (CMAKE_OBJDUMP "/usr/bin/llvm-objdump${CLANG_VERSION}" CACHE PATH "")
SET (CMAKE_RANLIB  "/usr/bin/llvm-ranlib${CLANG_VERSION}" CACHE PATH "")