summaryrefslogtreecommitdiff
path: root/indra/cmake
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2016-12-16 08:55:38 -0500
committerNat Goodspeed <nat@lindenlab.com>2016-12-16 08:55:38 -0500
commitaa5a591aa722c81de2b22d9126afa4a833d0c050 (patch)
treee2c25102c51257ebe549023001da4db04fa740e2 /indra/cmake
parentc9f6905e60206a007d9785b489a30b71a55cbc20 (diff)
parent89cd49f60f87852d94b3c21ef70e3fa2ed990e51 (diff)
Automated merge with ssh://bitbucket.org/lindenlab/viewer64
Diffstat (limited to 'indra/cmake')
-rw-r--r--indra/cmake/00-Common.cmake2
-rw-r--r--indra/cmake/Copy3rdPartyLibs.cmake7
-rw-r--r--indra/cmake/EXPAT.cmake6
-rw-r--r--indra/cmake/Variables.cmake40
4 files changed, 42 insertions, 13 deletions
diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake
index 6734f9585c..46dd8739bc 100644
--- a/indra/cmake/00-Common.cmake
+++ b/indra/cmake/00-Common.cmake
@@ -202,7 +202,7 @@ endif (LINUX)
if (DARWIN)
add_definitions(-DLL_DARWIN=1)
- set(CMAKE_CXX_LINK_FLAGS "-Wl,-no_compact_unwind -Wl,-headerpad_max_install_names,-search_paths_first")
+ set(CMAKE_CXX_LINK_FLAGS "-Wl,-headerpad_max_install_names,-search_paths_first")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_LINK_FLAGS}")
set(DARWIN_extra_cstar_flags "-g -Wno-unused-local-typedef -Wno-deprecated-declarations")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DARWIN_extra_cstar_flags}")
diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake
index 4630246d06..14510d654f 100644
--- a/indra/cmake/Copy3rdPartyLibs.cmake
+++ b/indra/cmake/Copy3rdPartyLibs.cmake
@@ -162,10 +162,8 @@ elseif(DARWIN)
libaprutil-1.0.dylib
libaprutil-1.dylib
libexception_handler.dylib
- libexpat.1.5.2.dylib
- libexpat.dylib
+ ${EXPAT_COPY}
libGLOD.dylib
- libhunspell-1.3.0.dylib
libndofdev.dylib
)
@@ -205,8 +203,7 @@ elseif(LINUX)
libaprutil-1.so.0
libatk-1.0.so
libdb-5.1.so
- libexpat.so
- libexpat.so.1
+ ${EXPAT_COPY}
libfreetype.so.6.6.2
libfreetype.so.6
libGLOD.so
diff --git a/indra/cmake/EXPAT.cmake b/indra/cmake/EXPAT.cmake
index c1155531ff..cddc71b227 100644
--- a/indra/cmake/EXPAT.cmake
+++ b/indra/cmake/EXPAT.cmake
@@ -10,8 +10,14 @@ else (USESYSTEMLIBS)
use_prebuilt_binary(expat)
if (WINDOWS)
set(EXPAT_LIBRARIES libexpatMT)
+ set(EXPAT_COPY libexpatMT.dll)
else (WINDOWS)
set(EXPAT_LIBRARIES expat)
+ if (DARWIN)
+ set(EXPAT_COPY libexpat.1.dylib libexpat.dylib)
+ else ()
+ set(EXPAT_COPY libexpat.so.1 libexpat.so)
+ endif ()
endif (WINDOWS)
set(EXPAT_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
endif (USESYSTEMLIBS)
diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake
index 3d0cb0a3c9..99b19ff07a 100644
--- a/indra/cmake/Variables.cmake
+++ b/indra/cmake/Variables.cmake
@@ -138,19 +138,45 @@ endif (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(DARWIN 1)
-
- # now we only support Xcode 7.0 using 10.11 (El Capitan), minimum OS 10.7 (Lion)
+
+ # The following must agree with
+ # https://bitbucket.org/lindenlab/viewer-build-variables/src/tip/variables
+ # Reading $LL_BUILD is an attempt to directly use those switches.
+ if ("$ENV{LL_BUILD}" STREQUAL "")
+ message(FATAL_ERROR "Environment variable LL_BUILD must be set")
+ endif ()
+
+ string(REGEX MATCH "-mmacosx-version-min=([^ ]+)" scratch "$ENV{LL_BUILD}")
+ set(CMAKE_OSX_DEPLOYMENT_TARGET "${CMAKE_MATCH_1}")
+ message(STATUS "CMAKE_OSX_DEPLOYMENT_TARGET = '${CMAKE_OSX_DEPLOYMENT_TARGET}'")
+
+ string(REGEX MATCH "-stdlib=([^ ]+)" scratch "$ENV{LL_BUILD}")
+ set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "${CMAKE_MATCH_1}")
+ message(STATUS "CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY = '${CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY}'")
+
+ string(REGEX MATCH " -g([^ ]*)" scratch "$ENV{LL_BUILD}")
+ set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "${CMAKE_MATCH_1}")
+ message(STATUS "CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT = '${CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT}'")
+
+ string(REGEX MATCH "-O([^ ]*)" scratch "$ENV{LL_BUILD}")
+ set(CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL "${CMAKE_MATCH_1}")
+ message(STATUS "CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL = '${CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL}'")
+
+ string(REGEX MATCHALL "[^ ]+" LL_BUILD_LIST "$ENV{LL_BUILD}")
+ list(FIND LL_BUILD_LIST "-iwithsysroot" sysroot_idx)
+ if ("${sysroot_idx}" LESS 0)
+ message(FATAL_ERROR "Environment variable LL_BUILD must contain '-iwithsysroot'")
+ endif ()
+ math(EXPR sysroot_idx "${sysroot_idx} + 1")
+ list(GET LL_BUILD_LIST "${sysroot_idx}" CMAKE_OSX_SYSROOT)
+ message(STATUS "CMAKE_OSX_SYSROOT = '${CMAKE_OSX_SYSROOT}'")
+
set(XCODE_VERSION 7.0)
- set(CMAKE_OSX_DEPLOYMENT_TARGET 10.7)
- set(CMAKE_OSX_SYSROOT macosx10.11)
set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvm.clang.1_0")
- set(CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL 3)
set(CMAKE_XCODE_ATTRIBUTE_GCC_STRICT_ALIASING NO)
set(CMAKE_XCODE_ATTRIBUTE_GCC_FAST_MATH NO)
set(CMAKE_XCODE_ATTRIBUTE_CLANG_X86_VECTOR_INSTRUCTIONS ssse3)
- set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
- set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT dwarf-with-dsym)
set(CMAKE_OSX_ARCHITECTURES "${ARCH}")
string(REPLACE "i686" "i386" CMAKE_OSX_ARCHITECTURES "${CMAKE_OSX_ARCHITECTURES}")