From 6f62ec001bb8144418e82377498d54d348d2f775 Mon Sep 17 00:00:00 2001 From: RadWolfie Date: Tue, 19 Jan 2021 22:55:00 +0000 Subject: [PATCH 1/5] update submodules' fixes --- import/XbSymbolDatabase | 2 +- import/cs_x86 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/import/XbSymbolDatabase b/import/XbSymbolDatabase index a477ce6ad..5b8d3feb1 160000 --- a/import/XbSymbolDatabase +++ b/import/XbSymbolDatabase @@ -1 +1 @@ -Subproject commit a477ce6ad6278e1c7358a446cdd8d995a8c45d12 +Subproject commit 5b8d3feb15c2edae309c1613ca0bc26e54f0c23e diff --git a/import/cs_x86 b/import/cs_x86 index 65133408a..5fb27bcf6 160000 --- a/import/cs_x86 +++ b/import/cs_x86 @@ -1 +1 @@ -Subproject commit 65133408a86028ef8af20cf75a0d412549b9752c +Subproject commit 5fb27bcf6745c35d8889e48ead4314022b8ec931 From ab01047450de4db219748334a64b7095dbbc3a1a Mon Sep 17 00:00:00 2001 From: RadWolfie Date: Wed, 4 Nov 2020 23:21:29 -0600 Subject: [PATCH 2/5] cmake: add CMake install method --- CMakeLists.txt | 48 ++++++++++++++++++++----------- projects/cxbx/CMakeLists.txt | 4 +++ projects/cxbxr-emu/CMakeLists.txt | 4 +++ projects/cxbxr-ldr/CMakeLists.txt | 4 +++ src/CxbxDebugger/CMakeLists.txt | 4 +++ 5 files changed, 48 insertions(+), 16 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c62934d2d..214c2b82a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -377,30 +377,46 @@ add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/projects/cxbxr-ldr") add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/projects/cxbxr-emu") -# Issues with compile (the same with develop branch) and -# for some reason did not put the files into virtual folder? -# Might need to put the list in the source folder for workaround fix. -if(${CMAKE_GENERATOR} MATCHES "Visual Studio ([^9]|[9][0-9])") - add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/src/CxbxDebugger") -endif() +set(cxbxr_INSTALL_files "COPYING" "README.md") + +# Cxbx-Reloaded project with third-party libraries +set_target_properties(cxbx cxbxr-ldr cxbxr-emu misc-batch subhook libXbSymbolDatabase libtommath libtomcrypt + PROPERTIES FOLDER Cxbx-Reloaded +) if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") # Configure startup project set_property(DIRECTORY "${CMAKE_CURRENT_LIST_DIR}" PROPERTY VS_STARTUP_PROJECT cxbx) endif() +# Check if generator is Visual Studio then enable Cxbxr-Debugger project. +# Since C# is currently supported with Visual Studio for now. if(${CMAKE_GENERATOR} MATCHES "Visual Studio ([^9]|[9][0-9])") - set_target_properties(Tests_cs_x86 - PROPERTIES EXCLUDE_FROM_ALL TRUE - ) + # Issues with compile (the same with develop branch) and + # for some reason did not put the files into virtual folder? + # Might need to put the list in the source folder for workaround fix. + add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/src/CxbxDebugger") - # Cxbx-Debugger project with third-party libraries - set_target_properties(cxbxr-debugger cs_x86 Tests_cs_x86 capstone-shared - PROPERTIES FOLDER Cxbx-Reloaded/debugger - ) + set_target_properties(Tests_cs_x86 + PROPERTIES EXCLUDE_FROM_ALL TRUE + ) + + # Cxbx-Debugger project with third-party libraries + set_target_properties(cxbxr-debugger cs_x86 Tests_cs_x86 capstone-shared + PROPERTIES FOLDER Cxbx-Reloaded/debugger + ) endif() -# Cxbx-Reloaded project with third-party libraries -set_target_properties(cxbx cxbxr-ldr cxbxr-emu misc-batch subhook libXbSymbolDatabase libtommath libtomcrypt - PROPERTIES FOLDER Cxbx-Reloaded +install(FILES ${cxbxr_INSTALL_files} + DESTINATION bin +) + +set(cxbxr_GLEW_DLL "${CMAKE_SOURCE_DIR}/import/glew-2.0.0/bin/Release/Win32/glew32.dll") + +install(PROGRAMS ${cxbxr_GLEW_DLL} + DESTINATION bin +) + +install(PROGRAMS $/${CMAKE_SHARED_LIBRARY_PREFIX}subhook${CMAKE_SHARED_LIBRARY_SUFFIX} + DESTINATION bin ) diff --git a/projects/cxbx/CMakeLists.txt b/projects/cxbx/CMakeLists.txt index e961e1a99..53804435c 100644 --- a/projects/cxbx/CMakeLists.txt +++ b/projects/cxbx/CMakeLists.txt @@ -187,6 +187,10 @@ target_link_libraries(cxbx ${WINS_LIB} ) +install(TARGETS ${PROJECT_NAME} + RUNTIME DESTINATION bin +) + if(${CMAKE_GENERATOR} MATCHES "Visual Studio ([^9]|[9][0-9])") add_dependencies(cxbx cxbxr-debugger) endif() diff --git a/projects/cxbxr-emu/CMakeLists.txt b/projects/cxbxr-emu/CMakeLists.txt index bb68f6c6e..569b0d4b2 100644 --- a/projects/cxbxr-emu/CMakeLists.txt +++ b/projects/cxbxr-emu/CMakeLists.txt @@ -161,4 +161,8 @@ target_link_libraries(cxbxr-emu ${WINS_LIB} ) +install(TARGETS ${PROJECT_NAME} + RUNTIME DESTINATION bin +) + add_dependencies(cxbxr-emu cxbxr-ldr misc-batch) diff --git a/projects/cxbxr-ldr/CMakeLists.txt b/projects/cxbxr-ldr/CMakeLists.txt index 477944953..99660148b 100644 --- a/projects/cxbxr-ldr/CMakeLists.txt +++ b/projects/cxbxr-ldr/CMakeLists.txt @@ -65,3 +65,7 @@ endif() target_link_libraries(cxbxr-ldr PUBLIC kernel32.lib ) + +install(TARGETS ${PROJECT_NAME} + RUNTIME DESTINATION bin +) diff --git a/src/CxbxDebugger/CMakeLists.txt b/src/CxbxDebugger/CMakeLists.txt index 8c798680e..1146f9f13 100644 --- a/src/CxbxDebugger/CMakeLists.txt +++ b/src/CxbxDebugger/CMakeLists.txt @@ -140,3 +140,7 @@ set_target_properties(cxbxr-debugger PROPERTIES set_property(TARGET cxbxr-debugger PROPERTY DOTNET_TARGET_FRAMEWORK_VERSION "v4.5") target_link_libraries(cxbxr-debugger cs_x86) + +install(TARGETS ${PROJECT_NAME} + RUNTIME DESTINATION bin +) From e39a9a0420b2a2fabd189dbc0245c6ddf7097ddd Mon Sep 17 00:00:00 2001 From: RadWolfie Date: Fri, 11 Dec 2020 21:30:38 -0600 Subject: [PATCH 3/5] workflow: update GitHub Action CI yml to use CMake's install method --- .github/workflows/CI.yml | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 16a262943..201b88a3c 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -52,17 +52,13 @@ jobs: run: cmake --build . --config ${{ matrix.configuration }} -j $env:NUMBER_OF_PROCESSORS - name: Prepare artifacts if: matrix.configuration == 'Release' - run: | - robocopy . artifacts COPYING README.md /r:0 /w:0 - robocopy build\bin\${{ matrix.configuration }} artifacts ` - cxbx.exe cxbxr-ldr.exe cxbxr-emu.dll glew32.dll subhook.dll SDL2.dll ` - cxbxr-debugger.exe capstone.dll cs_x86.dll /r:0 /w:0 - If ($LastExitCode -le 7) { $LastExitCode = 0 } - - uses: actions/upload-artifact@v1 + working-directory: build + run: cmake --install . --config ${{ matrix.configuration }} --prefix ../artifacts + - uses: actions/upload-artifact@v2 if: matrix.configuration == 'Release' with: name: CxbxReloaded-${{ matrix.configuration }}-${{ matrix.vsver }} - path: artifacts + path: artifacts/bin/** release: if: | From 8d741e66d3ac773c6d7bd9284c628d94c8288a7f Mon Sep 17 00:00:00 2001 From: RadWolfie Date: Fri, 11 Dec 2020 23:13:30 -0600 Subject: [PATCH 4/5] workflow: update appveyor.yml to use CMake's install method --- .appveyor.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index eb56988e1..b6c4f305d 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -41,9 +41,7 @@ build_script: on_success: - ps: |- If ($env:configuration -eq 'Release') { - cd bin\$env:configuration - 7z u "$env:configuration.zip" ..\..\..\COPYING ..\..\..\README.md - 7z u "$env:configuration.zip" cxbx.exe cxbxr-ldr.exe cxbxr-emu.dll glew32.dll subhook.dll SDL2.dll - 7z u "$env:configuration.zip" cxbxr-debugger.exe capstone.dll cs_x86.dll + cmake --install . --config $env:configuration --prefix artifacts + 7z a "$env:configuration.zip" ./artifacts/bin/* Get-ChildItem .\*.zip | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name } } From 7e838ff6777a282cdd049ae7e2687011d474d918 Mon Sep 17 00:00:00 2001 From: RadWolfie Date: Fri, 11 Dec 2020 23:28:24 -0600 Subject: [PATCH 5/5] workflow: update azure-pipelines.yml to use CMake's install method --- .azure-pipelines.yml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/.azure-pipelines.yml b/.azure-pipelines.yml index 5504bb731..f477d290a 100644 --- a/.azure-pipelines.yml +++ b/.azure-pipelines.yml @@ -64,22 +64,16 @@ jobs: workingDirectory: build displayName: 'Build' + - script: cmake --install . --config %configuration% --prefix ../artifacts + workingDirectory: build + displayName: 'Prepare Files' + condition: and(succeeded(), eq(variables['Agent.JobName'], 'Release')) + - task: CopyFiles@2 displayName: 'Copy files to $(Build.ArtifactStagingDirectory)' condition: and(succeeded(), eq(variables['Agent.JobName'], 'Release')) inputs: - Contents: | - COPYING - README.md - build\bin\$(configuration)\cxbx.exe - build\bin\$(configuration)\cxbxr-ldr.exe - build\bin\$(configuration)\cxbxr-emu.dll - build\bin\$(configuration)\glew32.dll - build\bin\$(configuration)\subhook.dll - build\bin\$(configuration)\SDL2.dll - build\bin\$(configuration)\cxbxr-debugger.exe - build\bin\$(configuration)\capstone.dll - build\bin\$(configuration)\cx_x86.dll + Contents: artifacts\bin\** TargetFolder: '$(Build.ArtifactStagingDirectory)' flattenFolders: true