From da68130c08c91d16e2a59e8bcd04dd23e33a01b4 Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Wed, 11 Dec 2024 20:38:23 +0100 Subject: [PATCH] Turn VCREDIST into a cache variable --- .github/workflows/windows.yml | 5 ++--- CMakeLists.txt | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index dbf16158f1..b00b8c1a31 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -104,6 +104,7 @@ jobs: -D OPENMW_USE_SYSTEM_SQLITE3=OFF -D OPENMW_USE_SYSTEM_YAML_CPP=OFF -D OPENMW_LTO_BUILD=ON + ${{ inputs.package && format('-D "VCREDIST64={0}/vc_redist.x64.exe"', env.VCToolsRedistDir) || '' }} - name: Build OpenMW run: cmake --build ${{ github.workspace }}/build @@ -116,9 +117,7 @@ jobs: - name: Ensure DLLs end up in the build dir if: ${{ inputs.package }} - run: | - cp "${{ env.VCToolsRedistDir }}/vc_redist.x64.exe" "${{ github.workspace }}/build" - echo "dlldir=${{ github.workspace }}/build" >> $env:GITHUB_ENV + run: echo "dlldir=${{ github.workspace }}/build" >> $env:GITHUB_ENV - name: Copy missing DLLs run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index 80a50297ef..51f35fa0a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1006,13 +1006,13 @@ elseif(NOT APPLE) SET(CPACK_NSIS_MUI_UNIICON "${OpenMW_SOURCE_DIR}/files/windows/openmw.ico") SET(CPACK_PACKAGE_ICON "${OpenMW_SOURCE_DIR}\\\\files\\\\openmw.bmp") - SET(VCREDIST32 "${OpenMW_BINARY_DIR}/vcredist_x86.exe") + SET(VCREDIST32 "${OpenMW_BINARY_DIR}/vcredist_x86.exe" CACHE FILEPATH "Path to vcredist_x86.exe") if(EXISTS ${VCREDIST32}) INSTALL(FILES ${VCREDIST32} DESTINATION "redist") SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "ExecWait '\\\"$INSTDIR\\\\redist\\\\vcredist_x86.exe\\\" /q /norestart'" ) endif(EXISTS ${VCREDIST32}) - SET(VCREDIST64 "${OpenMW_BINARY_DIR}/vcredist_x64.exe") + SET(VCREDIST64 "${OpenMW_BINARY_DIR}/vcredist_x64.exe" CACHE FILEPATH "Path to vcredist_x64.exe") if(EXISTS ${VCREDIST64}) INSTALL(FILES ${VCREDIST64} DESTINATION "redist") SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "ExecWait '\\\"$INSTDIR\\\\redist\\\\vcredist_x64.exe\\\" /q /norestart'" )