From 80f16d54c6a25be0e2ba7a9e644d0db33c4a2c81 Mon Sep 17 00:00:00 2001 From: Danny Edel Date: Thu, 20 Oct 2022 14:28:24 +0200 Subject: [PATCH] enable building on osx --- .github/workflows/osx.yml | 21 ++++++++++++--------- cmake/compiler_appleclang.cmake | 6 ++++++ cmake/compiler_clang.cmake | 4 ++++ cmake/compilers.cmake | 4 ++++ cmake/external_libraries.cmake | 1 + 5 files changed, 27 insertions(+), 9 deletions(-) create mode 100644 cmake/compiler_appleclang.cmake diff --git a/.github/workflows/osx.yml b/.github/workflows/osx.yml index e7854fa..e5cda8a 100644 --- a/.github/workflows/osx.yml +++ b/.github/workflows/osx.yml @@ -9,25 +9,28 @@ on: jobs: build: runs-on: ${{ matrix.os }} - if: 0 #FIXME: brew is already on Qt6 strategy: matrix: - #os: [ macos-latest, macos-10.15 ] - #buildtype: [ Debug, Release ] - os: [ macos-10.15 ] - buildtype: [ Debug ] + os: [ macos-11, macos-12 ] + buildtype: [ Debug, Release ] + env: + CMAKE_PREFIX_PATH: /usr/local/opt/qt5 + PKG_CONFIG_PATH: /usr/local/opt/poppler-qt5/lib/pkgconfig:/usr/local/opt/poppler-qt5/share/pkgconfig steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - run: brew install boost - - run: brew install poppler - - name: create build/ dir + - run: brew install poppler-qt5 + - name: cmake -B build/ run: > cmake -B build/ - -DCMAKE_VERBOSE_MAKEFILE=ON + -DCMAKE_PREFIX_PATH= -DCMAKE_VERBOSE_MAKEFILE=ON -DUsePrerenderedPDF=ON -DCodeCoverage=ON -DCMAKE_BUILD_TYPE=${{matrix.buildtype}} + -DRunDualScreenTests=OFF . - run: cmake --build build/ - run: ctest --output-on-failure --timeout 60 working-directory: build/ + - name: upload coverage + run: bash <(curl -s https://codecov.io/bash) diff --git a/cmake/compiler_appleclang.cmake b/cmake/compiler_appleclang.cmake new file mode 100644 index 0000000..e22c271 --- /dev/null +++ b/cmake/compiler_appleclang.cmake @@ -0,0 +1,6 @@ +message(WARNING "Optimal settings for AppleClang unknown, send pull-requests!") +message(STATUS "Including definitions for clang.") +include(cmake/compiler_clang.cmake) + +# error: include location '/usr/local/include' is unsafe for cross-compilation +add_definitions(-Wno-error=poison-system-directories) diff --git a/cmake/compiler_clang.cmake b/cmake/compiler_clang.cmake index 5221676..796f634 100644 --- a/cmake/compiler_clang.cmake +++ b/cmake/compiler_clang.cmake @@ -34,6 +34,10 @@ add_definitions(-Wno-error=undefined-reinterpret-cast) add_definitions(-Wno-error=redundant-parens) add_definitions(-Wno-error=extra-semi-stmt) +# FIXME: These are apple-clang specific +add_definitions(-Wno-error=poison-system-directories) +add_definitions("-Wno-error=#warnings") + # Clang on recent XCode fails to compile the boost tests add_definitions(-Wno-error=disabled-macro-expansion) diff --git a/cmake/compilers.cmake b/cmake/compilers.cmake index ade2ae9..aa63f98 100644 --- a/cmake/compilers.cmake +++ b/cmake/compilers.cmake @@ -6,6 +6,10 @@ if(CMAKE_COMPILER_IS_GNUCXX) message(STATUS "GNU G++ detected.") include(cmake/compiler_gnu_gcc.cmake) +elseif(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") + message(STATUS "AppleClang detected.") + include(cmake/compiler_appleclang.cmake) + elseif(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") message(STATUS "Clang++ detected.") include(cmake/compiler_clang.cmake) diff --git a/cmake/external_libraries.cmake b/cmake/external_libraries.cmake index 2f81fa2..6beedf9 100644 --- a/cmake/external_libraries.cmake +++ b/cmake/external_libraries.cmake @@ -99,6 +99,7 @@ else() endif() # include/link poppler +link_directories(${POPPLER_LIBRARY_DIRS}) list(APPEND LIST_LIBRARIES ${POPPLER_LIBRARIES}) list(APPEND LIST_INCLUDE_DIRS ${POPPLER_INCLUDE_DIRS}) -- 2.47.3