diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 237da67..1ab68e2 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -14,7 +14,7 @@ jobs: name: "Windows Latest MSVC", artifact: "Windows-MSVC.tar.xz", os: windows-latest, build_type: "Release", cc: "cl", cxx: "cl", - environment_script: "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat" + msvc: true } - { name: "Windows Latest MinGW", artifact: "Windows-MinGW.tar.xz", @@ -30,6 +30,10 @@ jobs: steps: - uses: actions/checkout@v1 + - name: Set up MSVC environment + if: matrix.config.msvc + uses: ilammy/msvc-dev-cmd@v1 + - name: Download Ninja and CMake id: cmake_and_ninja shell: cmake -P {0} @@ -78,19 +82,6 @@ jobs: 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() - file(TO_CMAKE_PATH "$ENV{GITHUB_WORKSPACE}/ninja" ninja_program) execute_process( @@ -112,15 +103,6 @@ jobs: run: | set(ENV{NINJA_STATUS} "[%f/%t %o/sec] ") - if ("${{ runner.os }}" STREQUAL "Windows" AND NOT "x${{ matrix.config.environment_script }}" STREQUAL "x") - 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() - execute_process( COMMAND ${{ steps.cmake_and_ninja.outputs.cmake_dir }}/cmake --build build RESULT_VARIABLE result