Skip to content
This repository has been archived by the owner on May 8, 2024. It is now read-only.

Commit

Permalink
Dev (leetal#103)
Browse files Browse the repository at this point in the history
* Added a shared build example for macOS as well

* Improve compatibility with more generators (specifically milti-configuration generators like Ninja).

* Refined the caching of variables

* Lots of fixes. Cannot get the mac catalyst builds to work with the xcode generator, but works on all other tested generators.

* Exclude the CMAKE_FIND_ROOT_PATH from macOS builds since it is really only useful when cross-compiling. Also, for other platforms, CMAKE_OSX_SYSROOT_INT is now APPENDED to the CMAKE_FIND_ROOT_PATH to allow users to set own custom paths first for custom find_library behaviours

* Refined some xcode settings as well as fixed a few flaws with the macos builds skipping certain user-defined directories when using any of the find_* commands.

* Fixes for watchos with latest additions

* Added better comment about the symbol visibility

* Exported OSX_ARCHITECTURES as a global property and updated the README to reflect the latest changes.

Co-authored-by: Alexander Widerberg <[email protected]>
  • Loading branch information
leetal and Alexander Widerberg authored Mar 10, 2021
1 parent cfa6908 commit 323ff00
Show file tree
Hide file tree
Showing 4 changed files with 298 additions and 182 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ jobs:
osx_image: xcode12.2
env:
- PLATFORM=MAC DEPLOYMENT_TARGET=10.13
- name: "Xcode version 12.2, Target macOS [x86_64] SDK 10.13 [shared example]"
stage: "macOS builds"
osx_image: xcode12.2
env:
- PLATFORM=MAC DEPLOYMENT_TARGET=10.13 -DBUILD_SHARED=1
- name: "Xcode version 12.2, Target macOS on Apple Silicon [arm64] SDK 11.0 [allowed failure]"
stage: "macOS builds"
osx_image: xcode12.2
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ cmake --install . --config Release

`CMAKE_OSX_ARCHITECTURES` - Architectures being compiled for (generated from PLATFORM).

`APPLE_TARGET_TRIPLE` - Used by autoconf build systems. NOTE: If "`ARCHS` are overridden, this will **NOT** be set!
`APPLE_TARGET_TRIPLE` - Used by autoconf build systems.

### Additional Options
`-DENABLE_BITCODE=(BOOL)` - Enabled by default, specify FALSE or 0 to disable bitcode
Expand Down
14 changes: 7 additions & 7 deletions example/example-lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@ MESSAGE( STATUS "CMAKE_CXX_FLAGS: " ${CMAKE_CXX_FLAGS} )
include(CheckCXXSymbolExists)
check_cxx_symbol_exists(kqueue sys/event.h HAVE_KQUEUE)
if(NOT HAVE_KQUEUE)
message(FATAL_ERROR "kqueue NOT found!")
message(STATUS "kqueue NOT found!")
else()
message(STATUS "kqueue found!")
endif()

find_library(HAVE_APPKIT AppKit)
if (NOT HAVE_APPKIT)
find_library(APPKIT_LIBRARY AppKit)
if (NOT APPKIT_LIBRARY)
message(STATUS "AppKit.framework NOT found!")
else()
message(STATUS "AppKit.framework found!")
message(STATUS "AppKit.framework found! ${APPKIT_LIBRARY}")
endif()

find_library(HAVE_UIKIT UIKit)
if (NOT HAVE_UIKIT)
find_library(UIKIT_LIBRARY UIKit)
if (NOT UIKIT_LIBRARY)
message(STATUS "UIKit.framework NOT found!")
else()
message(STATUS "UIKit.framework found!")
message(STATUS "UIKit.framework found! ${UIKIT_LIBRARY}")
endif()

# Hook up XCTest for the supported plaforms (all but WatchOS)
Expand Down
Loading

0 comments on commit 323ff00

Please sign in to comment.