]> danny-edel.de - dspdfviewer.git/commitdiff
enable building on osx
authorDanny Edel <mail@danny-edel.de>
Thu, 20 Oct 2022 12:28:24 +0000 (14:28 +0200)
committerDanny Edel <mail@danny-edel.de>
Thu, 20 Oct 2022 16:12:51 +0000 (18:12 +0200)
.github/workflows/osx.yml
cmake/compiler_appleclang.cmake [new file with mode: 0644]
cmake/compiler_clang.cmake
cmake/compilers.cmake
cmake/external_libraries.cmake

index e7854fa7855f7059c1edfa73d71f4a96b8cdf5f6..e5cda8a5180f0904c16446d166581810e5144519 100644 (file)
@@ -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 (file)
index 0000000..e22c271
--- /dev/null
@@ -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)
index 5221676bece151b16bb56b016204768f1b3fa623..796f6344c7b320e07a400e3fc412a34173b2b1af 100644 (file)
@@ -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)
 
index ade2ae9da86ad4e11084d62cb5b2da7263983030..aa63f986d193c36ec47a672278bb9840635802da 100644 (file)
@@ -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)
index 2f81fa22c35bf816f5dc027c7f2e7518691dff1a..6beedf924fc83db11ee1bd7de12ed09a8e5c66e7 100644 (file)
@@ -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})