Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix Snow Leopard compatibility
Checking for clang in Xcode bundle seems pointless, command line tools should be installed.
Setting the path explicity to avoid fink/macports/homebrew prevents use of locally installed packages like clang and wxwidgets.
Realistically using opencl means the minimum OSX version targetable is 10.6.
Correct TARGET_SYSROOT check, add required -mmacosx-version-min to linker flags.
also using wxwidgets gl component.
  • Loading branch information
shuffle2 committed Oct 22, 2012
1 parent 72cb173 commit b2e2e49
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions CMakeLists.txt
Expand Up @@ -6,12 +6,8 @@ cmake_minimum_required(VERSION 2.6)
# Update compiler before calling project()
if (APPLE)
# Use clang compiler
set(CMAKE_C_COMPILER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang")
set(CMAKE_CXX_COMPILER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++")
if (NOT EXISTS "${CMAKE_CXX_COMPILER}")
set(CMAKE_C_COMPILER "clang")
set(CMAKE_CXX_COMPILER "clang++")
endif()
set(CMAKE_C_COMPILER "clang")
set(CMAKE_CXX_COMPILER "clang++")
endif()
project(dolphin-emu)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/CMakeTests)
Expand Down Expand Up @@ -126,10 +122,6 @@ if(UNIX AND NOT APPLE)
endif()

if(APPLE)
# Ignore MacPorts and Fink and any other locally installed packages that
# might prevent building a distributable binary.
set(CMAKE_SYSTEM_PREFIX_PATH /usr)
set(ENV{PATH} /usr/bin:/bin:/usr/sbin:/sbin)

# Some of our code contains Objective C constructs.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -x objective-c")
Expand All @@ -144,7 +136,7 @@ if(APPLE)
# This is inserted into the Info.plist as well.
# Note that the SDK determines the maximum version of which optional
# features can be used, not the minimum required version to run.
set(OSX_MIN_VERSION "10.5.4")
set(OSX_MIN_VERSION "10.6")
set(TARGET_FLAGS "${TARGET_FLAGS} -mmacosx-version-min=${OSX_MIN_VERSION}")
set(SYSROOT_LEGACY_PATH "/Developer/SDKs/MacOSX10.6.sdk")
set(SYSROOT_PATH "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk")
Expand All @@ -153,9 +145,9 @@ if(APPLE)
elseif(EXISTS "${SYSROOT_LEGACY_PATH}/")
set(TARGET_SYSROOT ${SYSROOT_LEGACY_PATH})
endif()
if(${TARGET_SYSROOT})
if(TARGET_SYSROOT)
set(TARGET_FLAGS "${TARGET_FLAGS} -isysroot ${TARGET_SYSROOT}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-syslibroot,${TARGET_SYSROOT}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -mmacosx-version-min=${OSX_MIN_VERSION} -Wl,-syslibroot,${TARGET_SYSROOT}")
endif()
# Do not warn about frameworks that are not available on all architectures.
# This avoids a warning when linking with QuickTime.
Expand Down Expand Up @@ -488,7 +480,7 @@ endif()
option(DISABLE_WX "Disable wxWidgets (use CLI interface)" OFF)
if(NOT DISABLE_WX)
include(FindwxWidgets OPTIONAL)
FIND_PACKAGE(wxWidgets COMPONENTS core aui adv)
FIND_PACKAGE(wxWidgets COMPONENTS core aui adv gl)

if(wxWidgets_FOUND)
EXECUTE_PROCESS(
Expand Down

0 comments on commit b2e2e49

Please sign in to comment.