Skip to content

Commit

Permalink
Try to unbreak universal builds
Browse files Browse the repository at this point in the history
  • Loading branch information
asl committed Jul 30, 2024
1 parent 116ec8b commit d1d1650
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/snapshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,11 @@ jobs:

# Upload continuous build
upload:
if: ${{ false }} # disable for now
name: '🗂 Create release and upload artifacts'
needs:
- build-linux
- build-mac
- build-windows
runs-on: ubuntu-20.04
steps:
- name: '⚙️ Install dependencies'
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,14 @@ target_link_libraries(BandageIo PRIVATE Qt6::Gui Qt6::Widgets foonathan::lexy)

# FIXME: Untagle this
add_library(BandageLib STATIC ${LIB_SOURCES} ${FORMS} graphsearch/graphsearchers.cpp)
target_link_libraries(BandageLib PRIVATE BandageLayout BandageIo Qt6::Concurrent Qt6::Widgets Qt6::Svg zlibstatic)
target_link_libraries(BandageLib PRIVATE BandageLayout BandageIo Qt6::Concurrent Qt6::Widgets Qt6::Svg ${bandage_zlib})
target_include_directories(BandageLib INTERFACE ".")

add_library(BandageCLI STATIC ${CLI_SOURCES})
target_link_libraries(BandageCLI PRIVATE BandageLib CLI11::CLI11 Qt6::Core Qt6::Gui Qt6::Widgets Qt6::Svg)

add_executable(BandageNG program/main.cpp ${RESOURCES})
target_link_libraries(BandageNG BandageCLI BandageLib CLI11::CLI11 Qt6::Core Qt6::Widgets Qt6::Concurrent zlibstatic)
target_link_libraries(BandageNG BandageCLI BandageLib CLI11::CLI11 Qt6::Core Qt6::Widgets Qt6::Concurrent ${bandage_zlib})

if (APPLE)
set_target_properties(BandageNG PROPERTIES
Expand Down
26 changes: 17 additions & 9 deletions thirdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,20 @@ FetchContent_Declare(ogdf
EXCLUDE_FROM_ALL)
FetchContent_MakeAvailable(ogdf)

set(SKIP_INSTALL_ALL ON)
set(ZLIB_COMPAT ON)
set(WITH_GTEST OFF)
set(ZLIB_ENABLE_TESTS OFF)
set(ZLIBNG_ENABLE_TESTS OFF)
FetchContent_Declare(zlib_ng
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/zlib-ng"
EXCLUDE_FROM_ALL)
FetchContent_MakeAvailable(zlib_ng)
# zlib-ng does not support universal builds,
# resort to system one
if (CMAKE_OSX_ARCHITECTURES)
find_package(ZLIB REQUIRED)
set(bandage_zlib ${ZLIB_LIBRARIES} PARENT_SCOPE)
else()
set(SKIP_INSTALL_ALL ON)
set(ZLIB_COMPAT ON)
set(WITH_GTEST OFF)
set(ZLIB_ENABLE_TESTS OFF)
set(ZLIBNG_ENABLE_TESTS OFF)
FetchContent_Declare(zlib_ng
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/zlib-ng"
EXCLUDE_FROM_ALL)
FetchContent_MakeAvailable(zlib_ng)
set(bandage_zlib zlibstatic PARENT_SCOPE)
endif()

0 comments on commit d1d1650

Please sign in to comment.