Skip to content

Commit

Permalink
See if we can set up the dev environment beforehand
Browse files Browse the repository at this point in the history
Running the vcvars64.bat script via CMake doesn't seem to be working for
some reason, so try https://github.com/orgs/community/discussions/26887
from the yml file
  • Loading branch information
starseeker committed Dec 19, 2023
1 parent 506d601 commit 488afe1
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 14 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ jobs:
uses: ilammy/msvc-dev-cmd@v1

- name: Configure
shell: cmd
run: |
call "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
cmake -S . -B build -G Ninja -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE=Release -DENABLE_ALL=ON
# We do the following in order to help ensure files are "flushed"
# to disk before compilation is attempted
Expand All @@ -52,7 +54,10 @@ jobs:
powershell Write-VolumeCache D
- name: Build
run: cd build && ninja -j2 -v
shell: cmd
run: |
call "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
cd build && ninja -j2 -v
# TODO - if the loading isn't too extreme, it would be good to do a BRL-CAD
# build against the output of this...
Expand Down Expand Up @@ -83,7 +88,9 @@ jobs:
uses: ilammy/msvc-dev-cmd@v1

- name: Configure
shell: cmd
run: |
call "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
cmake -S . -B build -G Ninja -DCMAKE_C_COMPILER="cl.exe" -DCMAKE_CXX_COMPILER="cl.exe" -DCMAKE_BUILD_TYPE=Debug -DENABLE_ALL=ON
# We do the following in order to help ensure files are "flushed"
# to disk before compilation is attempted
Expand All @@ -92,7 +99,10 @@ jobs:
powershell Write-VolumeCache D
- name: Build
run: cd build && ninja -j2 -v
shell: cmd
run: |
call "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
cd build && ninja -j2 -v
# TODO - if the loading isn't too extreme, it would be good to do a BRL-CAD
# build against the output of this...
Expand All @@ -118,7 +128,9 @@ jobs:
run: echo "$ENV{GITHUB_WORKSPACE}" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8

- name: Configure
shell: cmd
run: |
call "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
cmake -S . -B build -DENABLE_ALL=ON
# We do the following in order to help ensure files are "flushed"
# to disk before compilation is attempted
Expand All @@ -127,7 +139,9 @@ jobs:
powershell Write-VolumeCache D
- name: Build
shell: cmd
run: |
call "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
cmake --build build --config Release -j2
windows_std_tools_debug:
Expand All @@ -147,7 +161,9 @@ jobs:
run: echo "$ENV{GITHUB_WORKSPACE}" | Out-File -Append -FilePath $env:GITHUB_PATH -Encoding utf8

- name: Configure
shell: cmd
run: |
call "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
cmake -S . -B build -DENABLE_ALL=ON
# We do the following in order to help ensure files are "flushed"
# to disk before compilation is attempted
Expand All @@ -156,7 +172,9 @@ jobs:
powershell Write-VolumeCache D
- name: Build
shell: cmd
run: |
call "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
cmake --build build --config Debug -j2
Expand Down
8 changes: 1 addition & 7 deletions qt/qt_build.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,7 @@ else ()
message(WARNING "Unexpected CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} building Qt6")
endif ("${CMAKE_BUILD_TYPE}" STREQUAL "" OR "${CMAKE_BUILD_TYPE}" STREQUAL "Debug")


if (WIN32)
file(TO_NATIVE_PATH "@VCVARS_BAT@" VCVARS_BAT_NATIVE)
execute_process(COMMAND "${VCVARS_BAT_NATIVE}" && "@CMAKE_COMMAND@" --build . ${QT_CMAKE_OPTS} RESULT_VARIABLE QT_RET WORKING_DIRECTORY "@QT_BUILD_DIR@" OUTPUT_VARIABLE MSG ERROR_VARIABLE MSG)
else (WIN32)
execute_process(COMMAND "@CMAKE_COMMAND@" --build . ${QT_CMAKE_OPTS} RESULT_VARIABLE QT_RET WORKING_DIRECTORY "@QT_BUILD_DIR@" OUTPUT_VARIABLE MSG ERROR_VARIABLE MSG)
endif (WIN32)
execute_process(COMMAND "@CMAKE_COMMAND@" --build . ${QT_CMAKE_OPTS} RESULT_VARIABLE QT_RET WORKING_DIRECTORY "@QT_BUILD_DIR@" OUTPUT_VARIABLE MSG ERROR_VARIABLE MSG)

if (QT_RET)
message(FATAL_ERROR "Qt build failed: ${MSG}\n")
Expand Down
6 changes: 1 addition & 5 deletions qt/qt_config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ else ()
message(WARNING "Unexpected CMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} preparing Qt6")
endif ("${CMAKE_BUILD_TYPE}" STREQUAL "" OR "${CMAKE_BUILD_TYPE}" STREQUAL "Debug")

if (WIN32)
execute_process(COMMAND "@VCVARS_BAT@" && @QT_SOURCE_DIR@/${CONFIG_FILE} ${CONFIG_EXTRA_OPTS} ${QT_CONFIG_OPTS} --prefix=@CMAKE_BUNDLE_INSTALL_PREFIX@ RESULT_VARIABLE QT_RET WORKING_DIRECTORY @QT_BUILD_DIR@ OUTPUT_VARIABLE MSG ERROR_VARIABLE MSG)
else (WIN32)
execute_process(COMMAND @QT_SOURCE_DIR@/${CONFIG_FILE} ${CONFIG_EXTRA_OPTS} ${QT_CONFIG_OPTS} --prefix=@CMAKE_BUNDLE_INSTALL_PREFIX@ RESULT_VARIABLE QT_RET WORKING_DIRECTORY @QT_BUILD_DIR@ OUTPUT_VARIABLE MSG ERROR_VARIABLE MSG)
endif (WIN32)
execute_process(COMMAND @QT_SOURCE_DIR@/${CONFIG_FILE} ${CONFIG_EXTRA_OPTS} ${QT_CONFIG_OPTS} --prefix=@CMAKE_BUNDLE_INSTALL_PREFIX@ RESULT_VARIABLE QT_RET WORKING_DIRECTORY @QT_BUILD_DIR@ OUTPUT_VARIABLE MSG ERROR_VARIABLE MSG)

if (QT_RET)
message(FATAL_ERROR "Qt configure failed: ${MSG}\n")
Expand Down

0 comments on commit 488afe1

Please sign in to comment.