From 89b493e939926d05a1ab564ce272175fb0c62db9 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Tue, 12 Sep 2023 12:23:32 -0400 Subject: [PATCH] build: bugfix: missed commit nestlog.cmake --- cmake/nestlog.cmake | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 cmake/nestlog.cmake diff --git a/cmake/nestlog.cmake b/cmake/nestlog.cmake new file mode 100644 index 00000000..30736007 --- /dev/null +++ b/cmake/nestlog.cmake @@ -0,0 +1,31 @@ +# ---------------------------------------------------------------- +# use this in subdirs that compile c++ code +# +macro(xo_include_options target) + # ---------------------------------------------------------------- + # PROJECT_SOURCE_DIR: + # so we can for example write + # #include "nestlog/scope.hpp" + # from anywhere in the project + # PROJECT_BINARY_DIR: + # since generated version file will be in build directory, + # need that build directory to also appear in + # compiler's include path + # + target_include_directories( + ${target} PUBLIC + ${PROJECT_SOURCE_DIR}/include + ${PROJECT_BINARY_DIR} + ) + + # ---------------------------------------------------------------- + # make standard directories for std:: includes explicit + # so that + # (1) they appear in compile_commands.json. + # (2) clangd (run from emacs lsp-mode) can find them + # + if(CMAKE_EXPORT_COMPILE_COMMANDS) + set(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES + ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES}) + endif() +endmacro()