summaryrefslogtreecommitdiff
path: root/indra/cmake/Variables.cmake
diff options
context:
space:
mode:
authorTofu Linden <tofu.linden@lindenlab.com>2010-04-28 12:41:34 +0100
committerTofu Linden <tofu.linden@lindenlab.com>2010-04-28 12:41:34 +0100
commit47fa4bc01478d5ef0311aa491321bfb397777302 (patch)
tree7d9ab0c14c56ece7b178dc9d8ab67633cd476af0 /indra/cmake/Variables.cmake
parentb740924c9dbb6a5697254ca238e099a62e7054a9 (diff)
parent96df3f3eb1351973d140ba73b507de44b1052c89 (diff)
merge from viewer-trunk
Diffstat (limited to 'indra/cmake/Variables.cmake')
-rw-r--r--indra/cmake/Variables.cmake31
1 files changed, 27 insertions, 4 deletions
diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake
index db0b44eb8f..bfaf3f4f26 100644
--- a/indra/cmake/Variables.cmake
+++ b/indra/cmake/Variables.cmake
@@ -75,11 +75,33 @@ endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(DARWIN 1)
- # set this dynamically from the build system now -
- # NOTE: wont have a distributable build unless you add this on the configure line with:
+
+ # NOTE: If specifying a different SDK with CMAKE_OSX_SYSROOT at configure
+ # time you should also specify CMAKE_OSX_DEPLOYMENT_TARGET explicitly,
+ # otherwise CMAKE_OSX_SYSROOT will be overridden here. We can't just check
+ # for it being unset, as it gets set to the system default :(
+
+ # Default to building against the 10.4 SDK if no deployment target is
+ # specified.
+ if (NOT CMAKE_OSX_DEPLOYMENT_TARGET)
+ # NOTE: setting -isysroot is NOT adequate: http://lists.apple.com/archives/Xcode-users/2007/Oct/msg00696.html
+ # see http://public.kitware.com/Bug/view.php?id=9959 + poppy
+ set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.4u.sdk)
+ set(CMAKE_OSX_DEPLOYMENT_TARGET 10.4)
+ endif (NOT CMAKE_OSX_DEPLOYMENT_TARGET)
+
+ # GCC 4.2 is incompatible with the MacOSX 10.4 SDK
+ if (${CMAKE_OSX_SYSROOT} MATCHES "10.4u")
+ set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "4.0")
+ endif (${CMAKE_OSX_SYSROOT} MATCHES "10.4u")
+
+ # NOTE: To attempt an i386/PPC Universal build, add this on the configure line:
# -DCMAKE_OSX_ARCHITECTURES:STRING='i386;ppc'
- #set(CMAKE_OSX_ARCHITECTURES i386;ppc)
- set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.4u.sdk)
+ # Build only for i386 by default, system default on MacOSX 10.6 is x86_64
+ if (NOT CMAKE_OSX_ARCHITECTURES)
+ set(CMAKE_OSX_ARCHITECTURES i386)
+ endif (NOT CMAKE_OSX_ARCHITECTURES)
+
if (CMAKE_OSX_ARCHITECTURES MATCHES "i386" AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc")
set(ARCH universal)
else (CMAKE_OSX_ARCHITECTURES MATCHES "i386" AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc")
@@ -89,6 +111,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(ARCH i386)
endif (${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc")
endif (CMAKE_OSX_ARCHITECTURES MATCHES "i386" AND CMAKE_OSX_ARCHITECTURES MATCHES "ppc")
+
set(LL_ARCH ${ARCH}_darwin)
set(LL_ARCH_DIR universal-darwin)
set(WORD_SIZE 32)