Support for macOS 10.14

- 10.14 drops libstdc++
- drops support for Carbon :-)
- drops support for macOS < 10.9
This commit is contained in:
Ulrich Hertlein 2018-11-08 10:32:09 +01:00
parent eac4c9df60
commit 10af927260
3 changed files with 24 additions and 15 deletions

View File

@ -77,23 +77,27 @@ IF(APPLE AND NOT ANDROID)
SET(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD)") SET(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD)")
ELSE() ELSE()
# OSX >= 10.5 uses Cocoa windowing system, otherwise Carbon # macOS >= 10.5 uses Cocoa windowing system, otherwise Carbon
IF(OSG_OSX_VERSION VERSION_LESS 10.5) IF(OSG_OSX_VERSION VERSION_GREATER_EQUAL 10.5)
SET(OSG_WINDOWING_SYSTEM "Carbon" CACHE STRING "Windowing system type for graphics window creation, options Carbon, Cocoa or X11.")
ELSE()
SET(OSG_WINDOWING_SYSTEM "Cocoa" CACHE STRING "Windowing system type for graphics window creation, options Carbon, Cocoa or X11.") SET(OSG_WINDOWING_SYSTEM "Cocoa" CACHE STRING "Windowing system type for graphics window creation, options Carbon, Cocoa or X11.")
ELSE()
SET(OSG_WINDOWING_SYSTEM "Carbon" CACHE STRING "Windowing system type for graphics window creation, options Carbon, Cocoa or X11.")
ENDIF() ENDIF()
# Set defaults for Universal Binaries. We want 32-bit Intel/PPC on 10.4 # Set macOS architectures for Universal Binaries.
# and 32/64-bit Intel/PPC on >= 10.5. Anything <= 10.3 doesn't support. IF(OSG_OSX_VERSION VERSION_GREATER_EQUAL 10.14)
# These are set the first time CMake is run, and can be changed by # x86_64 only
# the user at any time. SET(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Build architectures for OSX")
IF(OSG_OSX_VERSION VERSION_GREATER 10.7) SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.9" CACHE STRING "Target OSX version")
# 64 Bit Works, i386,ppc is not supported any more # libstdc++ is no longer supported
SET(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11")
SET(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
ELSEIF(OSG_OSX_VERSION VERSION_GREATER_EQUAL 10.8)
# i386 is no longer supported
SET(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Build architectures for OSX") SET(CMAKE_OSX_ARCHITECTURES "x86_64" CACHE STRING "Build architectures for OSX")
SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.8" CACHE STRING "Target OSX version") SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.8" CACHE STRING "Target OSX version")
ELSEIF(OSG_OSX_VERSION VERSION_EQUAL 10.7) ELSEIF(OSG_OSX_VERSION VERSION_EQUAL 10.7)
# 64 Bit Works, PPC is not supported any more # ppc is no longer supported
SET(CMAKE_OSX_ARCHITECTURES "i386;x86_64" CACHE STRING "Build architectures for OSX") SET(CMAKE_OSX_ARCHITECTURES "i386;x86_64" CACHE STRING "Build architectures for OSX")
ELSEIF(OSG_OSX_VERSION VERSION_GREATER 10.4) ELSEIF(OSG_OSX_VERSION VERSION_GREATER 10.4)
# 64-bit compiles are not supported with Carbon. # 64-bit compiles are not supported with Carbon.
@ -230,7 +234,6 @@ IF(APPLE)
SET(OPENGL_gl_LIBRARY "${IPHONE_SDKROOT}/System/Library/Frameworks/OpenGLES.framework") SET(OPENGL_gl_LIBRARY "${IPHONE_SDKROOT}/System/Library/Frameworks/OpenGLES.framework")
ELSE () ELSE ()
FIND_LIBRARY(CARBON_LIBRARY Carbon)
FIND_LIBRARY(COCOA_LIBRARY Cocoa) FIND_LIBRARY(COCOA_LIBRARY Cocoa)
# Apple OS X: Find OpenGL and AGL based on OSG_WINDOWING_SYSTEM # Apple OS X: Find OpenGL and AGL based on OSG_WINDOWING_SYSTEM
@ -254,6 +257,7 @@ IF(APPLE)
ELSEIF(OSG_WINDOWING_SYSTEM STREQUAL "Carbon") ELSEIF(OSG_WINDOWING_SYSTEM STREQUAL "Carbon")
# AGL needed for Carbon windowing systems # AGL needed for Carbon windowing systems
FIND_LIBRARY(CARBON_LIBRARY Carbon)
FIND_LIBRARY(AGL_LIBRARY AGL) FIND_LIBRARY(AGL_LIBRARY AGL)
ENDIF() ENDIF()

View File

@ -286,7 +286,7 @@ struct GraphicsWindowFunctionProxy
#if defined(_WIN32) #if defined(_WIN32)
#define USE_GRAPHICSWINDOW() USE_GRAPICSWINDOW_IMPLEMENTATION(Win32) #define USE_GRAPHICSWINDOW() USE_GRAPICSWINDOW_IMPLEMENTATION(Win32)
#elif defined(__APPLE__) #elif defined(__APPLE__)
#define USE_GRAPHICSWINDOW() USE_GRAPICSWINDOW_IMPLEMENTATION(Carbon) #define USE_GRAPHICSWINDOW() USE_GRAPICSWINDOW_IMPLEMENTATION(Cocoa)
#else #else
#define USE_GRAPHICSWINDOW() USE_GRAPICSWINDOW_IMPLEMENTATION(X11) #define USE_GRAPHICSWINDOW() USE_GRAPICSWINDOW_IMPLEMENTATION(X11)
#endif #endif

View File

@ -127,9 +127,14 @@ SET(TARGET_SRC
IF(APPLE AND NOT ANDROID) IF(APPLE AND NOT ANDROID)
IF(NOT OSG_BUILD_PLATFORM_IPHONE) IF(NOT OSG_BUILD_PLATFORM_IPHONE)
IF(OSG_OSX_VERSION VERSION_GREATER_EQUAL 10.14)
# Needs CoreFoundation
SET(OSGDB_PLATFORM_SPECIFIC_LIBRARIES ${COCOA_LIBRARY})
ELSE()
# Needs CoreFoundation calls and a Carbon function # Needs CoreFoundation calls and a Carbon function
SET(OSGDB_PLATFORM_SPECIFIC_LIBRARIES ${CARBON_LIBRARY} ${COCOA_LIBRARY}) SET(OSGDB_PLATFORM_SPECIFIC_LIBRARIES ${CARBON_LIBRARY} ${COCOA_LIBRARY})
ENDIF() ENDIF()
ENDIF()
IF(OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX STREQUAL "quicktime") IF(OSG_DEFAULT_IMAGE_PLUGIN_FOR_OSX STREQUAL "quicktime")
ADD_DEFINITIONS(-DDARWIN_QUICKTIME) ADD_DEFINITIONS(-DDARWIN_QUICKTIME)