build: Move PDB extraction to CI
This commit is contained in:
parent
d3d9a42d57
commit
199f78347f
19
.github/workflows/build.yml
vendored
19
.github/workflows/build.yml
vendored
@ -88,6 +88,25 @@ jobs:
|
||||
run: |
|
||||
cd build
|
||||
ninja install
|
||||
|
||||
- name: 🪲 Create PDBs
|
||||
run: |
|
||||
cd build
|
||||
|
||||
wget https://github.com/rainers/cv2pdb/releases/download/v0.52/cv2pdb-0.52.zip
|
||||
unzip cv2pdb-0.52.zip
|
||||
./cv2pdb.exe install/imhex.exe
|
||||
./cv2pdb.exe install/imhex-gui.exe
|
||||
./cv2pdb.exe install/libimhex.dll
|
||||
./cv2pdb.exe install/libpl.dll
|
||||
|
||||
for plugin in install/plugins/*.hexplug; do
|
||||
./cv2pdb.exe $plugin
|
||||
done
|
||||
|
||||
- name: 📦 Bundle MSI
|
||||
run: |
|
||||
cd build
|
||||
cpack
|
||||
mv ImHex-*.msi ../imhex-${{ env.IMHEX_VERSION }}-Windows-x86_64.msi
|
||||
|
||||
|
@ -81,7 +81,6 @@ if (IMHEX_ENABLE_UNIT_TESTS)
|
||||
endif ()
|
||||
|
||||
# Configure more resources that will be added to the install package
|
||||
generatePDBs()
|
||||
generateSDKDirectory()
|
||||
|
||||
# Handle package generation
|
||||
|
@ -790,65 +790,6 @@ function(enableUnityBuild TARGET)
|
||||
endif ()
|
||||
endfunction()
|
||||
|
||||
function(generatePDBs)
|
||||
if (NOT IMHEX_GENERATE_PDBS)
|
||||
return()
|
||||
endif ()
|
||||
|
||||
if (NOT WIN32 OR CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
return()
|
||||
endif ()
|
||||
|
||||
include(FetchContent)
|
||||
FetchContent_Declare(
|
||||
cv2pdb
|
||||
URL "https://github.com/rainers/cv2pdb/releases/download/v0.52/cv2pdb-0.52.zip"
|
||||
DOWNLOAD_EXTRACT_TIMESTAMP ON
|
||||
)
|
||||
FetchContent_MakeAvailable(cv2pdb)
|
||||
|
||||
set(PDBS_TO_GENERATE main main-forwarder libimhex ${PLUGINS} libpl)
|
||||
foreach (PDB ${PDBS_TO_GENERATE})
|
||||
if (PDB STREQUAL "main")
|
||||
set(GENERATED_PDB imhex)
|
||||
elseif (PDB STREQUAL "main-forwarder")
|
||||
set(GENERATED_PDB imhex-gui)
|
||||
elseif (PDB STREQUAL "libimhex")
|
||||
set(GENERATED_PDB libimhex)
|
||||
elseif (PDB STREQUAL "libpl")
|
||||
set(GENERATED_PDB libpl)
|
||||
else ()
|
||||
set(GENERATED_PDB plugins/${PDB})
|
||||
endif ()
|
||||
|
||||
if (NOT IMHEX_REPLACE_DWARF_WITH_PDB)
|
||||
set(PDB_OUTPUT_PATH ${CMAKE_BINARY_DIR}/${GENERATED_PDB})
|
||||
else ()
|
||||
set(PDB_OUTPUT_PATH)
|
||||
endif()
|
||||
|
||||
add_custom_target(${PDB}_pdb DEPENDS ${CMAKE_BINARY_DIR}/${GENERATED_PDB}.pdb)
|
||||
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/${GENERATED_PDB}.pdb
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
|
||||
COMMAND
|
||||
(
|
||||
${CMAKE_COMMAND} -E remove -f ${CMAKE_BINARY_DIR}/${GENERATED_PDB}.pdb &&
|
||||
${cv2pdb_SOURCE_DIR}/cv2pdb64.exe $<TARGET_FILE:${PDB}> ${PDB_OUTPUT_PATH} &&
|
||||
${CMAKE_COMMAND} -E remove -f ${CMAKE_BINARY_DIR}/${GENERATED_PDB}
|
||||
) || (exit 0)
|
||||
COMMAND_EXPAND_LISTS)
|
||||
|
||||
if (IMHEX_REPLACE_DWARF_WITH_PDB)
|
||||
install(CODE "file(COPY_FILE ${CMAKE_BINARY_DIR}/${PDB}.pdb ${CMAKE_BINARY_DIR}/${GENERATED_PDB}.pdb RESULT copy_result)")
|
||||
endif ()
|
||||
|
||||
install(FILES ${CMAKE_BINARY_DIR}/${GENERATED_PDB}.pdb DESTINATION ".")
|
||||
|
||||
add_dependencies(imhex_all ${PDB}_pdb)
|
||||
endforeach ()
|
||||
|
||||
endfunction()
|
||||
|
||||
function(generateSDKDirectory)
|
||||
if (WIN32)
|
||||
set(SDK_PATH "./sdk")
|
||||
|
Loading…
x
Reference in New Issue
Block a user