summaryrefslogtreecommitdiffstats
path: root/config/toolchain/clang.cmake
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2019-09-30 18:35:29 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2019-09-30 18:35:29 (GMT)
commitd23453e329a4b64f75077ee7a840f9ed59b53aab (patch)
treea6db4b3b965345e19a01393a0f14a2e011200362 /config/toolchain/clang.cmake
parent4de1fa88c258223fdb031e1bb1179785ecfcc166 (diff)
parentf6d4ce609b16601f3f4733266bb413a2bd765bc1 (diff)
downloadhdf5-d23453e329a4b64f75077ee7a840f9ed59b53aab.zip
hdf5-d23453e329a4b64f75077ee7a840f9ed59b53aab.tar.gz
hdf5-d23453e329a4b64f75077ee7a840f9ed59b53aab.tar.bz2
Merge pull request #1960 in HDFFV/hdf5 from ~BYRN/hdf5_adb:develop to develop
* commit 'f6d4ce609b16601f3f4733266bb413a2bd765bc1': Add clang toolchain
Diffstat (limited to 'config/toolchain/clang.cmake')
-rw-r--r--config/toolchain/clang.cmake29
1 files changed, 29 insertions, 0 deletions
diff --git a/config/toolchain/clang.cmake b/config/toolchain/clang.cmake
new file mode 100644
index 0000000..7dac587
--- /dev/null
+++ b/config/toolchain/clang.cmake
@@ -0,0 +1,29 @@
+# Uncomment the following to use cross-compiling
+#set(CMAKE_SYSTEM_NAME Linux)
+
+set(CMAKE_COMPILER_VENDOR "clang")
+
+set(CMAKE_C_COMPILER clang)
+set(CMAKE_CXX_COMPILER clang++)
+set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
+
+find_program(
+ CLANG_TIDY_EXE
+ NAMES "clang-tidy"
+ DOC "Path to clang-tidy executable"
+)
+
+set(CMAKE_C_CLANG_TIDY "${CLANG_TIDY_EXE}" -checks=*,clang-analyzer-*)
+set(CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_EXE}" -checks=*,clang-analyzer-*)
+
+#find_program(
+# CLANG_FORMAT_EXE
+# NAMES "clang-format"
+# DOC "Path to clang-format executable"
+#)
+#
+#set(CMAKE_C_CLANG_FORMAT "${CLANG_FORMAT_EXE}")
+#set(CMAKE_CXX_CLANG_FORMAT "${CLANG_FORMAT_EXE}")
+
+# the following is used if cross-compiling
+set(CMAKE_CROSSCOMPILING_EMULATOR "")