From 7b5f12c964a4668597fc5c3a2027a9796290703f Mon Sep 17 00:00:00 2001 From: "J. Bohl" Date: Tue, 24 Oct 2023 00:05:27 +0200 Subject: [PATCH 1/4] add -static-libstd++ --- app/CMakeLists.txt | 6 ++++++ capi/CMakeLists.txt | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index af38013..cd0dc07 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -14,6 +14,12 @@ add_executable (${TARGET_NAME} # CMake will merge the manifest with a linker generated one (and ignore it on non-windows platforms) ) +# with GCC (on Linux) we want to link statically to libstd++ - this should increase the likelihood that the +# binary works on various distros +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + target_link_options(${TARGET_NAME} PRIVATE -static-libstdc++) +endif() + target_compile_options(${TARGET_NAME} PUBLIC "$<$:/utf-8>") target_compile_options(${TARGET_NAME} PUBLIC "$<$:/utf-8>") diff --git a/capi/CMakeLists.txt b/capi/CMakeLists.txt index d2d6ce0..3598755 100644 --- a/capi/CMakeLists.txt +++ b/capi/CMakeLists.txt @@ -11,6 +11,12 @@ add_library (${TARGET_NAME} SHARED capi.cpp ) +# with GCC (on Linux) we want to link statically to libstd++ - this should increase the likelihood that the +# binary works on various distros (c.f. https://stackoverflow.com/questions/13636513/linking-libstdc-statically-any-gotchas) +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + target_link_options(${TARGET_NAME} PRIVATE -static-libstdc++) +endif() + if(WIN32) set(CZICOMPRESS_RCVersion ${czicompress_VERSION_MAJOR},${czicompress_VERSION_MINOR},${czicompress_VERSION_PATCH},${czicompress_VERSION_TWEAK}) set(CZICOMPRESS_RCVersion_STR ${czicompress_VERSION_MAJOR_STR},${czicompress_VERSION_MINOR_STR},${czicompress_VERSION_PATCH_STR},${czicompress_VERSION_TWEAK_STR}) From 65f5d79c0683437cfc854634ccf759ec9f960b8f Mon Sep 17 00:00:00 2001 From: "J. Bohl" Date: Tue, 24 Oct 2023 00:12:09 +0200 Subject: [PATCH 2/4] bump version --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 11ac7db..0fb46c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ cmake_policy(SET CMP0091 NEW) # enable new "MSVC runtime library selection" (htt # Note that the CMake-variables _VERSION_MAJOR, _VERSION_MINOR, ... are defined by this statement, # which are used in the build (so that - if changing the name here, change also the usage of those variables). project ("czicompress" - VERSION 0.5.0) + VERSION 0.5.1) set(czicompress_VERSION_PATCH_FLAGS "-alpha") set(czicompress_VERSION_TWEAK_FLAGS "") From 9fcf6bafae2abd5b8c5fc0316ef5a9b919b72c6c Mon Sep 17 00:00:00 2001 From: "J. Bohl" Date: Tue, 24 Oct 2023 00:51:27 +0200 Subject: [PATCH 3/4] use older Ubuntu-runner instead... --- .github/workflows/cmake.yml | 2 +- app/CMakeLists.txt | 6 ------ capi/CMakeLists.txt | 6 ------ 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index adb5882..f938622 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -50,7 +50,7 @@ jobs: } - { name: ubuntu-release-package-on, - os: ubuntu-latest, + os: ubuntu-20.04, # we want to use an older version in order to increase likelihood that binaries work on other distros platform: x64-linux, package: ON, path-cache: '/usr/local/share/vcpkg/installed', diff --git a/app/CMakeLists.txt b/app/CMakeLists.txt index cd0dc07..af38013 100644 --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -14,12 +14,6 @@ add_executable (${TARGET_NAME} # CMake will merge the manifest with a linker generated one (and ignore it on non-windows platforms) ) -# with GCC (on Linux) we want to link statically to libstd++ - this should increase the likelihood that the -# binary works on various distros -if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - target_link_options(${TARGET_NAME} PRIVATE -static-libstdc++) -endif() - target_compile_options(${TARGET_NAME} PUBLIC "$<$:/utf-8>") target_compile_options(${TARGET_NAME} PUBLIC "$<$:/utf-8>") diff --git a/capi/CMakeLists.txt b/capi/CMakeLists.txt index 3598755..d2d6ce0 100644 --- a/capi/CMakeLists.txt +++ b/capi/CMakeLists.txt @@ -11,12 +11,6 @@ add_library (${TARGET_NAME} SHARED capi.cpp ) -# with GCC (on Linux) we want to link statically to libstd++ - this should increase the likelihood that the -# binary works on various distros (c.f. https://stackoverflow.com/questions/13636513/linking-libstdc-statically-any-gotchas) -if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - target_link_options(${TARGET_NAME} PRIVATE -static-libstdc++) -endif() - if(WIN32) set(CZICOMPRESS_RCVersion ${czicompress_VERSION_MAJOR},${czicompress_VERSION_MINOR},${czicompress_VERSION_PATCH},${czicompress_VERSION_TWEAK}) set(CZICOMPRESS_RCVersion_STR ${czicompress_VERSION_MAJOR_STR},${czicompress_VERSION_MINOR_STR},${czicompress_VERSION_PATCH_STR},${czicompress_VERSION_TWEAK_STR}) From eb2a1a77f31215a949260cff7a0c3de5da770288 Mon Sep 17 00:00:00 2001 From: "J. Bohl" Date: Tue, 24 Oct 2023 01:07:43 +0200 Subject: [PATCH 4/4] fix --- .github/workflows/cmake.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index f938622..ff299c1 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -46,7 +46,7 @@ jobs: package: ON, path-cache: '${{ github.workspace }}\vcpkg\installed', path-toolchain: 'C:/vcpkg/scripts/buildsystems/vcpkg.cmake', - os-id: 'linux' + os-id: 'windows' } - { name: ubuntu-release-package-on, @@ -55,7 +55,7 @@ jobs: package: ON, path-cache: '/usr/local/share/vcpkg/installed', path-toolchain: '/usr/local/share/vcpkg/scripts/buildsystems/vcpkg.cmake', - os-id: 'windows' + os-id: 'linux' } steps: @@ -88,7 +88,7 @@ jobs: # gather the binaries - name: Prepare Linux binaries - if: matrix.config.os == 'ubuntu-latest' + if: matrix.config.os == 'ubuntu-20.04' working-directory: ${{github.workspace}} shell: bash run: |