diff --git a/.github/workflows/build-static.yml b/.github/workflows/build-static.yml index f88b9ce2f1..fa7b205b4c 100644 --- a/.github/workflows/build-static.yml +++ b/.github/workflows/build-static.yml @@ -87,13 +87,43 @@ jobs: run: echo $env:PATH shell: powershell + #@@@ #- name: Setup tmate session #uses: mxschmitt/action-tmate@v3 + - name: configure run: | - env | grep '^CMAKE\|^QUICK_LINT_JS' | sort - cmake ${CMAKE_C_COMPILER:+-DCMAKE_C_COMPILER="${CMAKE_C_COMPILER}"} ${CMAKE_CXX_COMPILER:+-DCMAKE_CXX_COMPILER="${CMAKE_CXX_COMPILER}"} -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=${{ matrix.toolchain.test }} -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=YES -DCMAKE_C_FLAGS="${CMAKE_C_FLAGS}" -DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS}" -DCMAKE_EXE_LINKER_FLAGS="${CMAKE_EXE_LINKER_FLAGS}" -DCMAKE_SHARED_LINKER_FLAGS="${CMAKE_SHARED_LINKER_FLAGS}" ${{ fromJSON('["", "-DQUICK_LINT_JS_USE_BUILD_TOOLS=${PWD}/build-tools"]')[matrix.toolchain.cross_compiling] }} ${CMAKE_EXTRA_FLAGS} -S . -B build - shell: bash + import os + import shlex + import subprocess + + def var(name): + return os.environ.get(name, '') + + command = [ + "cmake", + "-DCMAKE_BUILD_TYPE=Release", + "-DBUILD_TESTING=${{ matrix.toolchain.test }}", + "-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=YES", + "-S", ".", "-B", "build", + f"-DCMAKE_C_FLAGS={var('CMAKE_C_FLAGS')}", + f"-DCMAKE_CXX_FLAGS=${var('CMAKE_CXX_FLAGS')}", + f"-DCMAKE_EXE_LINKER_FLAGS=${var('CMAKE_EXE_LINKER_FLAGS')}", + f"-DCMAKE_SHARED_LINKER_FLAGS=${var('CMAKE_SHARED_LINKER_FLAGS')}", + ] + c_compiler = var('CMAKE_C_COMPILER') + if c_compiler: command.append(f"-DCMAKE_C_COMPILER={c_compiler}") + cxx_compiler = var('CMAKE_CXX_COMPILER') + if cxx_compiler: command.append(f"-DCMAKE_CXX_COMPILER={cxx_compiler}") + if "${{ matrix.toolchain.cross_compiling }}": + commands.extend(f"-DQUICK_LINT_JS_USE_BUILD_TOOLS={os.getcwd()}/build-tools") + command.extend(var('CMAKE_EXTRA_FLAGS').split()) + + print(" ".join(shlex.quote(arg) for arg in command)) + result = subprocess.run(command) + os.exit(result.returncode) + shell: python + - name: build run: cmake --build build --config Release - name: test