From fa1221c69ef20279fc8aa1ca741beef3f6071802 Mon Sep 17 00:00:00 2001 From: Michael Mandl Date: Thu, 14 Mar 2024 09:33:23 +0100 Subject: [PATCH] chore: add cmake modules --- cmake/ExportCompileCommands.cmake | 8 ++++++++ cmake/sccache.cmake | 6 ++++++ 2 files changed, 14 insertions(+) create mode 100644 cmake/ExportCompileCommands.cmake create mode 100644 cmake/sccache.cmake diff --git a/cmake/ExportCompileCommands.cmake b/cmake/ExportCompileCommands.cmake new file mode 100644 index 0000000..5db8897 --- /dev/null +++ b/cmake/ExportCompileCommands.cmake @@ -0,0 +1,8 @@ +set(CMAKE_EXPORT_COMPILE_COMMANDS + ON + CACHE BOOL "Export compile commands database") + +if(CMAKE_EXPORT_COMPILE_COMMANDS) + set(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES + ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES}) +endif() diff --git a/cmake/sccache.cmake b/cmake/sccache.cmake new file mode 100644 index 0000000..52adea6 --- /dev/null +++ b/cmake/sccache.cmake @@ -0,0 +1,6 @@ +find_program(SCCACHE_FOUND sccache) + +if(SCCACHE_FOUND) + set(CMAKE_C_COMPILER_LAUNCHER sccache) + set(CMAKE_CXX_COMPILER_LAUNCHER sccache) +endif()