diff --git a/CMakeLists.txt b/CMakeLists.txt index e5ca6de3..8478cf15 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,8 +27,8 @@ list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") set(projectPrefix MP_UNITS_) -option(${projectPrefix}BUILD_LA "Build code depending on the linear algebra library" ON) -message(STATUS "${projectPrefix}BUILD_LA: ${${projectPrefix}BUILD_LA}") +option(${projectPrefix}DEV_BUILD_LA "Build code depending on the linear algebra library" ON) +message(STATUS "${projectPrefix}DEV_BUILD_LA: ${${projectPrefix}DEV_BUILD_LA}") # make sure that the file is being used as an entry point include(modern_project_structure) @@ -43,9 +43,9 @@ include(warnings) set_warnings() # enable include-what-you-use -option(${projectPrefix}IWYU "Enables include-what-you-use" OFF) +option(${projectPrefix}DEV_IWYU "Enables include-what-you-use" OFF) -if(${projectPrefix}IWYU) +if(${projectPrefix}DEV_IWYU) include(include-what-you-use) enable_iwyu( MAPPING_FILE "${PROJECT_SOURCE_DIR}/.mp-units.imp" @@ -53,10 +53,6 @@ if(${projectPrefix}IWYU) MAX_LINE_LENGTH 120 NO_COMMENTS ) - - if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") - set(${projectPrefix}AS_SYSTEM_HEADERS ON) - endif() endif() # enable_clang_tidy() diff --git a/conanfile.py b/conanfile.py index 922ae3ca..0cdb6c29 100644 --- a/conanfile.py +++ b/conanfile.py @@ -151,7 +151,9 @@ class MPUnitsConan(ConanFile): if self.options.cxx_modules: tc.cache_variables["CMAKE_CXX_SCAN_FOR_MODULES"] = True tc.cache_variables["MP_UNITS_BUILD_CXX_MODULES"] = True - tc.cache_variables["MP_UNITS_BUILD_LA"] = self._build_all and not self._skip_la + tc.cache_variables["MP_UNITS_DEV_BUILD_LA"] = ( + self._build_all and not self._skip_la + ) tc.cache_variables["MP_UNITS_USE_FMTLIB"] = bool(self.options.use_fmtlib) tc.generate() deps = CMakeDeps(self) diff --git a/docs/getting_started/installation_and_usage.md b/docs/getting_started/installation_and_usage.md index d741b579..b08850ae 100644 --- a/docs/getting_started/installation_and_usage.md +++ b/docs/getting_started/installation_and_usage.md @@ -239,8 +239,9 @@ tools.build:compiler_executables={"c": "gcc-12", "cpp": "g++-12"} [use fmtlib support]: https://github.com/mpusz/mp-units/releases/tag/v2.2.0 +#### Options for mp-units project developers -[`MP_UNITS_BUILD_LA`](#MP_UNITS_BUILD_LA){ #MP_UNITS_BUILD_LA } +[`MP_UNITS_DEV_BUILD_LA`](#MP_UNITS_DEV_BUILD_LA){ #MP_UNITS_DEV_BUILD_LA } : [:octicons-tag-24: 2.0.0][build la support] · :octicons-milestone-24: `ON`/`OFF` (Default: `ON`) @@ -249,12 +250,11 @@ tools.build:compiler_executables={"c": "gcc-12", "cpp": "g++-12"} [build la support]: https://github.com/mpusz/mp-units/releases/tag/v2.0.0 -[`MP_UNITS_IWYU`](#MP_UNITS_IWYU){ #MP_UNITS_IWYU } +[`MP_UNITS_DEV_IWYU`](#MP_UNITS_DEV_IWYU){ #MP_UNITS_DEV_IWYU } : [:octicons-tag-24: 2.0.0][iwyu support] · :octicons-milestone-24: `ON`/`OFF` (Default: `OFF`) Enables `include-what-you-use` when compiling with a clang compiler. - Additionally turns on [`MP_UNITS_AS_SYSTEM_HEADERS`](#MP_UNITS_AS_SYSTEM_HEADERS). [iwyu support]: https://github.com/mpusz/mp-units/releases/tag/v2.0.0 diff --git a/test/runtime/CMakeLists.txt b/test/runtime/CMakeLists.txt index 897957a9..f78c0ad4 100644 --- a/test/runtime/CMakeLists.txt +++ b/test/runtime/CMakeLists.txt @@ -30,7 +30,7 @@ if(${projectPrefix}BUILD_CXX_MODULES) endif() target_link_libraries(unit_tests_runtime PRIVATE mp-units::mp-units Catch2::Catch2WithMain) -if(${projectPrefix}BUILD_LA) +if(${projectPrefix}DEV_BUILD_LA) find_package(wg21_linear_algebra REQUIRED) target_sources(unit_tests_runtime PRIVATE linear_algebra_test.cpp) target_link_libraries(unit_tests_runtime PRIVATE wg21_linear_algebra::wg21_linear_algebra)