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

Switch to ninja #155

Merged
merged 6 commits into from
Jul 30, 2024
Merged
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
29 changes: 19 additions & 10 deletions .github/workflows/snapshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ jobs:
with:
submodules: recursive

- name: '⚙️ Grab cmake & ninja'
uses: lukka/get-cmake@latest

- name: '⚙️ Install Qt'
uses: jurplel/install-qt-action@v3
with:
Expand All @@ -38,14 +41,14 @@ jobs:
run: sudo apt-get install -y appstream

- name: '⚙️ Configure CMake'
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=/usr
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=/usr -G Ninja

- name: '🚧 Build'
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j8
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: '⚙️ Make AppDir'
working-directory: ${{github.workspace}}/build
run: make install DESTDIR=AppDir
run: DESTDIR=AppDir cmake --install ${{github.workspace}}/build

- name: '⚙️ Install Linuxdeploy'
working-directory: ${{github.workspace}}/build
Expand Down Expand Up @@ -81,6 +84,9 @@ jobs:
with:
submodules: recursive

- name: '⚙️ Grab cmake & ninja'
uses: lukka/get-cmake@latest

- name: '⚙️ Install Qt'
uses: jurplel/install-qt-action@v3
with:
Expand All @@ -89,10 +95,10 @@ jobs:
version: ${{env.QT_VERSION}}

- name: '⚙️ Configure CMake'
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DCMAKE_INSTALL_PREFIX=/usr
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" -DCMAKE_INSTALL_PREFIX=/usr -G Ninja

- name: '🚧 Build'
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j8
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: '📦 Make DMG'
working-directory: ${{github.workspace}}/build
Expand All @@ -118,6 +124,9 @@ jobs:
with:
submodules: recursive

- name: '⚙️ Grab cmake & ninja'
uses: lukka/get-cmake@latest

- name: '⚙️ Configure MSVC'
uses: ilammy/msvc-dev-cmd@v1
with:
Expand All @@ -131,16 +140,16 @@ jobs:
version: ${{env.QT_VERSION}}

- name: '⚙️ Configure CMake'
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=/usr
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=/usr -G Ninja

- name: '🚧 Build'
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j8
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: '📦 Make package'
working-directory: ${{github.workspace}}/build
run: |
mkdir BandageNG
cp Release/BandageNG.exe BandageNG/
cp BandageNG.exe BandageNG/
windeployqt BandageNG --release --compiler-runtime
7z a BandageNG-win-${{steps.commit.outputs.short}}.zip BandageNG -r

Expand All @@ -152,17 +161,17 @@ 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'
run: sudo apt-get install -y libfuse2
- name: '📥 Download artifacts'
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
- name: '🗂 Inspect directory after downloading artifacts'
run: ls -alFR
- name: '🚀 Create release and upload artifacts'
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ jobs:
experimental: [false]

steps:
- name: Grab cmake & ninja
uses: lukka/get-cmake@latest

- name: Update deps
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
Expand Down Expand Up @@ -67,10 +70,10 @@ jobs:
shell: bash

- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -D CMAKE_C_COMPILER_LAUNCHER=sccache -D CMAKE_CXX_COMPILER_LAUNCHER=sccache
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_C_COMPILER_LAUNCHER=sccache -D CMAKE_CXX_COMPILER_LAUNCHER=sccache -G Ninja

- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j8
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}

- name: Unit Tests
if: ${{ matrix.os != 'windows-latest' }}
Expand Down
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.13)
cmake_minimum_required(VERSION 3.28)
project(BandageNG VERSION 2024.07 LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
Expand Down 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
28 changes: 16 additions & 12 deletions thirdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
include(FetchContent)

FetchContent_Declare(ogdf
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ogdf")
FetchContent_GetProperties(ogdf)
if(NOT ogdf_POPULATED)
FetchContent_Populate(ogdf)
add_subdirectory(${ogdf_SOURCE_DIR} ${ogdf_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ogdf"
EXCLUDE_FROM_ALL)
FetchContent_MakeAvailable(ogdf)

FetchContent_Declare(zlib_ng
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/zlib-ng")
FetchContent_GetProperties(zlib_ng)
if (NOT zlib_ng_POPULATED)
# 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)
FetchContent_Populate(zlib_ng)
add_subdirectory(${zlib_ng_SOURCE_DIR} ${zlib_ng_BINARY_DIR} EXCLUDE_FROM_ALL)
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()
Loading