1
0
Fork 0

Update dependencies

This commit is contained in:
Duncan Ogilvie 2025-06-30 02:29:09 +02:00
parent a5cf563777
commit abe77409b5
3 changed files with 92 additions and 97 deletions

View File

@ -18,9 +18,6 @@ jobs:
submodules: recursive
fetch-depth: 1
- name: Install Ninja
uses: seanmiddleditch/gha-setup-ninja@3b1f8f94a2f8254bd26914c4ab9474d4f0015f67 # v6
- name: Visual Studio Development Environment
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
with:

View File

@ -1,93 +1,91 @@
if(CMAKE_SCRIPT_MODE_FILE)
set(GUI_DLL ${CMAKE_ARGV3})
set(DEPS_DIR ${CMAKE_ARGV4})
set(WINDEPLOYQT ${CMAKE_ARGV5})
get_filename_component(GUI_DIR ${GUI_DLL} DIRECTORY)
# Check if we already copied the dependencies
if(EXISTS "${GUI_DIR}/.deps_copied")
return()
endif()
message(STATUS "Copying dependencies from ${DEPS_DIR} to ${GUI_DIR}")
execute_process(
COMMAND ${WINDEPLOYQT} --no-compiler-runtime --no-translations --no-opengl-sw --force ${GUI_DLL} --list relative
OUTPUT_VARIABLE DEPS_COPIED
)
# Split the output into lines
string(REGEX REPLACE "\n" ";" DEPS_COPIED "${DEPS_COPIED}")
foreach(line ${DEPS_COPIED})
message(STATUS "Copying ${line}")
endforeach()
function(copy_dep relfile)
if(EXISTS ${relfile})
message(STATUS "Skipping ${relfile}")
return()
endif()
set(DEPS_COPIED ${DEPS_COPIED} ${relfile} PARENT_SCOPE)
message(STATUS "Copying ${relfile}")
get_filename_component(reldir ${relfile} DIRECTORY)
get_filename_component(relfile ${relfile} NAME)
file(COPY ${DEPS_DIR}/${relfile} DESTINATION ${GUI_DIR}/${reldir})
endfunction()
file(GLOB DEPS RELATIVE ${DEPS_DIR} "${DEPS_DIR}/*.dll")
foreach(DEP ${DEPS})
if(NOT DEP MATCHES "^(Qt5|msvc)")
copy_dep(${DEP})
endif()
endforeach()
copy_dep(GleeBug/TitanEngine.dll)
copy_dep(StaticEngine/TitanEngine.dll)
list(JOIN DEPS_COPIED "\n" DEPS_COPIED)
file(WRITE "${GUI_DIR}/.deps_copied" "${DEPS_COPIED}")
return()
endif()
if(NOT WIN32)
message(STATUS "copy_dependencies is only supported on Windows")
return()
endif()
if(NOT TARGET Qt5::windeployqt AND Qt5_FOUND AND TARGET Qt5::qmake)
get_target_property(_qt5_qmake_location Qt5::qmake IMPORTED_LOCATION)
execute_process(
COMMAND "${_qt5_qmake_location}" -query QT_INSTALL_PREFIX
RESULT_VARIABLE return_code
OUTPUT_VARIABLE qt5_install_prefix
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(imported_location "${qt5_install_prefix}/bin/windeployqt.exe")
if(NOT EXISTS ${imported_location})
message(FATAL_ERROR "Qt5 tool not found: ${imported_location}")
endif()
add_executable(Qt5::windeployqt IMPORTED)
set_target_properties(Qt5::windeployqt PROPERTIES
IMPORTED_LOCATION ${imported_location}
)
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(DEPS_DIR ${CMAKE_SOURCE_DIR}/deps/x64)
else()
set(DEPS_DIR ${CMAKE_SOURCE_DIR}/deps/x32)
endif()
add_custom_target(deps
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_LIST_DIR}/deps.cmake $<TARGET_FILE:gui> ${DEPS_DIR} $<TARGET_FILE:Qt5::windeployqt>
)
# Make a rebuild copy the dependencies again
set_target_properties(deps PROPERTIES
ADDITIONAL_CLEAN_FILES $<TARGET_FILE_DIR:gui>/.deps_copied
)
if(CMAKE_SCRIPT_MODE_FILE)
set(GUI_DLL ${CMAKE_ARGV3})
set(DEPS_DIR ${CMAKE_ARGV4})
set(WINDEPLOYQT ${CMAKE_ARGV5})
get_filename_component(GUI_DIR ${GUI_DLL} DIRECTORY)
# Check if we already copied the dependencies
if(EXISTS "${GUI_DIR}/.deps_copied")
return()
endif()
message(STATUS "Copying dependencies from ${DEPS_DIR} to ${GUI_DIR}")
execute_process(
COMMAND ${WINDEPLOYQT} --no-compiler-runtime --no-translations --no-opengl-sw --force ${GUI_DLL} --list relative
OUTPUT_VARIABLE DEPS_COPIED
)
# Split the output into lines
string(REGEX REPLACE "\n" ";" DEPS_COPIED "${DEPS_COPIED}")
foreach(line ${DEPS_COPIED})
message(STATUS "Copying ${line}")
endforeach()
function(copy_dep relfile)
if(EXISTS ${relfile})
message(STATUS "Skipping ${relfile}")
return()
endif()
set(DEPS_COPIED ${DEPS_COPIED} ${relfile} PARENT_SCOPE)
message(STATUS "Copying ${relfile}")
get_filename_component(reldir ${relfile} DIRECTORY)
get_filename_component(relfile ${relfile} NAME)
file(COPY ${DEPS_DIR}/${relfile} DESTINATION ${GUI_DIR}/${reldir})
endfunction()
file(GLOB DEPS RELATIVE ${DEPS_DIR} "${DEPS_DIR}/*.dll")
foreach(DEP ${DEPS})
copy_dep(${DEP})
endforeach()
copy_dep(GleeBug/TitanEngine.dll)
copy_dep(StaticEngine/TitanEngine.dll)
list(JOIN DEPS_COPIED "\n" DEPS_COPIED)
file(WRITE "${GUI_DIR}/.deps_copied" "${DEPS_COPIED}")
return()
endif()
if(NOT WIN32)
message(STATUS "copy_dependencies is only supported on Windows")
return()
endif()
if(NOT TARGET Qt5::windeployqt AND Qt5_FOUND AND TARGET Qt5::qmake)
get_target_property(_qt5_qmake_location Qt5::qmake IMPORTED_LOCATION)
execute_process(
COMMAND "${_qt5_qmake_location}" -query QT_INSTALL_PREFIX
RESULT_VARIABLE return_code
OUTPUT_VARIABLE qt5_install_prefix
OUTPUT_STRIP_TRAILING_WHITESPACE
)
set(imported_location "${qt5_install_prefix}/bin/windeployqt.exe")
if(NOT EXISTS ${imported_location})
message(FATAL_ERROR "Qt5 tool not found: ${imported_location}")
endif()
add_executable(Qt5::windeployqt IMPORTED)
set_target_properties(Qt5::windeployqt PROPERTIES
IMPORTED_LOCATION ${imported_location}
)
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(DEPS_DIR ${CMAKE_SOURCE_DIR}/deps/x64)
else()
set(DEPS_DIR ${CMAKE_SOURCE_DIR}/deps/x32)
endif()
add_custom_target(deps
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_LIST_DIR}/deps.cmake $<TARGET_FILE:gui> ${DEPS_DIR} $<TARGET_FILE:Qt5::windeployqt>
)
# Make a rebuild copy the dependencies again
set_target_properties(deps PROPERTIES
ADDITIONAL_CLEAN_FILES $<TARGET_FILE_DIR:gui>/.deps_copied
)

2
deps

@ -1 +1 @@
Subproject commit c8e552c9234b3d6512c6a3dba56303990c08ac42
Subproject commit c22755230eaa70ea3e7cc7ef6995dad2862d958b