refactor: modules support redesigned
This commit is contained in:
1 parent
b582e200a0
commit
0eaf6e2e56
129 files changed
+271
-838
No files matched your search
+2
-4
@@ -22,7 +22,5 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
add_subdirectory(unit_test/runtime)
|
||||
add_subdirectory(unit_test/static)
|
||||
|
||||
# add_subdirectory(metabench)
|
||||
add_subdirectory(runtime)
|
||||
add_subdirectory(static)
|
||||
@@ -25,12 +25,10 @@ cmake_minimum_required(VERSION 3.5)
|
||||
find_package(Catch2 3 CONFIG REQUIRED)
|
||||
|
||||
add_executable(unit_tests_runtime distribution_test.cpp fmt_test.cpp math_test.cpp)
|
||||
if(TARGET mp-units::modules)
|
||||
target_link_libraries(unit_tests_runtime PRIVATE mp-units::modules)
|
||||
else()
|
||||
target_link_libraries(unit_tests_runtime PRIVATE mp-units::mp-units)
|
||||
if(${projectPrefix}BUILD_CXX_MODULES)
|
||||
target_compile_definitions(unit_tests_runtime PUBLIC ${projectPrefix}MODULES)
|
||||
endif()
|
||||
target_link_libraries(unit_tests_runtime PRIVATE Catch2::Catch2WithMain)
|
||||
target_link_libraries(unit_tests_runtime PRIVATE mp-units::mp-units Catch2::Catch2WithMain)
|
||||
|
||||
if(${projectPrefix}BUILD_LA)
|
||||
find_package(wg21_linear_algebra CONFIG REQUIRED)
|
||||
@@ -21,7 +21,7 @@
|
||||
// SOFTWARE.
|
||||
|
||||
#include <catch2/matchers/catch_matchers_templated.hpp>
|
||||
#include <mp-units/bits/fmt_hacks.h>
|
||||
#include <mp-units/compat_fmt_macros.h>
|
||||
#include <algorithm>
|
||||
#ifdef MP_UNITS_MODULES
|
||||
import mp_units;
|
||||
File renamed without changes.
@@ -22,7 +22,7 @@
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <catch2/matchers/catch_matchers_exception.hpp>
|
||||
#include <mp-units/bits/fmt_hacks.h>
|
||||
#include <mp-units/compat_fmt_macros.h>
|
||||
#include <iomanip>
|
||||
#include <limits>
|
||||
#include <locale>
|
||||
+1
-1
@@ -21,7 +21,7 @@
|
||||
// SOFTWARE.
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
#include <mp-units/bits/fmt_hacks.h>
|
||||
#include <mp-units/compat_fmt_macros.h>
|
||||
#include <cmath>
|
||||
#include <matrix>
|
||||
#ifdef MP_UNITS_MODULES
|
||||
@@ -30,8 +30,7 @@ import mp_units;
|
||||
#include <mp-units/ostream.h>
|
||||
#include <mp-units/systems/angular/angular.h>
|
||||
#include <mp-units/systems/isq/space_and_time.h>
|
||||
#include <mp-units/systems/si/unit_symbols.h>
|
||||
#include <mp-units/systems/si/units.h>
|
||||
#include <mp-units/systems/si/si.h>
|
||||
#endif
|
||||
|
||||
using namespace mp_units;
|
||||
@@ -23,11 +23,10 @@
|
||||
cmake_minimum_required(VERSION 3.5)
|
||||
|
||||
add_library(unit_tests_static_truncating quantity_test.cpp)
|
||||
if(TARGET mp-units::modules)
|
||||
target_link_libraries(unit_tests_static_truncating PRIVATE mp-units::modules)
|
||||
else()
|
||||
target_link_libraries(unit_tests_static_truncating PRIVATE mp-units::mp-units)
|
||||
if(${projectPrefix}BUILD_CXX_MODULES)
|
||||
target_compile_definitions(unit_tests_static_truncating PUBLIC ${projectPrefix}MODULES)
|
||||
endif()
|
||||
target_link_libraries(unit_tests_static_truncating PRIVATE mp-units::mp-units)
|
||||
target_compile_options(
|
||||
unit_tests_static_truncating PRIVATE $<IF:$<CXX_COMPILER_ID:MSVC>,/wd4242 /wd4244,-Wno-conversion>
|
||||
)
|
||||
@@ -68,9 +67,8 @@ add_library(
|
||||
usc_test.cpp
|
||||
)
|
||||
|
||||
if(TARGET mp-units::modules)
|
||||
target_link_libraries(unit_tests_static PRIVATE mp-units::modules)
|
||||
else()
|
||||
target_link_libraries(unit_tests_static PRIVATE mp-units::mp-units)
|
||||
target_link_libraries(unit_tests_static PRIVATE mp-units::mp-units)
|
||||
if(${projectPrefix}BUILD_CXX_MODULES)
|
||||
target_compile_definitions(unit_tests_static PUBLIC ${projectPrefix}MODULES)
|
||||
endif()
|
||||
target_link_libraries(unit_tests_static PRIVATE unit_tests_static_truncating)
|
||||
File renamed without changes.
File renamed without changes.
@@ -27,9 +27,8 @@
|
||||
import mp_units;
|
||||
#else
|
||||
#include <mp-units/bits/external/type_traits.h>
|
||||
#include <mp-units/chrono.h>
|
||||
#include <mp-units/quantity_point.h>
|
||||
#include <mp-units/systems/si/unit_symbols.h>
|
||||
#include <mp-units/systems/si/si.h>
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
File renamed without changes.
@@ -27,7 +27,6 @@
|
||||
#ifdef MP_UNITS_MODULES
|
||||
import mp_units;
|
||||
#else
|
||||
#include <mp-units/chrono.h>
|
||||
#include <mp-units/concepts.h>
|
||||
#include <mp-units/quantity_point.h>
|
||||
#include <mp-units/systems/isq/space_and_time.h>
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
+1
-1
@@ -20,7 +20,7 @@
|
||||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
|
||||
#include <mp-units/quantity_spec_macro.h>
|
||||
#include <mp-units/compat_macros.h>
|
||||
#ifdef MP_UNITS_MODULES
|
||||
import mp_units;
|
||||
#else
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -28,7 +28,6 @@
|
||||
#include <chrono>
|
||||
import mp_units;
|
||||
#else
|
||||
#include <mp-units/chrono.h>
|
||||
#include <mp-units/quantity_point.h>
|
||||
#include <mp-units/systems/isq/isq.h>
|
||||
#include <mp-units/systems/si/si.h>
|
||||
File renamed without changes.
@@ -29,7 +29,6 @@
|
||||
#include <chrono>
|
||||
import mp_units;
|
||||
#else
|
||||
#include <mp-units/chrono.h>
|
||||
#include <mp-units/systems/isq/mechanics.h>
|
||||
#include <mp-units/systems/isq/space_and_time.h>
|
||||
#include <mp-units/systems/si/si.h>
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -24,7 +24,7 @@
|
||||
|
||||
#include <type_traits>
|
||||
#ifdef MP_UNITS_MODULES
|
||||
#include <mp-units/quantity_spec_macro.h>
|
||||
#include <mp-units/compat_macros.h>
|
||||
import mp_units;
|
||||
#else
|
||||
#include <mp-units/quantity_spec.h>
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Reference in new issue
Block a user