diff options
Diffstat (limited to 'indra/cmake')
-rwxr-xr-x | indra/cmake/00-Common.cmake | 37 | ||||
-rwxr-xr-x | indra/cmake/Boost.cmake | 54 | ||||
-rwxr-xr-x | indra/cmake/BuildVersion.cmake | 58 | ||||
-rwxr-xr-x | indra/cmake/Copy3rdPartyLibs.cmake | 35 | ||||
-rwxr-xr-x | indra/cmake/Variables.cmake | 3 |
5 files changed, 106 insertions, 81 deletions
diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index b969084632..472f271fa8 100755 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -153,21 +153,21 @@ if (LINUX) -pthread ) - add_definitions(-DAPPID=secondlife) - add_definitions(-fvisibility=hidden) - # don't catch SIGCHLD in our base application class for the viewer - some of our 3rd party libs may need their *own* SIGCHLD handler to work. Sigh! The viewer doesn't need to catch SIGCHLD anyway. - add_definitions(-DLL_IGNORE_SIGCHLD) - if (WORD_SIZE EQUAL 32) - add_definitions(-march=pentium4) - endif (WORD_SIZE EQUAL 32) - add_definitions(-mfpmath=sse) - #add_definitions(-ftree-vectorize) # THIS CRASHES GCC 3.1-3.2 - if (NOT STANDALONE) - # this stops us requiring a really recent glibc at runtime - add_definitions(-fno-stack-protector) - # linking can be very memory-hungry, especially the final viewer link - set(CMAKE_CXX_LINK_FLAGS "-Wl,--no-keep-memory") - endif (NOT STANDALONE) + add_definitions(-DAPPID=secondlife) + add_definitions(-fvisibility=hidden) + # don't catch SIGCHLD in our base application class for the viewer - some of our 3rd party libs may need their *own* SIGCHLD handler to work. Sigh! The viewer doesn't need to catch SIGCHLD anyway. + add_definitions(-DLL_IGNORE_SIGCHLD) + if (WORD_SIZE EQUAL 32) + add_definitions(-march=pentium4) + endif (WORD_SIZE EQUAL 32) + add_definitions(-mfpmath=sse) + #add_definitions(-ftree-vectorize) # THIS CRASHES GCC 3.1-3.2 + if (NOT STANDALONE) + # this stops us requiring a really recent glibc at runtime + add_definitions(-fno-stack-protector) + # linking can be very memory-hungry, especially the final viewer link + set(CMAKE_CXX_LINK_FLAGS "-Wl,--no-keep-memory") + endif (NOT STANDALONE) set(CMAKE_CXX_FLAGS_DEBUG "-fno-inline ${CMAKE_CXX_FLAGS_DEBUG}") set(CMAKE_CXX_FLAGS_RELEASE "-O2 ${CMAKE_CXX_FLAGS_RELEASE}") @@ -175,12 +175,7 @@ endif (LINUX) if (DARWIN) - # NOTE (per http://lists.apple.com/archives/darwin-dev/2008/Jan/msg00232.html): - # > Why the bus error? What am I doing wrong? - # This is a known issue where getcontext(3) is writing past the end of the - # ucontext_t struct when _XOPEN_SOURCE is not defined (rdar://problem/5578699 ). - # As a workaround, define _XOPEN_SOURCE before including ucontext.h. - add_definitions(-DLL_DARWIN=1 -D_XOPEN_SOURCE) + add_definitions(-DLL_DARWIN=1) set(CMAKE_CXX_LINK_FLAGS "-Wl,-no_compact_unwind -Wl,-headerpad_max_install_names,-search_paths_first") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_LINK_FLAGS}") set(DARWIN_extra_cstar_flags "-mlong-branch -g") diff --git a/indra/cmake/Boost.cmake b/indra/cmake/Boost.cmake index 1acb2bbbfd..cff762e1f0 100755 --- a/indra/cmake/Boost.cmake +++ b/indra/cmake/Boost.cmake @@ -7,11 +7,12 @@ set(Boost_FIND_REQUIRED ON) if (STANDALONE) include(FindBoost) + set(BOOST_CONTEXT_LIBRARY boost_context-mt) + set(BOOST_FILESYSTEM_LIBRARY boost_filesystem-mt) set(BOOST_PROGRAM_OPTIONS_LIBRARY boost_program_options-mt) set(BOOST_REGEX_LIBRARY boost_regex-mt) set(BOOST_SIGNALS_LIBRARY boost_signals-mt) set(BOOST_SYSTEM_LIBRARY boost_system-mt) - set(BOOST_FILESYSTEM_LIBRARY boost_filesystem-mt) set(BOOST_THREAD_LIBRARY boost_thread-mt) else (STANDALONE) use_prebuilt_binary(boost) @@ -20,6 +21,12 @@ else (STANDALONE) if (WINDOWS) if(MSVC80) + set(BOOST_CONTEXT_LIBRARY + optimized libboost_context-vc80-mt-${BOOST_VERSION} + debug libboost_context-vc80-mt-gd-${BOOST_VERSION}) + set(BOOST_FILESYSTEM_LIBRARY + optimized libboost_filesystem-vc80-mt-${BOOST_VERSION} + debug libboost_filesystem-vc80-mt-gd-${BOOST_VERSION}) set(BOOST_PROGRAM_OPTIONS_LIBRARY optimized libboost_program_options-vc80-mt-${BOOST_VERSION} debug libboost_program_options-vc80-mt-gd-${BOOST_VERSION}) @@ -32,59 +39,74 @@ else (STANDALONE) set(BOOST_SYSTEM_LIBRARY optimized libboost_system-vc80-mt-${BOOST_VERSION} debug libboost_system-vc80-mt-gd-${BOOST_VERSION}) - set(BOOST_FILESYSTEM_LIBRARY - optimized libboost_filesystem-vc80-mt-${BOOST_VERSION} - debug libboost_filesystem-vc80-mt-gd-${BOOST_VERSION}) + set(BOOST_THREAD_LIBRARY + optimized libboost_thread-vc80-mt-${BOOST_VERSION} + debug libboost_thread-vc80-mt-gd-${BOOST_VERSION}) else(MSVC80) # MSVC 10.0 config + set(BOOST_CONTEXT_LIBRARY + optimized libboost_context-mt + debug libboost_context-mt-gd) + set(BOOST_FILESYSTEM_LIBRARY + optimized libboost_filesystem-mt + debug libboost_filesystem-mt-gd) set(BOOST_PROGRAM_OPTIONS_LIBRARY optimized libboost_program_options-mt debug libboost_program_options-mt-gd) set(BOOST_REGEX_LIBRARY optimized libboost_regex-mt debug libboost_regex-mt-gd) + set(BOOST_SIGNALS_LIBRARY + optimized libboost_signals-mt + debug libboost_signals-mt-gd) set(BOOST_SYSTEM_LIBRARY optimized libboost_system-mt debug libboost_system-mt-gd) - set(BOOST_FILESYSTEM_LIBRARY - optimized libboost_filesystem-mt - debug libboost_filesystem-mt-gd) set(BOOST_THREAD_LIBRARY optimized libboost_thread-mt debug libboost_thread-mt-gd) endif (MSVC80) elseif (LINUX) + set(BOOST_CONTEXT_LIBRARY + optimized boost_context-mt + debug boost_context-mt-d) + set(BOOST_FILESYSTEM_LIBRARY + optimized boost_filesystem-mt + debug boost_filesystem-mt-d) set(BOOST_PROGRAM_OPTIONS_LIBRARY optimized boost_program_options-mt debug boost_program_options-mt-d) set(BOOST_REGEX_LIBRARY optimized boost_regex-mt debug boost_regex-mt-d) + set(BOOST_SIGNALS_LIBRARY + optimized boost_signals-mt + debug boost_signals-mt-d) set(BOOST_SYSTEM_LIBRARY optimized boost_system-mt debug boost_system-mt-d) - set(BOOST_FILESYSTEM_LIBRARY - optimized boost_filesystem-mt - debug boost_filesystem-mt-d) set(BOOST_THREAD_LIBRARY optimized boost_thread-mt debug boost_thread-mt-d) elseif (DARWIN) - set(BOOST_PROGRAM_OPTIONS_LIBRARY - optimized boost_program_options-mt - debug boost_program_options-mt-d) + set(BOOST_CONTEXT_LIBRARY + optimized boost_context-mt + debug boost_context-mt-d) + set(BOOST_FILESYSTEM_LIBRARY + optimized boost_filesystem-mt + debug boost_filesystem-mt-d) set(BOOST_PROGRAM_OPTIONS_LIBRARY optimized boost_program_options-mt debug boost_program_options-mt-d) set(BOOST_REGEX_LIBRARY optimized boost_regex-mt debug boost_regex-mt-d) + set(BOOST_SIGNALS_LIBRARY + optimized boost_signals-mt + debug boost_signals-mt-d) set(BOOST_SYSTEM_LIBRARY optimized boost_system-mt debug boost_system-mt-d) - set(BOOST_FILESYSTEM_LIBRARY - optimized boost_filesystem-mt - debug boost_filesystem-mt-d) set(BOOST_THREAD_LIBRARY optimized boost_thread-mt debug boost_thread-mt-d) diff --git a/indra/cmake/BuildVersion.cmake b/indra/cmake/BuildVersion.cmake index 60a519c9af..c494355746 100755 --- a/indra/cmake/BuildVersion.cmake +++ b/indra/cmake/BuildVersion.cmake @@ -1,18 +1,48 @@ # -*- cmake -*- +# Construct the viewer version number based on the indra/VIEWER_VERSION file -include(Python) +if (NOT DEFINED VIEWER_SHORT_VERSION) # will be true in indra/, false in indra/newview/ + set(VIEWER_VERSION_BASE_FILE "${CMAKE_CURRENT_SOURCE_DIR}/newview/VIEWER_VERSION.txt") -macro (build_version _target) - execute_process( - COMMAND ${PYTHON_EXECUTABLE} ${SCRIPTS_DIR}/build_version.py - llversion${_target}.h ${LLCOMMON_INCLUDE_DIRS} - OUTPUT_VARIABLE ${_target}_VERSION - OUTPUT_STRIP_TRAILING_WHITESPACE - ) + if ( EXISTS ${VIEWER_VERSION_BASE_FILE} ) + file(STRINGS ${VIEWER_VERSION_BASE_FILE} VIEWER_SHORT_VERSION REGEX "^[0-9]+\\.[0-9]+\\.[0-9]+") + string(REGEX REPLACE "^([0-9]+)\\.[0-9]+\\.[0-9]+" "\\1" VIEWER_VERSION_MAJOR ${VIEWER_SHORT_VERSION}) + string(REGEX REPLACE "^[0-9]+\\.([0-9]+)\\.[0-9]+" "\\1" VIEWER_VERSION_MINOR ${VIEWER_SHORT_VERSION}) + string(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" VIEWER_VERSION_PATCH ${VIEWER_SHORT_VERSION}) - if (${_target}_VERSION) - message(STATUS "Version of ${_target} is ${${_target}_VERSION}") - else (${_target}_VERSION) - message(SEND_ERROR "Could not determine ${_target} version") - endif (${_target}_VERSION) -endmacro (build_version) + if (DEFINED ENV{revision}) + set(VIEWER_VERSION_REVISION $ENV{revision}) + message("Revision (from environment): ${VIEWER_VERSION_REVISION}") + + else (DEFINED ENV{revision}) + find_program(MERCURIAL hg) + if (DEFINED MERCURIAL) + execute_process( + COMMAND ${MERCURIAL} parents --template "{rev}" + OUTPUT_VARIABLE VIEWER_VERSION_REVISION + OUTPUT_STRIP_TRAILING_WHITESPACE + ) + if (DEFINED VIEWER_VERSION_REVISION) + message("Revision (from hg) ${VIEWER_VERSION_REVISION}") + else (DEFINED VIEWER_VERSION_REVISION) + set(VIEWER_VERSION_REVISION 0 ) + message("Revision not set, repository not found, using ${VIEWER_VERSION_REVISION}") + endif (DEFINED VIEWER_VERSION_REVISION) + else (DEFINED MERCURIAL) + set(VIEWER_VERSION_REVISION 0) + message("Revision not set, 'hg' not found (${MERCURIAL}), using ${VIEWER_VERSION_REVISION}") + endif (DEFINED MERCURIAL) + endif (DEFINED ENV{revision}) + message("Building '${VIEWER_CHANNEL}' Version ${VIEWER_SHORT_VERSION}.${VIEWER_VERSION_REVISION}") + else ( EXISTS ${VIEWER_VERSION_BASE_FILE} ) + message(SEND_ERROR "Cannot get viewer version from '${VIEWER_VERSION_BASE_FILE}'") + endif ( EXISTS ${VIEWER_VERSION_BASE_FILE} ) + + set(VIEWER_CHANNEL_VERSION_DEFINES + "LL_VIEWER_CHANNEL=\"${VIEWER_CHANNEL}\"" + "LL_VIEWER_VERSION_MAJOR=${VIEWER_VERSION_MAJOR}" + "LL_VIEWER_VERSION_MINOR=${VIEWER_VERSION_MINOR}" + "LL_VIEWER_VERSION_PATCH=${VIEWER_VERSION_PATCH}" + "LL_VIEWER_VERSION_BUILD=${VIEWER_VERSION_REVISION}" + ) +endif (NOT DEFINED VIEWER_SHORT_VERSION) diff --git a/indra/cmake/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index a03c1a4281..29ab4b1710 100755 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -221,8 +221,10 @@ elseif(DARWIN) libcollada14dom.dylib ) - # fmod is statically linked on darwin - set(fmod_files "") + if (FMODEX) + set(debug_files ${debug_files} libfmodexL.dylib) + set(release_files ${release_files} libfmodex.dylib) + endif (FMODEX) elseif(LINUX) # linux is weird, multiple side by side configurations aren't supported @@ -253,12 +255,13 @@ elseif(LINUX) libapr-1.so.0 libaprutil-1.so.0 libatk-1.0.so + libboost_context-mt.so.${BOOST_VERSION}.0 + libboost_filesystem-mt.so.${BOOST_VERSION}.0 libboost_program_options-mt.so.${BOOST_VERSION}.0 libboost_regex-mt.so.${BOOST_VERSION}.0 - libboost_thread-mt.so.${BOOST_VERSION}.0 - libboost_filesystem-mt.so.${BOOST_VERSION}.0 libboost_signals-mt.so.${BOOST_VERSION}.0 libboost_system-mt.so.${BOOST_VERSION}.0 + libboost_thread-mt.so.${BOOST_VERSION}.0 libcollada14dom.so libcrypto.so.1.0.0 libdb-5.1.so @@ -365,30 +368,6 @@ copy_if_different( ) set(third_party_targets ${third_party_targets} ${out_targets}) -if (FMOD_SDK_DIR) - copy_if_different( - ${FMOD_SDK_DIR} - "${CMAKE_CURRENT_BINARY_DIR}/Debug" - out_targets - ${fmod_files} - ) - set(all_targets ${all_targets} ${out_targets}) - copy_if_different( - ${FMOD_SDK_DIR} - "${CMAKE_CURRENT_BINARY_DIR}/Release" - out_targets - ${fmod_files} - ) - set(all_targets ${all_targets} ${out_targets}) - copy_if_different( - ${FMOD_SDK_DIR} - "${CMAKE_CURRENT_BINARY_DIR}/RelWithDbgInfo" - out_targets - ${fmod_files} - ) - set(all_targets ${all_targets} ${out_targets}) -endif (FMOD_SDK_DIR) - if(NOT STANDALONE) add_custom_target( stage_third_party_libs ALL diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 6ec621632b..7c310ba9c3 100755 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -170,8 +170,7 @@ endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") # Default deploy grid set(GRID agni CACHE STRING "Target Grid") -set(VIEWER_CHANNEL "LindenDeveloper" CACHE STRING "Viewer Channel Name") -set(VIEWER_LOGIN_CHANNEL ${VIEWER_CHANNEL} CACHE STRING "Fake login channel for A/B Testing") +set(VIEWER_CHANNEL "Second Life Test" CACHE STRING "Viewer Channel Name") if (XCODE_VERSION GREATER 4.2) set(ENABLE_SIGNING OFF CACHE BOOL "Enable signing the viewer") |