From d7e90f4160aaa81e30206c80047b82833c049482 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Thu, 7 Feb 2013 11:56:57 -0500 Subject: derive version number from indra/VIEWER_VERSION.txt --- indra/cmake/BuildVersion.cmake | 58 ++++++++++++++++++++++++++++++++---------- indra/cmake/CMakeLists.txt | 1 - indra/cmake/Variables.cmake | 2 +- 3 files changed, 45 insertions(+), 16 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/BuildVersion.cmake b/indra/cmake/BuildVersion.cmake index 60a519c9af..7ee852bf72 100644 --- 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 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/CMakeLists.txt b/indra/cmake/CMakeLists.txt index 569034a6fb..4f567988b7 100644 --- a/indra/cmake/CMakeLists.txt +++ b/indra/cmake/CMakeLists.txt @@ -12,7 +12,6 @@ set(cmake_SOURCE_FILES Audio.cmake BerkeleyDB.cmake Boost.cmake - BuildVersion.cmake CARes.cmake CURL.cmake CMakeCopyIfDifferent.cmake diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 4b459f1a48..6c3b7801b9 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -141,7 +141,7 @@ endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set(GRID agni CACHE STRING "Target Grid") set(VIEWER ON CACHE BOOL "Build Second Life viewer.") -set(VIEWER_CHANNEL "LindenDeveloper" CACHE STRING "Viewer Channel Name") +set(VIEWER_CHANNEL "Second Life Test" CACHE STRING "Viewer Channel Name") set(VIEWER_LOGIN_CHANNEL ${VIEWER_CHANNEL} CACHE STRING "Fake login channel for A/B Testing") if (XCODE_VERSION GREATER 4.2) -- cgit v1.2.3 From 5ea68c69a443fb9364c6e86ec373d3bd57382da7 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Tue, 12 Feb 2013 10:50:47 -0500 Subject: convert to new channel name scheme and remove login_channel build time parameter --- indra/cmake/Variables.cmake | 1 - 1 file changed, 1 deletion(-) (limited to 'indra/cmake') diff --git a/indra/cmake/Variables.cmake b/indra/cmake/Variables.cmake index 6c3b7801b9..296da81e6c 100644 --- a/indra/cmake/Variables.cmake +++ b/indra/cmake/Variables.cmake @@ -142,7 +142,6 @@ set(GRID agni CACHE STRING "Target Grid") set(VIEWER ON CACHE BOOL "Build Second Life viewer.") set(VIEWER_CHANNEL "Second Life Test" CACHE STRING "Viewer Channel Name") -set(VIEWER_LOGIN_CHANNEL ${VIEWER_CHANNEL} CACHE STRING "Fake login channel for A/B Testing") if (XCODE_VERSION GREATER 4.2) set(ENABLE_SIGNING OFF CACHE BOOL "Enable signing the viewer") -- cgit v1.2.3 From b0125b513c34e21f17fd8e99d5f76f48edaf5040 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Wed, 20 Feb 2013 15:53:17 -0500 Subject: add viewer channel to compile time feedback --- indra/cmake/BuildVersion.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/cmake') diff --git a/indra/cmake/BuildVersion.cmake b/indra/cmake/BuildVersion.cmake index 7ee852bf72..c494355746 100644 --- a/indra/cmake/BuildVersion.cmake +++ b/indra/cmake/BuildVersion.cmake @@ -33,7 +33,7 @@ if (NOT DEFINED VIEWER_SHORT_VERSION) # will be true in indra/, false in indra/n message("Revision not set, 'hg' not found (${MERCURIAL}), using ${VIEWER_VERSION_REVISION}") endif (DEFINED MERCURIAL) endif (DEFINED ENV{revision}) - message("Building Version ${VIEWER_SHORT_VERSION} ${VIEWER_VERSION_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} ) -- cgit v1.2.3 From 54e2d2b000f36b35ab5ab53cf3aeee922e54fbe3 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 21 Feb 2013 01:13:24 -0500 Subject: MAINT-2389: Change viewer to Boost package without ucontext.h. In autobuild.xml, specify today's build of the Boost package that includes the Boost.Context library, and whose boost::dcoroutines library uses Boost.Context exclusively instead of its previous context-switching underpinnings (source of the ucontext.h dependency). Add BOOST_CONTEXT_LIBRARY to Boost.cmake and Copy3rdPartyLibs.cmake. Link it with the viewer and with the lllogin.cpp test executable. Track new Boost package convention that our (early, unofficial) Boost.Coroutine library is now accessed as boost/dcoroutine/etc.h and boost::dcoroutines::etc. Remove #include from llviewerprecompiledheaders.h and lllogin.cpp: old rule that Boost.Coroutine header must be #included before anything else that might use ucontext.h is gone now that we no longer depend on ucontext.h. In fact remove -D_XOPEN_SOURCE in 00-Common.cmake because that was inserted specifically to work around a known problem with the ucontext.h facilities. --- indra/cmake/00-Common.cmake | 7 +---- indra/cmake/Boost.cmake | 54 +++++++++++++++++++++++++++----------- indra/cmake/Copy3rdPartyLibs.cmake | 5 ++-- 3 files changed, 42 insertions(+), 24 deletions(-) (limited to 'indra/cmake') diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 452fd5f356..084ba7ea98 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -192,12 +192,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,-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 100644 --- 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/Copy3rdPartyLibs.cmake b/indra/cmake/Copy3rdPartyLibs.cmake index c32e357da3..8457cf5359 100644 --- a/indra/cmake/Copy3rdPartyLibs.cmake +++ b/indra/cmake/Copy3rdPartyLibs.cmake @@ -254,12 +254,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 libbreakpad_client.so.0 libcollada14dom.so libcrypto.so.1.0.0 -- cgit v1.2.3