diff --git a/.github/workflows/nob.yaml b/.github/workflows/nob.yaml index 28fcdd7..30f36a9 100644 --- a/.github/workflows/nob.yaml +++ b/.github/workflows/nob.yaml @@ -4,37 +4,55 @@ on: [push, pull_request] jobs: macos: runs-on: macos-latest + strategy: + matrix: + compiler: + - exec: clang + std: c99 + - exec: clang++ + std: c++20 steps: - name: Clone GIT repo uses: actions/checkout@v4 - name: Run tests run: | - clang -o nob nob.c + ${{ matrix.compiler.exec }} -o nob nob.c -std=${{ matrix.compiler.std }} ./nob - name: Build how_to-s run: | cd how_to/ - clang -o nob nob.c + ${{ matrix.compiler.exec }} -o nob nob.c -std=${{ matrix.compiler.std }} ./nob ubuntu: strategy: matrix: - cc: [gcc, clang] + compiler: + - exec: clang + std: c99 + - exec: clang++ + std: c++20 + - exec: gcc + std: c99 + - exec: g++ + std: c++20 runs-on: ubuntu-latest steps: - name: Clone GIT repo uses: actions/checkout@v4 - name: Build tests run: | - ${{ matrix.cc }} -o nob nob.c + ${{ matrix.compiler.exec }} -o nob nob.c -std=${{ matrix.compiler.std }} ./nob - name: Build how_to-s run: | cd how_to/ - ${{ matrix.cc }} -o nob nob.c + ${{ matrix.compiler.exec }} -o nob nob.c -std=${{ matrix.compiler.std }} ./nob windows: runs-on: windows-latest + strategy: + matrix: + standard: [c++14, c11] steps: - name: Clone GIT repo uses: actions/checkout@v4 @@ -46,12 +64,12 @@ jobs: # https://learn.microsoft.com/en-us/cpp/build/building-on-the-command-line?view=msvc-170#create-your-own-command-prompt-shortcut run: | call "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Auxiliary\\Build\\vcvars64.bat" - cl.exe ${{ matrix.hotreload }} /Fe:nob nob.c + cl.exe /std:${{ matrix.standard }} /Fe:nob nob.c nob.exe - name: Build how_to-s shell: cmd run: | call "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Auxiliary\\Build\\vcvars64.bat" cd how_to/ - cl.exe ${{ matrix.hotreload }} /Fe:nob nob.c + cl.exe /std:${{ matrix.standard }} /Fe:nob nob.c nob.exe diff --git a/how_to/010_nob_two_stage/nob.c b/how_to/010_nob_two_stage/nob.c index 6aada33..227d3e7 100644 --- a/how_to/010_nob_two_stage/nob.c +++ b/how_to/010_nob_two_stage/nob.c @@ -33,7 +33,7 @@ int main(int argc, char **argv) const char *input_path = SRC_BUILD_FOLDER"nob_configed.c"; nob_cc(&cmd); nob_cc_flags(&cmd); - nob_cmd_append(&cmd, "-I.", "-I"BUILD_FOLDER, "-I"SRC_BUILD_FOLDER); // -I is usually the same across all compilers + nob_cmd_append(&cmd, "-I.", "-I" BUILD_FOLDER, "-I" SRC_BUILD_FOLDER); // -I is usually the same across all compilers nob_cc_output(&cmd, output_path); nob_cc_inputs(&cmd, input_path); if (!cmd_run_sync_and_reset(&cmd)) return 1;