build: IWYU support added

This commit is contained in:
Mateusz Pusz committed 2021-03-30 13:15:47 +02:00
1 parent 5251a8a241
commit 01935996e6
8 files changed
+194 -15

No files matched your search

+5
View File
@@ -26,6 +26,11 @@ project(mp-units
LANGUAGES CXX
)
option(UNITS_AS_SYSTEM_HEADERS "Exports library as system headers" OFF)
if(UNITS_AS_SYSTEM_HEADERS)
set(units_as_system SYSTEM)
endif()
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
include(AddUnitsModule)
+1 -1
View File
@@ -28,7 +28,7 @@ cmake_minimum_required(VERSION 3.15)
function(add_units_module name)
add_library(mp-units-${name} INTERFACE)
target_link_libraries(mp-units-${name} INTERFACE ${ARGN})
target_include_directories(mp-units-${name} INTERFACE
target_include_directories(mp-units-${name} ${units_as_system} INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
+1 -1
View File
@@ -39,7 +39,7 @@ target_compile_features(mp-units-core INTERFACE cxx_std_20)
target_link_libraries(mp-units-core INTERFACE
gsl::gsl-lite
)
target_include_directories(mp-units-core INTERFACE
target_include_directories(mp-units-core ${units_as_system} INTERFACE
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)