diff --git a/.github/workflows/pipeline.yml b/.github/workflows/pipeline.yml index edb67a7a3..efbdf043c 100644 --- a/.github/workflows/pipeline.yml +++ b/.github/workflows/pipeline.yml @@ -17,8 +17,9 @@ jobs: fail-fast: false matrix: include: - - { os: 'ubuntu-24.04', cxx: 'clang++-18', cc: 'clang-18', generator: 'Unix Makefiles', packages: 'clang-18' } - - { os: 'ubuntu-24.04', cxx: 'g++-14', cc: 'gcc-14', generator: 'Unix Makefiles', packages: 'g++-14' } + - { os: 'ubuntu-24.04', cxx: 'clang++-18', cc: 'clang-18', generator: 'Ninja', packages: 'clang-18' } + - { os: 'ubuntu-24.04', cxx: 'clang++-19', cc: 'clang-19', generator: 'Ninja', packages: 'clang-19' } + - { os: 'ubuntu-24.04', cxx: 'g++-14', cc: 'gcc-14', generator: 'Ninja', packages: 'g++-14' } - { os: 'windows-latest', cxx: 'cl', cc: 'cl', generator: 'Ninja', config: 'Debug' } - { os: 'windows-latest', cxx: 'cl', cc: 'cl', generator: 'Ninja', config: 'Release' } name: '${{ matrix.os }} / ${{ matrix.cxx }} / ${{ matrix.generator }} / ${{ matrix.config }}' @@ -32,6 +33,15 @@ jobs: uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 - name: 'Install: MSVC' uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 + - name: 'Install Ninja' + if: ${{ matrix.os == 'ubuntu-24.04' }} + run: sudo apt install ninja-build + - name: 'Install: Clang 19' + if: ${{ matrix.cxx == 'clang++-19' }} + run: | + wget https://apt.llvm.org/llvm.sh + chmod +x llvm.sh + sudo ./llvm.sh 19 all - name: 'Configure' env: CXX: '${{ matrix.cxx }}' diff --git a/CMakeLists.txt b/CMakeLists.txt index 6522c29c5..190b8dd5c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,8 +46,10 @@ project( VERSION "0.4.0") set(CMAKE_CXX_EXTENSIONS OFF) +set(CMAKE_CXX_MODULE_STD ON) set(CMAKE_CXX_STANDARD 23) set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD ON) set(CMAKE_INTERPROCEDURAL_OPTIMIZATION ON) set(CPACK_PACKAGE_CHECKSUM "SHA512") set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_SOURCE_DIR}/README.md") diff --git a/benchmark/baseline.cpp b/benchmark/baseline.cpp index b7c39d47a..4bbaa23df 100644 --- a/benchmark/baseline.cpp +++ b/benchmark/baseline.cpp @@ -38,10 +38,9 @@ For more information, please refer to */ #include "benchmark.hpp" -#include +import std; -#include -#include +#include namespace fcarouge::benchmark { namespace { diff --git a/benchmark/include/benchmark.hpp b/benchmark/include/benchmark.hpp index 698fac775..be282beae 100644 --- a/benchmark/include/benchmark.hpp +++ b/benchmark/include/benchmark.hpp @@ -42,8 +42,7 @@ For more information, please refer to */ //! @file //! @brief Benchmarking support. -#include -#include +import std; namespace fcarouge::benchmark { //! @brief Type of the platform steady benchmark clock. diff --git a/benchmark/predict_1x1x0.cpp b/benchmark/predict_1x1x0.cpp index 2fb1208dd..c30d5f1ca 100644 --- a/benchmark/predict_1x1x0.cpp +++ b/benchmark/predict_1x1x0.cpp @@ -41,8 +41,7 @@ For more information, please refer to */ #include -#include -#include +import std; namespace fcarouge::benchmark { namespace { diff --git a/benchmark/predict_1x1x1.cpp b/benchmark/predict_1x1x1.cpp index f2faf3e27..a9d4b1b3d 100644 --- a/benchmark/predict_1x1x1.cpp +++ b/benchmark/predict_1x1x1.cpp @@ -41,9 +41,7 @@ For more information, please refer to */ #include -#include -#include -#include +import std; namespace fcarouge::benchmark { namespace { diff --git a/benchmark/predict_linalg_x1x.cpp b/benchmark/predict_linalg_x1x.cpp index 37dd352ef..ad1e21653 100644 --- a/benchmark/predict_linalg_x1x.cpp +++ b/benchmark/predict_linalg_x1x.cpp @@ -43,13 +43,7 @@ For more information, please refer to */ #include -#include -#include -#include -#include -#include -#include -#include +import std; namespace fcarouge::benchmark { namespace { diff --git a/benchmark/update_1x1x0.cpp b/benchmark/update_1x1x0.cpp index 3e6fcfef8..afd7f1226 100644 --- a/benchmark/update_1x1x0.cpp +++ b/benchmark/update_1x1x0.cpp @@ -41,9 +41,7 @@ For more information, please refer to */ #include -#include -#include -#include +import std; namespace fcarouge::benchmark { namespace { diff --git a/benchmark/update_1x1x1.cpp b/benchmark/update_1x1x1.cpp index 1c325ed5d..c9012ac61 100644 --- a/benchmark/update_1x1x1.cpp +++ b/benchmark/update_1x1x1.cpp @@ -41,9 +41,7 @@ For more information, please refer to */ #include -#include -#include -#include +import std; namespace fcarouge::benchmark { namespace { diff --git a/benchmark/update_linalg_xx0.cpp b/benchmark/update_linalg_xx0.cpp index 2b12be774..964bf69e3 100644 --- a/benchmark/update_linalg_xx0.cpp +++ b/benchmark/update_linalg_xx0.cpp @@ -43,13 +43,7 @@ For more information, please refer to */ #include -#include -#include -#include -#include -#include -#include -#include +import std; template constexpr auto fcarouge::operator/(const Numerator &lhs, const Denominator &rhs) diff --git a/include/fcarouge/internal/format.hpp b/include/fcarouge/internal/format.hpp index 9bea11d17..1fbcb12b4 100644 --- a/include/fcarouge/internal/format.hpp +++ b/include/fcarouge/internal/format.hpp @@ -41,8 +41,7 @@ For more information, please refer to */ #include "fcarouge/utility.hpp" -#include -#include +import std; namespace fcarouge { template class kalman; diff --git a/include/fcarouge/internal/function.hpp b/include/fcarouge/internal/function.hpp index 97501eee6..a0d950af0 100644 --- a/include/fcarouge/internal/function.hpp +++ b/include/fcarouge/internal/function.hpp @@ -39,7 +39,7 @@ For more information, please refer to */ #ifndef FCAROUGE_INTERNAL_FUNCTION_HPP #define FCAROUGE_INTERNAL_FUNCTION_HPP -#include +import std; namespace fcarouge::internal { // Compile-time `std::function` partial drop-in. diff --git a/include/fcarouge/internal/utility.hpp b/include/fcarouge/internal/utility.hpp index c82d79862..1138f8685 100644 --- a/include/fcarouge/internal/utility.hpp +++ b/include/fcarouge/internal/utility.hpp @@ -39,8 +39,7 @@ For more information, please refer to */ #ifndef FCAROUGE_INTERNAL_UTILITY_HPP #define FCAROUGE_INTERNAL_UTILITY_HPP -#include -#include +import std; namespace fcarouge::internal { template diff --git a/include/fcarouge/kalman.hpp b/include/fcarouge/kalman.hpp index 082cb4a5a..52c35bf4a 100644 --- a/include/fcarouge/kalman.hpp +++ b/include/fcarouge/kalman.hpp @@ -51,11 +51,7 @@ For more information, please refer to */ #include "internal/format.hpp" #include "utility.hpp" -#include -#include -#include -#include -#include +import std; namespace fcarouge { //! @name Types diff --git a/linalg/lazy/fcarouge/linalg.hpp b/linalg/lazy/fcarouge/linalg.hpp index b46c04e15..5fd6b7ce9 100644 --- a/linalg/lazy/fcarouge/linalg.hpp +++ b/linalg/lazy/fcarouge/linalg.hpp @@ -49,14 +49,7 @@ For more information, please refer to */ #include "fcarouge/utility.hpp" -#include -#include -#include -#include -#include -#include -#include -#include +import std; namespace fcarouge { // Semantic? Guarantees? to_generator? std::ranges::to overload? make_generator? diff --git a/sample/ekf_4x1x0_soaring.cpp b/sample/ekf_4x1x0_soaring.cpp index 6ef201556..70a346e57 100644 --- a/sample/ekf_4x1x0_soaring.cpp +++ b/sample/ekf_4x1x0_soaring.cpp @@ -2,7 +2,8 @@ #include "fcarouge/linalg.hpp" #include -#include + +import std; namespace fcarouge::sample { namespace { diff --git a/sample/kf_1x1x0_building_height.cpp b/sample/kf_1x1x0_building_height.cpp index db0dd55f1..242836cee 100644 --- a/sample/kf_1x1x0_building_height.cpp +++ b/sample/kf_1x1x0_building_height.cpp @@ -1,7 +1,8 @@ #include "fcarouge/kalman.hpp" #include -#include + +import std; namespace fcarouge::sample { namespace { diff --git a/sample/kf_1x1x0_liquid_temperature.cpp b/sample/kf_1x1x0_liquid_temperature.cpp index ad4217ef2..d24e0bd35 100644 --- a/sample/kf_1x1x0_liquid_temperature.cpp +++ b/sample/kf_1x1x0_liquid_temperature.cpp @@ -1,7 +1,8 @@ #include "fcarouge/kalman.hpp" #include -#include + +import std; namespace fcarouge::sample { namespace { diff --git a/sample/kf_1x1x1_dog_position.cpp b/sample/kf_1x1x1_dog_position.cpp index efe5806b5..2bc79fbd3 100644 --- a/sample/kf_1x1x1_dog_position.cpp +++ b/sample/kf_1x1x1_dog_position.cpp @@ -1,7 +1,8 @@ #include "fcarouge/kalman.hpp" #include -#include + +import std; namespace fcarouge::sample { namespace { diff --git a/sample/kf_2x1x1_rocket_altitude.cpp b/sample/kf_2x1x1_rocket_altitude.cpp index cab4713c5..f9f84ba57 100644 --- a/sample/kf_2x1x1_rocket_altitude.cpp +++ b/sample/kf_2x1x1_rocket_altitude.cpp @@ -2,8 +2,8 @@ #include "fcarouge/linalg.hpp" #include -#include -#include + +import std; namespace fcarouge::sample { namespace { diff --git a/sample/kf_6x2x0_vehicle_location.cpp b/sample/kf_6x2x0_vehicle_location.cpp index 70378e756..36458e04b 100644 --- a/sample/kf_6x2x0_vehicle_location.cpp +++ b/sample/kf_6x2x0_vehicle_location.cpp @@ -2,7 +2,8 @@ #include "fcarouge/linalg.hpp" #include -#include + +import std; template constexpr auto fcarouge::operator/(const Numerator &lhs, const Denominator &rhs) diff --git a/sample/kf_8x4x0_deep_sort_bounding_box.cpp b/sample/kf_8x4x0_deep_sort_bounding_box.cpp index a29c07cc0..eaeba4f37 100644 --- a/sample/kf_8x4x0_deep_sort_bounding_box.cpp +++ b/sample/kf_8x4x0_deep_sort_bounding_box.cpp @@ -2,7 +2,8 @@ #include "fcarouge/linalg.hpp" #include -#include + +import std; template constexpr auto fcarouge::operator/(const Numerator &lhs, const Denominator &rhs) diff --git a/support/CMakeLists.txt b/support/CMakeLists.txt index d7e36a371..ea13ae3f8 100644 --- a/support/CMakeLists.txt +++ b/support/CMakeLists.txt @@ -103,5 +103,7 @@ elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") target_link_options(kalman_options INTERFACE "LINKER:-pie" "LINKER:-z,relro,-z,now") elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - target_compile_options(kalman_options INTERFACE "/EHsc" "/W4") + target_compile_options( + kalman_options INTERFACE "/EHsc" "/W4" "/experimental:module" + "/std:c++latest") endif() diff --git a/test/kalman_format.cpp b/test/kalman_format.cpp index 9e7049652..a0bb0a42e 100644 --- a/test/kalman_format.cpp +++ b/test/kalman_format.cpp @@ -39,7 +39,8 @@ For more information, please refer to */ #include "fcarouge/kalman.hpp" #include -#include + +import std; namespace fcarouge::test { namespace { diff --git a/test/kalman_format_arguments.cpp b/test/kalman_format_arguments.cpp index 0b84763b8..b480942db 100644 --- a/test/kalman_format_arguments.cpp +++ b/test/kalman_format_arguments.cpp @@ -39,7 +39,8 @@ For more information, please refer to */ #include "fcarouge/kalman.hpp" #include -#include + +import std; namespace fcarouge::test { namespace { diff --git a/test/kalman_format_float_1x1x1.cpp b/test/kalman_format_float_1x1x1.cpp index 11512502e..40a887633 100644 --- a/test/kalman_format_float_1x1x1.cpp +++ b/test/kalman_format_float_1x1x1.cpp @@ -39,7 +39,8 @@ For more information, please refer to */ #include "fcarouge/kalman.hpp" #include -#include + +import std; namespace fcarouge::test { namespace { diff --git a/test/linalg_identity_default.cpp b/test/linalg_identity_default.cpp index e3c7259af..d3840107a 100644 --- a/test/linalg_identity_default.cpp +++ b/test/linalg_identity_default.cpp @@ -39,7 +39,8 @@ For more information, please refer to */ #include "fcarouge/linalg.hpp" #include -#include + +import std; namespace fcarouge::test { namespace { diff --git a/test/linalg_zero_default.cpp b/test/linalg_zero_default.cpp index 98f67dcf8..72083ee37 100644 --- a/test/linalg_zero_default.cpp +++ b/test/linalg_zero_default.cpp @@ -39,7 +39,8 @@ For more information, please refer to */ #include "fcarouge/linalg.hpp" #include -#include + +import std; namespace fcarouge::test { namespace {