Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bundling of DLLs on Windows #534

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,11 @@ jobs:
- uses: ammaraskar/gcc-problem-matcher@master
- name: Build HealthGPS (debug)
if: '!cancelled()' # Run this step, even if the previous one fails
run: |
cmake --build --preset=debug-build-${{ matrix.platform }} --target=install
run: cmake --build --preset=debug-build-${{ matrix.platform }} --target=install

- name: Execute HealthGPS (debug)
if: '!cancelled()' # Run this step, even if the previous one fails
run: out/install/${{ matrix.platform }}-debug/bin/HealthGPS.Console --help

- name: Build HealthGPS (release)
if: '!cancelled()' # Run this step, even if the previous one fails
Expand All @@ -107,6 +110,10 @@ jobs:
cmake --preset=${{ matrix.platform }}-release -DWARNINGS_AS_ERRORS=ON -DBUILD_DOC=ON
cmake --build --preset=release-build-${{ matrix.platform }} --target=install

- name: Execute HealthGPS (release)
if: '!cancelled()' # Run this step, even if the previous one fails
run: out/install/${{ matrix.platform }}-release/bin/HealthGPS.Console --help

- name: Upload artifacts
if: matrix.is_main
uses: actions/upload-artifact@v4
Expand Down
23 changes: 21 additions & 2 deletions src/HealthGPS.Console/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,28 @@ target_link_libraries(
cxxopts::cxxopts
TBB::tbb)

install(TARGETS HealthGPS.Console DESTINATION "")
install(
TARGETS HealthGPS.Console
RUNTIME
ARCHIVE
LIBRARY
RUNTIME
FRAMEWORK
BUNDLE
PUBLIC_HEADER
RESOURCE)
if(WIN32)
install(IMPORTED_RUNTIME_ARTIFACTS fmt::fmt)
install(
TARGETS HealthGPS.Console
COMPONENT HealthGPS.Console
RUNTIME_DEPENDENCIES
PRE_EXCLUDE_REGEXES
"api-ms-"
"ext-ms-"
POST_EXCLUDE_REGEXES
".*system32/.*\\.dll"
DIRECTORIES
$<TARGET_FILE_DIR:HealthGPS.Console>)
endif()

install(DIRECTORY ../../schemas DESTINATION "${CMAKE_INSTALL_PREFIX}/bin")
Expand Down