From 9c8d03376dc05ae577132ef5f342deb6bb1a7a17 Mon Sep 17 00:00:00 2001 From: bialger Date: Thu, 18 Jan 2024 15:06:48 +0300 Subject: [PATCH] Some settings for Windows --- .github/workflows/ci_tests.yml | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_tests.yml b/.github/workflows/ci_tests.yml index 04b82b7..d34e49d 100644 --- a/.github/workflows/ci_tests.yml +++ b/.github/workflows/ci_tests.yml @@ -34,11 +34,27 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Configure + shell: cmake -P {0} + run: | + set(ENV{CC} ${{ matrix.config.cc }}) + set(ENV{CXX} ${{ matrix.config.cxx }}) + + if ("${{ runner.os }}" STREQUAL "Windows" AND NOT "x${{ matrix.config.environment_script }}" STREQUAL "x") + execute_process( + COMMAND "${{ matrix.config.environment_script }}" && set + OUTPUT_FILE environment_script_output.txt + ) + file(STRINGS environment_script_output.txt output_lines) + foreach(line IN LISTS output_lines) + if (line MATCHES "^([a-zA-Z0-9_-]+)=(.*)$") + set(ENV{${CMAKE_MATCH_1}} "${CMAKE_MATCH_2}") + endif() + endforeach() + endif() + - name: Create CMake cache shell: bash - env: - CC: ${{ matrix.config.cc }} - CXX: ${{ matrix.config.cxx }} run: | cmake -S . -B cmake-build -DCMAKE_CXX_COMPILER=$CXX -DCMAKE_C_COMPILER=$CC