diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e57a80f..8dcf350 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -144,3 +144,26 @@ jobs: - name: Run memory tests run: make test-memory TEST_DATA_BRANCH=${{env.TEST_DATA_BRANCH_NAME}} + + cxx-modules-test: + runs-on: macos-latest + name: Build with C++20 modules + + steps: + - name: Checkout code + uses: actions/checkout@v6 + with: + repository: ${{ github.event.pull_request.head.repo.full_name || 'Eppo-exp/cpp-sdk' }} + ref: ${{ env.SDK_BRANCH_NAME }} + + - name: Set up build environment + run: | + brew install re2 + brew install cmake + + - name: Build with -fmodules flag + run: | + mkdir -p build-modules + cd build-modules + cmake .. -DCMAKE_CXX_FLAGS="-fmodules" -DEPPOCLIENT_BUILD_TESTS=OFF -DEPPOCLIENT_ERR_ON_WARNINGS=OFF + cmake --build . diff --git a/third_party/nlohmann/json.hpp b/third_party/nlohmann/json.hpp index 8b72ea6..8961e50 100644 --- a/third_party/nlohmann/json.hpp +++ b/third_party/nlohmann/json.hpp @@ -6159,6 +6159,7 @@ NLOHMANN_JSON_NAMESPACE_END #ifndef JSON_NO_IO #include // FILE * #include // istream + #include // streambuf #endif // JSON_NO_IO // #include @@ -7378,6 +7379,7 @@ NLOHMANN_JSON_NAMESPACE_END #include // array #include // localeconv #include // size_t +#include // errno #include // snprintf #include // strtof, strtod, strtold, strtoll, strtoull #include // initializer_list