Skip to content

Commit

Permalink
Updates and smaller improvements to the toolchain and travis build ma…
Browse files Browse the repository at this point in the history
…trix
  • Loading branch information
Alexander Widerberg committed Mar 4, 2021
1 parent 02cf190 commit f564049
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 34 deletions.
45 changes: 45 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,51 @@ env:
- PLATFORM=MAC DEPLOYMENT_TARGET=10.13
- PLATFORM=OS64COMBINED USE_XCODE=1 DEPLOYMENT_TARGET=11.0 BUILD_CURL=1

jobs:
fast_finish: true
include:
- os: osx
name: "Test on older Xcode versions (Version 8.3, iOS SDK 10.3)"
osx_image: xcode8.3
env:
- PLATFORM=OS64 DEPLOYMENT_TARGET=10.3
- os: osx
name: "Test on older Xcode versions (Version 9.4,iOS SDK 11.4)"
osx_image: xcode9.4
env:
- PLATFORM=OS64 DEPLOYMENT_TARGET=11.4
- os: osx
name: "Mac Catalyst example"
osx_image: xcode12.2
env:
- PLATFORM=MAC_CATALYST DEPLOYMENT_TARGET=13.0
- os: osx
name: "Use new *COMBINED build support in CMake 3.19.4+"
osx_image: xcode12.2
env:
- PLATFORM=OS64COMBINED USE_XCODE=1 DEPLOYMENT_TARGET=11.0 USE_NEW_BUILD=1
exclude:
- osx_image: xcode10.2
env:
- PLATFORM=OS64COMBINED USE_XCODE=1 DEPLOYMENT_TARGET=11.0 BUILD_CURL=1 # Takes too much time to build...
- osx_image: xcode11.3
env:
- PLATFORM=OS64COMBINED USE_XCODE=1 DEPLOYMENT_TARGET=11.0 BUILD_CURL=1 # Takes too much time to build...
- osx_image: xcode12.2
env:
- PLATFORM=OS64COMBINED USE_XCODE=1 DEPLOYMENT_TARGET=11.0
- osx_image: xcode10.2
env:
- PLATFORM=OS64COMBINED USE_XCODE=1 DEPLOYMENT_TARGET=11.0 USE_NEW_BUILD=1
- osx_image: xcode11.3
env:
- PLATFORM=OS64COMBINED USE_XCODE=1 DEPLOYMENT_TARGET=11.0 USE_NEW_BUILD=1
allow_failures:
- env:
- PLATFORM=OS64COMBINED USE_XCODE=1 DEPLOYMENT_TARGET=11.0 USE_NEW_BUILD=1 # Allows failures since new Xcode build system broke Cmake and requires CMake 3.19.4+
- PLATFORM=OS64COMBINED USE_XCODE=1 DEPLOYMENT_TARGET=11.0 BUILD_CURL=1 # Allows failures since new Xcode build system broke Cmake and requires CMake 3.19.4+


install: skip

script:
Expand Down
11 changes: 9 additions & 2 deletions .travis/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ USE_XCODE=${USE_XCODE:-0}
BUILD_CURL=${BUILD_CURL:-0}
USE_STRICT_COMPILER_CHECKS=${USE_STRICT_COMPILER_CHECKS:-0}
DEPLOYMENT_TARGET=${DEPLOYMENT_TARGET:-11.0}
USE_NEW_BUILD=${USE_NEW_BUILD:-0}

SHARED_EXT=""
if [[ ${BUILD_SHARED} -eq 1 ]]; then
Expand All @@ -36,7 +37,13 @@ else
${GENERATOR_EXT} -DCMAKE_TOOLCHAIN_FILE=../../ios.toolchain.cmake -DCMAKE_INSTALL_PREFIX=../out \
-DPLATFORM=${PLATFORM} -DDEPLOYMENT_TARGET=${DEPLOYMENT_TARGET} -DENABLE_STRICT_TRY_COMPILE=${USE_STRICT_COMPILER_CHECKS} ${SHARED_EXT}\
|| exit 1
cmake --build . --config Release --target install || exit 1
# cmake --install . --config Release || exit 1 [TBA: Add this row when travis includes newer CMake versions in their images]

# Test new way of building in newer CMake versions when building the *COMBINED platform options
if [[ ${USE_NEW_BUILD} -eq 1 ]]; then
cmake --build . --config Release || exit 1
cmake --install . --config Release || exit 1
else
cmake --build . --config Release --target install || exit 1
fi
popd || exit 1
fi
37 changes: 11 additions & 26 deletions example/example-lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,18 @@ else()
message(STATUS "kqueue found!")
endif()

if(PLATFORM MATCHES "(MAC|MAC_ARM64)")
find_library(HAVE_APPKIT AppKit)
if (NOT HAVE_APPKIT)
message(FATAL_ERROR "AppKit.framework NOT found!")
else()
message(STATUS "AppKit.framework found!")
endif()
elseif(PLATFORM MATCHES "(MAC_CATALYST|MAC_CATALYST_ARM64)")
find_library(HAVE_APPKIT AppKit)
if (NOT HAVE_APPKIT)
message(FATAL_ERROR "AppKit.framework NOT found!")
else()
message(STATUS "AppKit.framework found!")
endif()
find_library(HAVE_UIKIT UIKit)
if (NOT HAVE_UIKIT)
message(FATAL_ERROR "UIKit.framework NOT found!")
else()
message(STATUS "UIKit.framework found!")
endif()
find_library(HAVE_APPKIT AppKit)
if (NOT HAVE_APPKIT)
message(STATUS "AppKit.framework NOT found!")
else()
find_library(HAVE_UIKIT UIKit)
if (NOT HAVE_UIKIT)
message(FATAL_ERROR "UIKit.framework NOT found!")
else()
message(STATUS "UIKit.framework found!")
endif()
message(STATUS "AppKit.framework found!")
endif()

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

# Hook up XCTest for the supported plaforms (all but WatchOS)
Expand Down
11 changes: 5 additions & 6 deletions ios.toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -499,10 +499,11 @@ endif()
# Configure libtool to be used instead of ar + ranlib to build static libraries.
# This is required on Xcode 7+, but should also work on previous versions of
# Xcode.
set(CMAKE_C_CREATE_STATIC_LIBRARY
"${BUILD_LIBTOOL} -static -o <TARGET> <LINK_FLAGS> <OBJECTS> " CACHE STRING "" ${FORCE_CACHE})
set(CMAKE_CXX_CREATE_STATIC_LIBRARY
"${BUILD_LIBTOOL} -static -o <TARGET> <LINK_FLAGS> <OBJECTS> " CACHE STRING "" ${FORCE_CACHE})
get_property(languages GLOBAL PROPERTY ENABLED_LANGUAGES)
foreach(lang ${languages})
set(CMAKE_${lang}_CREATE_STATIC_LIBRARY
"${BUILD_LIBTOOL} -static -o <TARGET> <LINK_FLAGS> <OBJECTS> ")
endforeach()

# CMake 3.14+ support building for iOS, watchOS and tvOS out of the box.
if(MODERN_CMAKE)
Expand Down Expand Up @@ -739,8 +740,6 @@ set(CMAKE_TRY_COMPILE_PLATFORM_VARIABLES
CMAKE_CXX_COMPILER
BUILD_LIBTOOL
CMAKE_INSTALL_NAME_TOOL
CMAKE_C_CREATE_STATIC_LIBRARY
CMAKE_CXX_CREATE_STATIC_LIBRARY
)

set(CMAKE_PLATFORM_HAS_INSTALLNAME 1)
Expand Down

0 comments on commit f564049

Please sign in to comment.