From 654ddf6200a82be571f6d33deaa9ade1df1f0421 Mon Sep 17 00:00:00 2001 From: Roman Fomin Date: Mon, 17 Apr 2023 22:39:46 +0700 Subject: [PATCH] bring back MSYS2 packaging (#994) * add package step to workflow --- .github/workflows/main.yml | 5 +++++ CMakeLists.txt | 7 ------- src/CMakeLists.txt | 11 ++++++++++- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 35e076be..72a10dc6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -89,3 +89,8 @@ jobs: - name: Build run: cmake --build build + + - name: Package + run: | + cd build + cpack -G ZIP diff --git a/CMakeLists.txt b/CMakeLists.txt index 1971e558..1f354108 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -36,13 +36,6 @@ if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) message(FATAL_ERROR "In-tree builds are not supported.") endif() -execute_process(COMMAND uname OUTPUT_VARIABLE uname) -if (NOT MSVC AND (uname MATCHES "^MSYS" OR uname MATCHES "^MINGW")) - set(MSYS ON) -else() - set(MSYS OFF) -endif() - # Hardcoded defines added to configure and resource files. set(PROJECT_COMPANY "Fabian Greffrath and contributors") set(PROJECT_COPYRIGHT "Copyright (C) 1993-2023") diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5af5ea03..71343be9 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -269,7 +269,16 @@ endif() # Files to package in our distribution. if(WIN32) - install(TARGETS woof woof-exe woof-setup RUNTIME DESTINATION .) + if(CMAKE_VERSION VERSION_GREATER 3.20 AND NOT VCPKG_TOOLCHAIN) + install(TARGETS woof woof-exe woof-setup + RUNTIME_DEPENDENCIES + PRE_EXCLUDE_REGEXES "api-ms-" "ext-ms-" + POST_EXCLUDE_REGEXES ".*system32/.*\\.dll" + DIRECTORIES $ $ENV{PATH} + RUNTIME DESTINATION .) + else() + install(TARGETS woof woof-exe woof-setup RUNTIME DESTINATION .) + endif() install(FILES "$/woof.com" DESTINATION .) else() install(TARGETS woof woof-setup RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})