Major breaking changes

This commit is contained in:
Drake Arconis
2016-01-16 08:05:47 -05:00
parent 05ec61d0b0
commit 2f2e1fbe8f
94 changed files with 5594 additions and 6149 deletions

3298
autobuild.xml Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -3,19 +3,12 @@
# cmake_minimum_required should appear before any # cmake_minimum_required should appear before any
# other commands to guarantee full compatibility # other commands to guarantee full compatibility
# with the version specified # with the version specified
## prior to 2.8, the add_custom_target commands used in setting the version did not work correctly
cmake_minimum_required(VERSION 2.8.10 FATAL_ERROR) if(WIN32)
cmake_minimum_required(VERSION 3.4 FATAL_ERROR)
# Eventually the third-party support modules (cmake/*.cmake) should else()
# know the full path to all libraries. Until that happens we need cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
# per-configuration link directory "libraries/<arch>/lib/debug" for endif()
# Debug and "libraries/<arch>/lib/release" for Release,
# RelWithDebInfo, and MinSizeRel. CMake 2.6 does not directly support
# per-configuration link directory specification. However, we can set
# CMP0003 to OLD and link to one library (apr) on a per-configuration
# basis to convince CMake to add the proper link directory. This line
# can be removed when we use full paths for all libraries.
#cmake_policy(SET CMP0003 OLD)
set(ROOT_PROJECT_NAME "Singularity" CACHE STRING set(ROOT_PROJECT_NAME "Singularity" CACHE STRING
"The root project/makefile/solution name. Defaults to Singularity.") "The root project/makefile/solution name. Defaults to Singularity.")
@@ -24,26 +17,12 @@ project(${ROOT_PROJECT_NAME})
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
include(Variables) include(Variables)
# Load versions now. Install locations need them.
include(BuildVersion) include(BuildVersion)
include(UnixInstall)
if (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
"Build type. One of: Debug Release RelWithDebInfo" FORCE) "Build type. One of: Debug Release RelWithDebInfo" FORCE)
endif (NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE) endif (NOT CMAKE_BUILD_TYPE)
# Create a 'prepare' target in which to perform setup actions. This
# must be the first target created so other targets can depend on it.
if(NOT STANDALONE)
# We prepare prebuilt binaries when not building standalone.
set(prepare_depends ${CMAKE_BINARY_DIR}/prepare/prebuilt)
endif(NOT STANDALONE)
if(WINDOWS)
set(prepare_depends ${prepare_depends} copy_win_libs)
endif(WINDOWS)
add_custom_target(prepare DEPENDS ${prepare_depends})
add_subdirectory(cmake) add_subdirectory(cmake)
add_subdirectory(${LIBS_OPEN_PREFIX}aistatemachine) add_subdirectory(${LIBS_OPEN_PREFIX}aistatemachine)
@@ -70,8 +49,6 @@ if(STANDALONE)
add_subdirectory(${LIBS_OPEN_PREFIX}llqtwebkit) add_subdirectory(${LIBS_OPEN_PREFIX}llqtwebkit)
endif(STANDALONE) endif(STANDALONE)
#add_subdirectory(${LIBS_OPEN_PREFIX}lscript)
if (WINDOWS AND EXISTS ${LIBS_CLOSED_DIR}copy_win_scripts) if (WINDOWS AND EXISTS ${LIBS_CLOSED_DIR}copy_win_scripts)
add_subdirectory(${LIBS_CLOSED_PREFIX}copy_win_scripts) add_subdirectory(${LIBS_CLOSED_PREFIX}copy_win_scripts)
endif (WINDOWS AND EXISTS ${LIBS_CLOSED_DIR}copy_win_scripts) endif (WINDOWS AND EXISTS ${LIBS_CLOSED_DIR}copy_win_scripts)
@@ -83,42 +60,7 @@ add_subdirectory(${LIBS_OPEN_PREFIX}llui)
# viewer plugins directory # viewer plugins directory
add_subdirectory(${LIBS_OPEN_PREFIX}plugins) add_subdirectory(${LIBS_OPEN_PREFIX}plugins)
# llplugin testbed code (is this the right way to include it?)
#if (NOT LINUX)
# add_subdirectory(${VIEWER_PREFIX}test_apps/llplugintest)
#endif (NOT LINUX)
add_subdirectory(${VIEWER_PREFIX}newview/statemachine) add_subdirectory(${VIEWER_PREFIX}newview/statemachine)
add_subdirectory(${VIEWER_PREFIX}newview) add_subdirectory(${VIEWER_PREFIX}newview)
add_dependencies(viewer secondlife-bin) add_dependencies(viewer secondlife-bin)
# The use_prebuilt_binary macro in cmake/Prebuilt.cmake records
# packages in the PREBUILT property of the 'prepare' target.
get_property(PREBUILT_PACKAGES TARGET prepare PROPERTY PREBUILT)
# Create a script to download the needed binaries.
configure_file(${CMAKE_SOURCE_DIR}/cmake/DownloadPrebuilt.cmake.in
${CMAKE_BINARY_DIR}/DownloadPrebuilt.cmake @ONLY)
# Drive the download script at build time. Depend on 'install.xml'
# to aqcuire new binaries when needed.
add_custom_command(
COMMENT "Obtaining prebuilt binaries..."
OUTPUT ${CMAKE_BINARY_DIR}/prepare/prebuilt
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_BINARY_DIR}/DownloadPrebuilt.cmake
DEPENDS ${CMAKE_SOURCE_DIR}/../install.xml
${CMAKE_BINARY_DIR}/DownloadPrebuilt.cmake
)
if(WINDOWS)
configure_file(${CMAKE_SOURCE_DIR}/cmake/CopyWinLibs.cmake.in
${CMAKE_BINARY_DIR}/CopyWinLibs.cmake @ONLY)
add_custom_command(
COMMENT "Copying prebuilt libraries to viewer executable directory"
OUTPUT ${CMAKE_BINARY_DIR}/CopyWinLibs
COMMAND ${CMAKE_COMMAND} -DCUR_CONFIG:STRING=${CMAKE_CFG_INTDIR} -P ${CMAKE_BINARY_DIR}/CopyWinLibs.cmake
DEPENDS ${CMAKE_BINARY_DIR}/prepare/prebuilt ${CMAKE_BINARY_DIR}/CopyWinLibs.cmake
)
add_custom_target(copy_win_libs DEPENDS ${CMAKE_BINARY_DIR}/CopyWinLibs)
endif(WINDOWS)

View File

@@ -39,5 +39,3 @@ set_source_files_properties(${aistatemachine_HEADER_FILES}
list(APPEND aistatemachine_SOURCE_FILES ${aistatemachine_HEADER_FILES}) list(APPEND aistatemachine_SOURCE_FILES ${aistatemachine_HEADER_FILES})
add_library (aistatemachine ${aistatemachine_SOURCE_FILES}) add_library (aistatemachine ${aistatemachine_SOURCE_FILES})
add_dependencies(aistatemachine prepare)

View File

@@ -34,6 +34,7 @@
#include "aistatemachine.h" #include "aistatemachine.h"
#include "llthread.h" #include "llthread.h"
#include "aithreadsafe.h" #include "aithreadsafe.h"
#include <boost/format.hpp>
#ifdef EXAMPLE_CODE // undefined #ifdef EXAMPLE_CODE // undefined
@@ -235,7 +236,7 @@ class AIStateMachineThread : public AIStateMachineThreadBase {
/*virtual*/ const char* getName() const /*virtual*/ const char* getName() const
{ {
#define STRIZE(arg) #arg #define STRIZE(arg) #arg
return "AIStateMachineThread<"STRIZE(THREAD_IMPL)">"; return (boost::format("%1%%2%%3%") % "AIStateMachineThread<" % STRIZE(THREAD_IMPL) % ">").str().c_str();
#undef STRIZE #undef STRIZE
} }

View File

@@ -40,22 +40,6 @@ set(CMAKE_CONFIGURATION_TYPES "RelWithDebInfo;Release;Debug" CACHE STRING
# Platform-specific compilation flags. # Platform-specific compilation flags.
if (WINDOWS) if (WINDOWS)
# Various libs are compiler specific, generate some variables here we can just use
# when we require them instead of reimplementing the test each time.
if (MSVC10)
set(MSVC_DIR 10.0)
set(MSVC_SUFFIX 100)
elseif (MSVC12)
set(MSVC_DIR 12.0)
set(MSVC_SUFFIX 120)
endif (MSVC10)
# Remove default /Zm1000 flag that cmake inserts
string (REPLACE "/Zm1000" " " CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
# Always use /Zm140
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zm140")
# Don't build DLLs. # Don't build DLLs.
set(BUILD_SHARED_LIBS OFF) set(BUILD_SHARED_LIBS OFF)
@@ -70,13 +54,17 @@ if (WINDOWS)
set(CMAKE_C_FLAGS_RELEASE set(CMAKE_C_FLAGS_RELEASE
"${CMAKE_C_FLAGS_RELEASE} ${LL_C_FLAGS} /O2 /Zi /MD /MP /fp:fast" "${CMAKE_C_FLAGS_RELEASE} ${LL_C_FLAGS} /O2 /Zi /MD /MP /fp:fast"
CACHE STRING "C compiler release options" FORCE) CACHE STRING "C compiler release options" FORCE)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE")
if (WORD_SIZE EQUAL 32)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE")
endif (WORD_SIZE EQUAL 32)
set(CMAKE_CXX_STANDARD_LIBRARIES "") set(CMAKE_CXX_STANDARD_LIBRARIES "")
set(CMAKE_C_STANDARD_LIBRARIES "") set(CMAKE_C_STANDARD_LIBRARIES "")
add_definitions( add_definitions(
/DLL_WINDOWS=1 /DLL_WINDOWS=1
/DNOMINMAX
/DUNICODE /DUNICODE
/D_UNICODE /D_UNICODE
/GS /GS
@@ -84,38 +72,25 @@ if (WINDOWS)
/W3 /W3
/c /c
/Zc:forScope /Zc:forScope
/Zc:wchar_t- /Zc:rvalueCast
/Zc:wchar_t
/nologo /nologo
/Oy- /Oy-
/Zm140
) )
# SSE2 is implied on win64
if(WORD_SIZE EQUAL 32)
add_definitions(/arch:SSE2 /D_ATL_XP_TARGETING)
else(WORD_SIZE EQUAL 32)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /wd4267 /wd4250 /wd4244")
endif(WORD_SIZE EQUAL 32)
if (WORD_SIZE EQUAL 32) if (WORD_SIZE EQUAL 32)
# configure win32 API for windows XP+ compatibility add_compile_options(/arch:SSE2)
set(WINVER "0x0501" CACHE STRING "Win32 API Target version (see http://msdn.microsoft.com/en-us/library/aa383745%28v=VS.85%29.aspx)")
add_definitions("/DWINVER=${WINVER}" "/D_WIN32_WINNT=${WINVER}")
else (WORD_SIZE EQUAL 32)
# configure win32 API for windows vista+ compatibility
set(WINVER "0x0600" CACHE STRING "Win32 API Target version (see http://msdn.microsoft.com/en-us/library/aa383745%28v=VS.85%29.aspx)")
add_definitions("/DWINVER=${WINVER}" "/D_WIN32_WINNT=${WINVER}")
endif (WORD_SIZE EQUAL 32) endif (WORD_SIZE EQUAL 32)
# Use special XP-compatible toolchain on 32-bit builds
if (MSVC12 AND (WORD_SIZE EQUAL 32))
set(CMAKE_GENERATOR_TOOLSET "v120xp")
endif (MSVC12 AND (WORD_SIZE EQUAL 32))
# Are we using the crummy Visual Studio KDU build workaround?
if (NOT DISABLE_FATAL_WARNINGS) if (NOT DISABLE_FATAL_WARNINGS)
add_definitions(/WX) add_definitions(/WX)
endif (NOT DISABLE_FATAL_WARNINGS) endif (NOT DISABLE_FATAL_WARNINGS)
# configure win32 API for windows Vista+ compatibility
set(WINVER "0x0600" CACHE STRING "Win32 API Target version (see http://msdn.microsoft.com/en-us/library/aa383745%28v=VS.85%29.aspx)")
add_definitions("/DWINVER=${WINVER}" "/D_WIN32_WINNT=${WINVER}")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO") SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /MANIFEST:NO")
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /MANIFEST:NO") SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /MANIFEST:NO")
SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /MANIFEST:NO") SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /MANIFEST:NO")

View File

@@ -13,37 +13,43 @@ if (STANDALONE)
else (STANDALONE) else (STANDALONE)
use_prebuilt_binary(apr_suite) use_prebuilt_binary(apr_suite)
if (WINDOWS) if (WINDOWS)
if (LLCOMMON_LINK_SHARED)
set(APR_selector "lib")
else (LLCOMMON_LINK_SHARED)
set(APR_selector "")
endif (LLCOMMON_LINK_SHARED)
set(APR_LIBRARIES set(APR_LIBRARIES
debug libapr-1.lib debug ${ARCH_PREBUILT_DIRS_DEBUG}/${APR_selector}apr-1.lib
optimized libapr-1.lib optimized ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}apr-1.lib
) )
set(APRICONV_LIBRARIES set(APRICONV_LIBRARIES
debug libapriconv-1.lib debug ${ARCH_PREBUILT_DIRS_DEBUG}/${APR_selector}apriconv-1.lib
optimized libapriconv-1.lib optimized ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}apriconv-1.lib
) )
set(APRUTIL_LIBRARIES set(APRUTIL_LIBRARIES
debug libaprutil-1.lib debug ${ARCH_PREBUILT_DIRS_DEBUG}/${APR_selector}aprutil-1.lib ${APRICONV_LIBRARIES}
optimized libaprutil-1.lib optimized ${ARCH_PREBUILT_DIRS_RELEASE}/${APR_selector}aprutil-1.lib ${APRICONV_LIBRARIES}
) )
if(NOT LLCOMMON_LINK_SHARED)
list(APPEND APR_LIBRARIES Rpcrt4)
endif(NOT LLCOMMON_LINK_SHARED)
elseif (DARWIN) elseif (DARWIN)
set(APR_LIBRARIES if (LLCOMMON_LINK_SHARED)
debug libapr-1.0.dylib set(APR_selector "0.dylib")
optimized libapr-1.0.dylib set(APRUTIL_selector "0.dylib")
) else (LLCOMMON_LINK_SHARED)
set(APRUTIL_LIBRARIES set(APR_selector "a")
debug libaprutil-1.dylib set(APRUTIL_selector "a")
optimized libaprutil-1.dylib endif (LLCOMMON_LINK_SHARED)
) set(APR_LIBRARIES libapr-1.${APR_selector})
set(APRUTIL_LIBRARIES libaprutil-1.${APRUTIL_selector})
set(APRICONV_LIBRARIES iconv) set(APRICONV_LIBRARIES iconv)
else (WINDOWS) else (WINDOWS)
set(APR_LIBRARIES apr-1) set(APR_LIBRARIES apr-1)
set(APRUTIL_LIBRARIES aprutil-1) set(APRUTIL_LIBRARIES aprutil-1)
set(APRICONV_LIBRARIES iconv) set(APRICONV_LIBRARIES iconv)
endif (WINDOWS) endif (WINDOWS)
set(APR_INCLUDE_DIR set(APR_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/apr-1)
${LIBS_PREBUILT_DIR}/include/apr-1
${LIBS_PREBUILT_LEGACY_DIR}/include/apr-1
)
if (LINUX) if (LINUX)
list(APPEND APRUTIL_LIBRARIES ${DB_LIBRARIES}) list(APPEND APRUTIL_LIBRARIES ${DB_LIBRARIES})

View File

@@ -8,11 +8,8 @@ if (STANDALONE)
pkg_check_modules(VORBISENC REQUIRED vorbisenc) pkg_check_modules(VORBISENC REQUIRED vorbisenc)
pkg_check_modules(VORBISFILE REQUIRED vorbisfile) pkg_check_modules(VORBISFILE REQUIRED vorbisfile)
else (STANDALONE) else (STANDALONE)
use_prebuilt_binary(ogg-vorbis) use_prebuilt_binary(ogg_vorbis)
set(VORBIS_INCLUDE_DIRS set(VORBIS_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
${LIBS_PREBUILT_DIR}/include
${LIBS_PREBUILT_LEGACY_DIR}/include
)
set(VORBISENC_INCLUDE_DIRS ${VORBIS_INCLUDE_DIRS}) set(VORBISENC_INCLUDE_DIRS ${VORBIS_INCLUDE_DIRS})
set(VORBISFILE_INCLUDE_DIRS ${VORBIS_INCLUDE_DIRS}) set(VORBISFILE_INCLUDE_DIRS ${VORBIS_INCLUDE_DIRS})

View File

@@ -11,11 +11,8 @@ if (STANDALONE)
find_package(Boost 1.51.0 COMPONENTS date_time filesystem program_options regex system thread wave context) find_package(Boost 1.51.0 COMPONENTS date_time filesystem program_options regex system thread wave context)
else (STANDALONE) else (STANDALONE)
use_prebuilt_binary(boost) use_prebuilt_binary(boost)
set(Boost_INCLUDE_DIRS set(Boost_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
${LIBS_PREBUILT_DIR}/include set(Boost_VERSION "1.60")
${LIBS_PREBUILT_LEGACY_DIR}/include
)
set(Boost_VERSION "1.52")
if (WINDOWS) if (WINDOWS)
set(Boost_CONTEXT_LIBRARY set(Boost_CONTEXT_LIBRARY

View File

@@ -0,0 +1,11 @@
# -*- cmake -*-
# Construct the version and copyright information based on package data.
include(Python)
include(Variables)
add_custom_command(OUTPUT packages-info.txt
COMMENT "Generating packages-info.txt for the about box"
MAIN_DEPENDENCY ${CMAKE_SOURCE_DIR}/../autobuild.xml
DEPENDS ${CMAKE_SOURCE_DIR}/../scripts/packages-formatter.py
COMMAND ${PYTHON_EXECUTABLE} ${CMAKE_SOURCE_DIR}/../scripts/packages-formatter.py -p=${AUTOBUILD_PLATFORM_NAME} > packages-info.txt
)

View File

@@ -20,8 +20,5 @@ else (STANDALONE)
else (WINDOWS) else (WINDOWS)
set(CARES_LIBRARIES cares) set(CARES_LIBRARIES cares)
endif (WINDOWS) endif (WINDOWS)
set(CARES_INCLUDE_DIRS set(CARES_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/ares)
${LIBS_PREBUILT_DIR}/include/ares
${LIBS_PREBUILT_LEGACY_DIR}/include/ares
)
endif (STANDALONE) endif (STANDALONE)

View File

@@ -20,18 +20,17 @@ set(cmake_SOURCE_FILES
CURL.cmake CURL.cmake
Colladadom.cmake Colladadom.cmake
ConfigurePkgConfig.cmake ConfigurePkgConfig.cmake
CopyBackToSource.cmake Copy3rdPartyLibs.cmake
CopyWinLibs.cmake
Cwdebug.cmake Cwdebug.cmake
DBusGlib.cmake DBusGlib.cmake
DirectX.cmake DeploySharedLibs.cmake
DownloadPrebuilt.cmake.in
ELFIO.cmake ELFIO.cmake
EXPAT.cmake EXPAT.cmake
ExamplePlugin.cmake ExamplePlugin.cmake
FMODEX.cmake FMODEX.cmake
FMODSTUDIO.cmake FMODSTUDIO.cmake
FindAPR.cmake FindAPR.cmake
FindAutobuild.cmake
FindBerkeleyDB.cmake FindBerkeleyDB.cmake
FindCARes.cmake FindCARes.cmake
FindColladadom.cmake FindColladadom.cmake
@@ -73,6 +72,7 @@ set(cmake_SOURCE_FILES
LLSharedLibs.cmake LLSharedLibs.cmake
LLQtWebkit.cmake LLQtWebkit.cmake
LLRender.cmake LLRender.cmake
LLSharedLibs.cmake
LLUI.cmake LLUI.cmake
LLVFS.cmake LLVFS.cmake
LLWindow.cmake LLWindow.cmake
@@ -110,7 +110,6 @@ source_group("Shared Rules" FILES ${cmake_SOURCE_FILES})
set(master_SOURCE_FILES set(master_SOURCE_FILES
../CMakeLists.txt ../CMakeLists.txt
../develop.py
) )
source_group("Master Rules" FILES ${master_SOURCE_FILES}) source_group("Master Rules" FILES ${master_SOURCE_FILES})

View File

@@ -18,8 +18,5 @@ else (STANDALONE)
list(APPEND CURL_LIBRARIES idn) list(APPEND CURL_LIBRARIES idn)
endif(LINUX AND WORD_SIZE EQUAL 64) endif(LINUX AND WORD_SIZE EQUAL 64)
endif (WINDOWS) endif (WINDOWS)
set(CURL_INCLUDE_DIRS set(CURL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
${LIBS_PREBUILT_DIR}/include
${LIBS_PREBUILT_LEGACY_DIR}/include
)
endif (STANDALONE) endif (STANDALONE)

View File

@@ -10,49 +10,22 @@ if (STANDALONE)
include (FindColladadom) include (FindColladadom)
else (STANDALONE) else (STANDALONE)
use_prebuilt_binary(colladadom) use_prebuilt_binary(colladadom)
if (NOT WINDOWS AND NOT LINUX)
use_prebuilt_binary(pcre)
endif (NOT WINDOWS AND NOT LINUX)
if (NOT DARWIN AND NOT WINDOWS)
use_prebuilt_binary(libxml)
endif (NOT DARWIN AND NOT WINDOWS)
set(COLLADADOM_INCLUDE_DIRS set(COLLADADOM_INCLUDE_DIRS
${LIBS_PREBUILT_DIR}/include/collada ${LIBS_PREBUILT_DIR}/include/collada
${LIBS_PREBUILT_DIR}/include/collada/1.4 ${LIBS_PREBUILT_DIR}/include/collada/1.4
${LIBS_PREBUILT_LEGACY_DIR}/include/collada )
${LIBS_PREBUILT_LEGACY_DIR}/include/collada/1.4
)
if (WINDOWS) if (WINDOWS)
if(MSVC12) set(COLLADADOM_LIBRARIES
use_prebuilt_binary(pcre) debug libcollada14dom23-sd
use_prebuilt_binary(libxml) optimized libcollada14dom23-s
set(COLLADADOM_LIBRARIES )
debug libcollada14dom23-sd else(WINDOWS)
optimized libcollada14dom23-s set(COLLADADOM_LIBRARIES
libxml2_a debug collada14dom-d
debug pcrecppd optimized collada14dom
optimized pcrecpp minizip
debug pcred )
optimized pcre
${BOOST_SYSTEM_LIBRARIES}
)
else(MSVC12)
add_definitions(-DDOM_DYNAMIC)
set(COLLADADOM_LIBRARIES
debug libcollada14dom22-d
optimized libcollada14dom22
)
endif(MSVC12)
else (WINDOWS)
set(COLLADADOM_LIBRARIES
collada14dom
minizip
xml2
)
endif (WINDOWS) endif (WINDOWS)
endif (STANDALONE) endif (STANDALONE)

View File

@@ -0,0 +1,244 @@
# -*- cmake -*-
# The copy_win_libs folder contains file lists and a script used to
# copy dlls, exes and such needed to run the SecondLife from within
# VisualStudio.
include(CMakeCopyIfDifferent)
include(Linking)
###################################################################
# set up platform specific lists of files that need to be copied
###################################################################
if(WINDOWS)
set(SHARED_LIB_STAGING_DIR_DEBUG "${SHARED_LIB_STAGING_DIR}/Debug")
set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo")
set(SHARED_LIB_STAGING_DIR_RELEASE "${SHARED_LIB_STAGING_DIR}/Release")
#*******************************
# VIVOX - *NOTE: no debug version
set(vivox_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
set(vivox_files
SLVoice.exe
ca-bundle.crt
libsndfile-1.dll
vivoxplatform.dll
vivoxsdk.dll
ortp.dll
zlib1.dll
vivoxoal.dll
)
#*******************************
# Misc shared libs
set(debug_src_dir "${ARCH_PREBUILT_DIRS_DEBUG}")
set(debug_files
libapr-1.dll
libaprutil-1.dll
libapriconv-1.dll
ssleay32.dll
libeay32.dll
glod.dll
libhunspell.dll
)
set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
set(release_files
libapr-1.dll
libaprutil-1.dll
libapriconv-1.dll
ssleay32.dll
libeay32.dll
glod.dll
libhunspell.dll
)
if(USE_TCMALLOC)
set(debug_files ${debug_files} libtcmalloc_minimal-debug.dll)
set(release_files ${release_files} libtcmalloc_minimal.dll)
endif(USE_TCMALLOC)
if (FMODSTUDIO)
if(WORD_SIZE STREQUAL 64)
set(debug_files ${debug_files} fmodL64.dll)
set(release_files ${release_files} fmod64.dll)
else(WORD_SIZE STREQUAL 64)
set(debug_files ${debug_files} fmodL.dll)
set(release_files ${release_files} fmod.dll)
endif(WORD_SIZE STREQUAL 64)
endif (FMODSTUDIO)
elseif(DARWIN)
set(SHARED_LIB_STAGING_DIR_DEBUG "${SHARED_LIB_STAGING_DIR}/Debug/Resources")
set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO "${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/Resources")
set(SHARED_LIB_STAGING_DIR_RELEASE "${SHARED_LIB_STAGING_DIR}/Release/Resources")
set(vivox_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
set(vivox_files
SLVoice
ca-bundle.crt
libsndfile.dylib
libvivoxoal.dylib
libortp.dylib
libvivoxplatform.dylib
libvivoxsdk.dylib
)
set(debug_src_dir "${ARCH_PREBUILT_DIRS_DEBUG}")
set(debug_files
)
set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
set(release_files
libapr-1.0.dylib
libapr-1.dylib
libaprutil-1.0.dylib
libaprutil-1.dylib
libexception_handler.dylib
libexpat.1.5.2.dylib
libexpat.dylib
libGLOD.dylib
libhunspell-1.3.0.dylib
libndofdev.dylib
)
if (FMODSTUDIO)
set(debug_files ${debug_files} libfmodL.dylib)
set(release_files ${release_files} libfmod.dylib)
endif (FMODSTUDIO)
elseif(LINUX)
# linux is weird, multiple side by side configurations aren't supported
# and we don't seem to have any debug shared libs built yet anyways...
set(SHARED_LIB_STAGING_DIR_DEBUG "${SHARED_LIB_STAGING_DIR}")
set(SHARED_LIB_STAGING_DIR_RELWITHDEBINFO "${SHARED_LIB_STAGING_DIR}")
set(SHARED_LIB_STAGING_DIR_RELEASE "${SHARED_LIB_STAGING_DIR}")
set(vivox_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
set(vivox_files
libsndfile.so.1
libortp.so
libvivoxoal.so.1
libvivoxplatform.so
libvivoxsdk.so
SLVoice
# ca-bundle.crt #No cert for linux. It is actually still 3.2SDK.
)
# *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
# or ARCH_PREBUILT_DIRS
set(debug_src_dir "${ARCH_PREBUILT_DIRS_DEBUG}")
set(debug_files
)
# *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
# or ARCH_PREBUILT_DIRS
set(release_src_dir "${ARCH_PREBUILT_DIRS_RELEASE}")
# *FIX - figure out what to do with duplicate libalut.so here -brad
set(release_files
libapr-1.so.0
libaprutil-1.so.0
libatk-1.0.so
libdb-5.1.so
libexpat.so
libexpat.so.1
libfreetype.so.6.6.2
libfreetype.so.6
libGLOD.so
libgmodule-2.0.so
libgobject-2.0.so
libhunspell-1.3.so.0.0.0
libopenal.so
libopenjpeg.so
libuuid.so.16
libuuid.so.16.0.22
libfontconfig.so.1.8.0
libfontconfig.so.1
)
if (USE_TCMALLOC)
set(release_files ${release_files} "libtcmalloc_minimal.so")
endif (USE_TCMALLOC)
if (FMODSTUDIO)
set(debug_files ${debug_files} "libfmodL.so")
set(release_files ${release_files} "libfmod.so")
endif (FMODSTUDIO)
else(WINDOWS)
message(STATUS "WARNING: unrecognized platform for staging 3rd party libs, skipping...")
set(vivox_src_dir "${CMAKE_SOURCE_DIR}/newview/vivox-runtime/i686-linux")
set(vivox_files "")
# *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
# or ARCH_PREBUILT_DIRS
set(debug_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib/debug")
set(debug_files "")
# *TODO - update this to use LIBS_PREBUILT_DIR and LL_ARCH_DIR variables
# or ARCH_PREBUILT_DIRS
set(release_src_dir "${CMAKE_SOURCE_DIR}/../libraries/i686-linux/lib/release")
set(release_files "")
set(debug_llkdu_src "")
set(debug_llkdu_dst "")
set(release_llkdu_src "")
set(release_llkdu_dst "")
set(relwithdebinfo_llkdu_dst "")
endif(WINDOWS)
################################################################
# Done building the file lists, now set up the copy commands.
################################################################
copy_if_different(
${vivox_src_dir}
"${SHARED_LIB_STAGING_DIR_DEBUG}"
out_targets
${vivox_files}
)
set(third_party_targets ${third_party_targets} ${out_targets})
copy_if_different(
${vivox_src_dir}
"${SHARED_LIB_STAGING_DIR_RELEASE}"
out_targets
${vivox_files}
)
set(third_party_targets ${third_party_targets} ${out_targets})
copy_if_different(
${vivox_src_dir}
"${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}"
out_targets
${vivox_files}
)
set(third_party_targets ${third_party_targets} ${out_targets})
copy_if_different(
${debug_src_dir}
"${SHARED_LIB_STAGING_DIR_DEBUG}"
out_targets
${debug_files}
)
set(third_party_targets ${third_party_targets} ${out_targets})
copy_if_different(
${release_src_dir}
"${SHARED_LIB_STAGING_DIR_RELEASE}"
out_targets
${release_files}
)
set(third_party_targets ${third_party_targets} ${out_targets})
copy_if_different(
${release_src_dir}
"${SHARED_LIB_STAGING_DIR_RELWITHDEBINFO}"
out_targets
${release_files}
)
set(third_party_targets ${third_party_targets} ${out_targets})
if(NOT USESYSTEMLIBS)
add_custom_target(
stage_third_party_libs ALL
DEPENDS ${third_party_targets}
)
endif(NOT USESYSTEMLIBS)

View File

@@ -1,16 +0,0 @@
# -*- cmake -*-
# Copies a binary back to the source directory
MACRO(COPY_BACK_TO_SOURCE target)
SET(FROM $<TARGET_FILE:${target}>)
SET(TO ${CMAKE_CURRENT_SOURCE_DIR})
#MESSAGE("TARGET ${target} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy ${FROM} ${TO}")
ADD_CUSTOM_COMMAND(
TARGET ${target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${FROM} ${TO}
DEPENDS ${FROM}
COMMENT "Copying ${target} to ${CMAKE_CURRENT_BINARY_DIR}"
)
ENDMACRO(COPY_BACK_TO_SOURCE)

View File

@@ -1,181 +0,0 @@
# -*- cmake -*-
# The copy_win_libs folder contains file lists and a script used to
# copy dlls, exes and such needed to run the SecondLife from within
# VisualStudio.
set(LIBS_PREBUILT_DIR "@LIBS_PREBUILT_DIR@")
set(LIBS_PREBUILT_LEGACY_DIR "@LIBS_PREBUILT_LEGACY_DIR@")
set(MSVC10 "@MSVC10@")
set(WORD_SIZE "@WORD_SIZE@")
set(LIBS_RELEASE_DIR
${LIBS_PREBUILT_DIR}/lib/release
${LIBS_PREBUILT_LEGACY_DIR}/lib/release
)
set(LIBS_DEBUG_DIR
${LIBS_PREBUILT_DIR}/lib/debug
${LIBS_PREBUILT_LEGACY_DIR}/lib/debug
)
function(copy_files paths names dest)
string(FIND ${dest} ${CUR_CONFIG} idx)
if(${idx} LESS 0)
return()
endif(${idx} LESS 0)
foreach(f ${names})
foreach(p ${paths})
set(from_file "${p}/${f}")
set(to_dest "${CMAKE_BINARY_DIR}/newview/${dest}/")
if(EXISTS ${from_file})
message("Copying ${from_file} to ${to_dest}")
if(NOT EXISTS ${to_dest})
execute_process(COMMAND md "${to_dest}")
endif(NOT EXISTS ${to_dest})
execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${from_file}" "${to_dest}${f}" RESULT_VARIABLE result)
if(${result})
message(SEND_ERROR "Unsuccessful.")
endif(${result})
set(found 1)
break()
endif(EXISTS ${from_file})
endforeach(p)
if(NOT found)
message(SEND_ERROR "Failed to find library: ${f}")
endif(NOT found)
endforeach(f)
endfunction(copy_files)
set(vivox_files
ca-bundle.crt
libsndfile-1.dll
ortp.dll
SLVoice.exe
vivoxoal.dll
vivoxplatform.dll
vivoxsdk.dll
zlib1.dll
)
copy_files("${LIBS_RELEASE_DIR}" "${vivox_files}" "Release" )
copy_files("${LIBS_RELEASE_DIR}" "${vivox_files}" "RelWithDebInfo")
copy_files("${LIBS_DEBUG_DIR}" "${vivox_files}" "Debug")
set(release_files
libhunspell.dll
libapr-1.dll
libaprutil-1.dll
libapriconv-1.dll
libeay32.dll
ssleay32.dll
glod.dll
qtcore4.dll
)
copy_files("${LIBS_RELEASE_DIR}" "${release_files}" "Release")
copy_files("${LIBS_RELEASE_DIR}" "${release_files}" "RelWithDebInfo")
copy_files("${LIBS_DEBUG_DIR}" "${release_files}" "Debug")
if(MSVC10)
copy_files("${LIBS_DEBUG_DIR}" "libcollada14dom22-d.dll" "Debug")
endif(MSVC10)
if(WORD_SIZE EQUAL 32)
set(release_files
libcollada14dom22.dll
libtcmalloc_minimal.dll
)
copy_files("${LIBS_RELEASE_DIR}" "${release_files}" "Release")
copy_files("${LIBS_RELEASE_DIR}" "${release_files}" "RelWithDebInfo")
endif(WORD_SIZE EQUAL 32)
set(plugins_release_files
libeay32.dll
qtcore4.dll
qtgui4.dll
qtnetwork4.dll
qtopengl4.dll
qtwebkit4.dll
ssleay32.dll
qtxmlpatterns4.dll
)
copy_files("${LIBS_RELEASE_DIR}" "${plugins_release_files}" "Release/llplugin")
copy_files("${LIBS_RELEASE_DIR}" "${plugins_release_files}" "RelWithDebInfo/llplugin")
if(0)
copy_files("${LIBS_RELEASE_DIR}" "${plugin_release_files}" "../test_apps/llplugintest/Release")
copy_files("${LIBS_RELEASE_DIR}" "${plugin_release_files}" "../test_apps/llplugintest/RelWithDebInfo")
endif(0)
# Debug config runtime files required for the plugins
set(plugins_debug_files
libeay32.dll
qtcored4.dll
qtguid4.dll
qtnetworkd4.dll
qtopengld4.dll
qtwebkitd4.dll
ssleay32.dll
qtxmlpatternsd4.dll
)
copy_files("${LIBS_DEBUG_DIR}" "${plugins_debug_files}" "Debug/llplugin")
if(0)
copy_files("${LIBS_DEBUG_DIR}" "${plugins_debug_files}" "../test_apps/llplugintest/Debug")
endif(0)
# Release & ReleaseDebInfo config runtime files required for the plugin test mule (Qt image format plugins)
set(plugin_image_release_files
qgif4.dll
qico4.dll
qjpeg4.dll
qmng4.dll
qsvg4.dll
qtiff4.dll
)
copy_files("${LIBS_RELEASE_DIR}/imageformats" "${plugin_image_release_files}" "Release/llplugin/imageformats")
copy_files("${LIBS_RELEASE_DIR}/imageformats" "${plugin_image_release_files}" "RelWithDebInfo/llplugin/imageformats")
if(0)
copy_files("${LIBS_RELEASE_DIR}/imageformats" "${plugin_image_release_files}" "../test_apps/llplugintest/imageformats/Release")
copy_files("${LIBS_RELEASE_DIR}/imageformats" "${plugin_image_release_files}" "../test_apps/llplugintest/imageformats/RelWithDebInfo")
endif(0)
# Debug config runtime files required for the plugin test mule (Qt image format plugins)
set(plugin_image_debug_files
qgifd4.dll
qicod4.dll
qjpegd4.dll
qmngd4.dll
qsvgd4.dll
qtiffd4.dll
)
copy_files("${LIBS_DEBUG_DIR}/imageformats" "${plugin_image_debug_files}" "Debug/llplugin/imageformats")
if(0)
copy_files("${LIBS_DEBUG_DIR}/imageformats" "${plugin_image_debug_files}" "../test_apps/llplugintest/imageformats/Debug")
endif(0)
# Release & ReleaseDebInfo config runtime files required for the plugin test mule (Qt image format plugins)
set(plugin_codec_release_files
qcncodecs4.dll
qjpcodecs4.dll
qkrcodecs4.dll
qtwcodecs4.dll
)
copy_files("${LIBS_RELEASE_DIR}/codecs" "${plugin_codec_release_files}" "Release/llplugin/codecs")
copy_files("${LIBS_RELEASE_DIR}/codecs" "${plugin_codec_release_files}" "RelWithDebInfo/llplugin/codecs")
if(0)
copy_files("${LIBS_RELEASE_DIR}/codecs" "${plugin_codec_release_files}" "../test_apps/llplugintest/codecs/Release")
copy_files("${LIBS_RELEASE_DIR}/codecs" "${plugin_codec_release_files}" "../test_apps/llplugintest/codecs/RelWithDebInfo")
endif(0)
# Debug config runtime files required for the plugin test mule (Qt image format plugins)
set(plugin_codec_debug_files
qcncodecsd4.dll
qjpcodecsd4.dll
qkrcodecsd4.dll
qtwcodecsd4.dll
)
copy_files("${LIBS_DEBUG_DIR}/codecs" "${plugin_codec_debug_files}" "Debug/llplugin/codecs")
if(0)
copy_files("${LIBS_DEBUG_DIR}/codecs" "${plugin_codec_debug_files}" "../test_apps/llplugintest/codecs/Debug")
endif(0)

View File

@@ -0,0 +1,70 @@
# DeploySharedLibs.cmake
# This is a script to be run at build time! Its not part of the cmake configuration!
# See indra/cmake/LLSharedLibs.cmake for a macro that simplifies adding a command to a target to run this script.
# This script requires a few cmake variable to be set on the command line:
# BIN_NAME= The full path the the binary to search for dependecies.
# SEARCH_DIRS= The full paths to dirs to search for dependencies.
# DST_PATH= The full path where the dependecies will be copied.
get_filename_component(current_dir ${CMAKE_CURRENT_LIST_FILE} PATH)
include(GetPrerequisites)
message("Getting recursive dependencies for file: ${BIN_NAME}")
set(EXCLUDE_SYSTEM 1)
set(RECURSE 0)
get_filename_component(EXE_PATH ${BIN_NAME} PATH)
get_prerequisites( ${BIN_NAME} RESULTS ${EXCLUDE_SYSTEM} ${RECURSE} "${EXE_PATH}" "${SEARCH_DIRS}" )
foreach(DEP ${RESULTS})
Message("Processing dependency: ${DEP}")
get_filename_component(DEP_FILE ${DEP} NAME)
set(DEP_FILES ${DEP_FILES} ${DEP_FILE})
endforeach(DEP)
if(DEP_FILES)
list(REMOVE_DUPLICATES DEP_FILES)
endif(DEP_FILES)
foreach(DEP_FILE ${DEP_FILES})
if(FOUND_FILES)
list(FIND FOUND_FILES ${DEP_FILE} FOUND)
else(FOUND_FILES)
set(FOUND -1)
endif(FOUND_FILES)
if(FOUND EQUAL -1)
find_path(DEP_PATH ${DEP_FILE} PATHS ${SEARCH_DIRS} NO_DEFAULT_PATH)
if(DEP_PATH)
set(FOUND_FILES ${FOUND_FILES} "${DEP_PATH}/${DEP_FILE}")
set(DEP_PATH NOTFOUND) #reset DEP_PATH for the next find_path call.
else(DEP_PATH)
set(MISSING_FILES ${MISSING_FILES} ${DEP_FILE})
endif(DEP_PATH)
endif(FOUND EQUAL -1)
endforeach(DEP_FILE)
if(MISSING_FILES)
message("Missing:")
foreach(FILE ${MISSING_FILES})
message(" ${FILE}")
endforeach(FILE)
message("Searched in:")
foreach(SEARCH_DIR ${SEARCH_DIRS})
message(" ${SEARCH_DIR}")
endforeach(SEARCH_DIR)
message(FATAL_ERROR "Failed")
endif(MISSING_FILES)
if(FOUND_FILES)
foreach(FILE ${FOUND_FILES})
get_filename_component(DST_FILE ${FILE} NAME)
set(DST_FILE "${DST_PATH}/${DST_FILE}")
message("Copying ${FILE} to ${DST_FILE}")
execute_process(
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${FILE} ${DST_FILE}
)
endforeach(FILE ${FOUND_FILES})
endif(FOUND_FILES)
message("Success!")

View File

@@ -1,82 +0,0 @@
# -*- cmake -*-
include(Variables)
if (WINDOWS)
if (WORD_SIZE EQUAL 32)
set (DIRECTX_ARCHITECTURE x86)
elseif (WORD_SIZE EQUAL 64)
set (DIRECTX_ARCHITECTURE x64)
else (WORD_SIZE EQUAL 32)
set (DIRECTX_ARCHITECTURE x86)
endif (WORD_SIZE EQUAL 32)
SET(program_files $ENV{ProgramW6432})
if(NOT program_files)
SET(program_files $ENV{ProgramFiles})
endif(NOT program_files)
SET(program_files_x86 "ProgramFiles(x86)")
SET(program_files_x86 $ENV{${program_files_x86}})
find_path(DIRECTX_ROOT_DIR Include/dxdiag.h
PATHS
"$ENV{DXSDK_DIR}"
"${program_files}/Microsoft DirectX SDK (June 2010)"
"${program_files_x86}/Microsoft DirectX SDK (June 2010)"
"${program_files}/Microsoft DirectX SDK (February 2010)"
"${program_files_x86}/Microsoft DirectX SDK (February 2010)"
"${program_files}/Microsoft DirectX SDK (March 2009)"
"${program_files_x86}/Microsoft DirectX SDK (March 2009)"
"${program_files}/Microsoft DirectX SDK (August 2008)"
"${program_files_x86}/Microsoft DirectX SDK (August 2008)"
"${program_files}/Microsoft DirectX SDK (June 2008)"
"${program_files_x86}/Microsoft DirectX SDK (June 2008)"
"${program_files}/Microsoft DirectX SDK (March 2008)"
"${program_files_x86}/Microsoft DirectX SDK (March 2008)"
"${program_files}/Microsoft DirectX SDK (November 2007)"
"${program_files_x86}/Microsoft DirectX SDK (November 2007)"
"${program_files}/Microsoft DirectX SDK (August 2007)"
"${program_files_x86}/Microsoft DirectX SDK (August 2007)"
)
if (DIRECTX_ROOT_DIR)
set (DIRECTX_INCLUDE_DIR "${DIRECTX_ROOT_DIR}/Include")
set (DIRECTX_LIBRARY_DIR "${DIRECTX_ROOT_DIR}/Lib/${DIRECTX_ARCHITECTURE}")
else (DIRECTX_ROOT_DIR)
find_path (WIN_KIT_ROOT_DIR Include/um/windows.h
PATHS
"${program_files}/Windows Kits/8.1"
"${program_files_x86}/Windows Kits/8.1"
"${program_files}/Windows Kits/8.0"
"${program_files_x86}/Windows Kits/8.0"
)
find_path (WIN_KIT_LIB_DIR dxguid.lib
"${WIN_KIT_ROOT_DIR}/Lib/winv6.3/um/${DIRECTX_ARCHITECTURE}"
"${WIN_KIT_ROOT_DIR}/Lib/Win8/um/${DIRECTX_ARCHITECTURE}"
)
if (WIN_KIT_ROOT_DIR AND WIN_KIT_LIB_DIR)
set (DIRECTX_INCLUDE_DIR "${WIN_KIT_ROOT_DIR}/Include/um" "${WIN_KIT_ROOT_DIR}/Include/shared")
set (DIRECTX_LIBRARY_DIR "${WIN_KIT_LIB_DIR}")
endif (WIN_KIT_ROOT_DIR AND WIN_KIT_LIB_DIR)
endif (DIRECTX_ROOT_DIR)
if (DIRECTX_INCLUDE_DIR)
include_directories(${DIRECTX_INCLUDE_DIR})
if (DIRECTX_FIND_QUIETLY)
message(STATUS "Found DirectX include: ${DIRECTX_INCLUDE_DIR}")
endif (DIRECTX_FIND_QUIETLY)
else (DIRECTX_INCLUDE_DIR)
message(FATAL_ERROR "Could not find DirectX SDK Include")
endif (DIRECTX_INCLUDE_DIR)
if (DIRECTX_LIBRARY_DIR)
if (DIRECTX_FIND_QUIETLY)
message(STATUS "Found DirectX include: ${DIRECTX_LIBRARY_DIR}")
endif (DIRECTX_FIND_QUIETLY)
else (DIRECTX_LIBRARY_DIR)
message(FATAL_ERROR "Could not find DirectX SDK Libraries")
endif (DIRECTX_LIBRARY_DIR)
endif (WINDOWS)

View File

@@ -1,45 +0,0 @@
# This script drives download of prebuilt packages during the build.
# The top-level CMakeLists.txt configures packages and tool locations.
set(packages "@PREBUILT_PACKAGES@")
set(python "@PYTHON_EXECUTABLE@")
set(install_dir "@CMAKE_BINARY_DIR@/packages")
set(scp "@SCP_EXECUTABLE@")
set(scripts_dir "@SCRIPTS_DIR@")
set(sentinel_dir "@CMAKE_BINARY_DIR@/prepare")
set(prebuilt_type "@PREBUILT_TYPE@")
# In proprietary mode we use scp for download.
set(proprietary "@INSTALL_PROPRIETARY@")
if(proprietary)
set(scp_option "--scp=${scp}")
set(proprietary_message " proprietary")
endif(proprietary)
foreach(package ${packages})
if(${install_dir}/install.xml IS_NEWER_THAN ${sentinel_dir}/${package}_installed)
# This package is missing or out of date.
message(STATUS "Obtaining${proprietary_message} prebuilt '${package}'")
execute_process(
COMMAND ${python} install.py -p${prebuilt_type} --install-dir=${install_dir} --installed-manifest=${install_dir}/installed.xml ${scp_option} ${package}
WORKING_DIRECTORY ${scripts_dir}
RESULT_VARIABLE result
)
if(result STREQUAL 0)
# Write a sentinel to avoid attempting a download again.
file(WRITE ${sentinel_dir}/${package}_installed "Obtained '${package}'")
else(result STREQUAL 0)
# Remove the sentinel to ensure a download is attempted again.
file(REMOVE ${sentinel_dir}/prebuilt
${sentinel_dir}/${package}_installed)
message(FATAL_ERROR
"Failed to download or unpack prebuilt '${package}'. "
"Process returned: ${result}")
endif(result STREQUAL 0)
else(${install_dir}/install.xml IS_NEWER_THAN ${sentinel_dir}/${package}_installed)
# This package is ready.
message(STATUS "Prebuilt '${package}' is up-to-date")
endif(${install_dir}/install.xml IS_NEWER_THAN ${sentinel_dir}/${package}_installed)
endforeach(package)
# Store a sentinel to avoid running this script unnecessarily.
file(WRITE ${sentinel_dir}/prebuilt "All prebuilts obtained successfully\n")

View File

@@ -9,16 +9,9 @@ if (STANDALONE)
else (STANDALONE) else (STANDALONE)
use_prebuilt_binary(expat) use_prebuilt_binary(expat)
if (WINDOWS) if (WINDOWS)
if (MSVC12) set(EXPAT_LIBRARIES expat)
set(EXPAT_LIBRARIES expat)
else (MSVC12)
set(EXPAT_LIBRARIES libexpatMT)
endif (MSVC12)
else (WINDOWS) else (WINDOWS)
set(EXPAT_LIBRARIES expat) set(EXPAT_LIBRARIES expat)
endif (WINDOWS) endif (WINDOWS)
set(EXPAT_INCLUDE_DIRS set(EXPAT_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
${LIBS_PREBUILT_DIR}/include
${LIBS_PREBUILT_LEGACY_DIR}/include
)
endif (STANDALONE) endif (STANDALONE)

View File

@@ -0,0 +1,43 @@
# -*- cmake -*-
#
# Find the autobuild tool
#
# Output variables:
#
# AUTOBUILD_EXECUTABLE - path to autobuild executable
IF (NOT AUTOBUILD_EXECUTABLE)
# If cmake was executed by autobuild, autobuild will have set the AUTOBUILD env var
IF (DEFINED ENV{AUTOBUILD})
SET(AUTOBUILD_EXECUTABLE $ENV{AUTOBUILD})
ELSE (DEFINED ENV{AUTOBUILD})
IF(WIN32)
SET(AUTOBUILD_EXE_NAMES autobuild.exe autobuild.cmd)
ELSE(WIN32)
SET(AUTOBUILD_EXE_NAMES autobuild)
ENDIF(WIN32)
SET(AUTOBUILD_EXECUTABLE)
FIND_PROGRAM(
AUTOBUILD_EXECUTABLE
NAMES ${AUTOBUILD_EXE_NAMES}
PATHS
ENV PATH
${CMAKE_SOURCE_DIR}/..
${CMAKE_SOURCE_DIR}/../..
${CMAKE_SOURCE_DIR}/../../..
PATH_SUFFIXES "/autobuild/bin/"
)
ENDIF (DEFINED ENV{AUTOBUILD})
IF (NOT AUTOBUILD_EXECUTABLE)
IF (AUTOBUILD_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find autobuild executable")
ENDIF (AUTOBUILD_FIND_REQUIRED)
ENDIF (NOT AUTOBUILD_EXECUTABLE)
MARK_AS_ADVANCED(AUTOBUILD_EXECUTABLE)
ENDIF (NOT AUTOBUILD_EXECUTABLE)

View File

@@ -7,18 +7,7 @@ if (STANDALONE)
pkg_check_modules(FREETYPE REQUIRED freetype2) pkg_check_modules(FREETYPE REQUIRED freetype2)
else (STANDALONE) else (STANDALONE)
use_prebuilt_binary(freetype) use_prebuilt_binary(freetype)
if(MSVC12) set(FREETYPE_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include/freetype2)
set(FREETYPE_INCLUDE_DIRS
${LIBS_PREBUILT_DIR}/include/freetype2
${LIBS_PREBUILT_LEGACY_DIR}/include/freetype2
)
else(MSVC12)
set(FREETYPE_INCLUDE_DIRS
${LIBS_PREBUILT_DIR}/include
${LIBS_PREBUILT_LEGACY_DIR}/include
)
endif (MSVC12)
set(FREETYPE_LIBRARIES freetype) set(FREETYPE_LIBRARIES freetype)
endif (STANDALONE) endif (STANDALONE)

View File

@@ -7,10 +7,8 @@ set(GLOD_FIND_REQUIRED ON)
if (STANDALONE) if (STANDALONE)
include(FindGLOD) include(FindGLOD)
else (STANDALONE) else (STANDALONE)
use_prebuilt_binary(GLOD) use_prebuilt_binary(glod)
set(GLOD_INCLUDE_DIRS
${LIBS_PREBUILT_DIR}/include set(GLOD_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
${LIBS_PREBUILT_LEGACY_DIR}/include set(GLOD_LIBRARIES GLOD)
)
set(GLOD_LIBRARIES glod)
endif (STANDALONE) endif (STANDALONE)

View File

@@ -4,16 +4,12 @@ include(Prebuilt)
if (STANDALONE) if (STANDALONE)
include(FindHunSpell) include(FindHunSpell)
else (STANDALONE) else (STANDALONE)
use_prebuilt_binary(hunspell) use_prebuilt_binary(libhunspell)
set(HUNSPELL_INCLUDE_DIR if (LINUX OR DARWIN)
${LIBS_PREBUILT_DIR}/include/hunspell set(HUNSPELL_LIBRARY hunspell-1.3)
${LIBS_PREBUILT_LEGACY_DIR}/include/hunspell else (LINUX OR DARWIN)
) set(HUNSPELL_LIBRARY libhunspell)
endif (LINUX OR DARWIN)
if (LINUX OR DARWIN) set(HUNSPELL_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/hunspell )
set(HUNSPELL_LIBRARY hunspell-1.3)
else (LINUX OR DARWIN)
set(HUNSPELL_LIBRARY libhunspell)
endif (LINUX OR DARWIN)
endif (STANDALONE) endif (STANDALONE)

View File

@@ -19,8 +19,5 @@ else (STANDALONE)
elseif (WINDOWS) elseif (WINDOWS)
set(JPEG_LIBRARIES jpeglib) set(JPEG_LIBRARIES jpeglib)
endif (LINUX) endif (LINUX)
set(JPEG_INCLUDE_DIRS set(JPEG_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
${LIBS_PREBUILT_DIR}/include
${LIBS_PREBUILT_LEGACY_DIR}/include
)
endif (STANDALONE) endif (STANDALONE)

View File

@@ -10,22 +10,13 @@ if (STANDALONE)
else (STANDALONE) else (STANDALONE)
use_prebuilt_binary(jsoncpp) use_prebuilt_binary(jsoncpp)
if (WINDOWS) if (WINDOWS)
if(MSVC12) set(JSONCPP_LIBRARIES
set(JSONCPP_LIBRARIES debug jsoncppd.lib
debug json_vc${MSVC_SUFFIX}debug_libmt.lib optimized jsoncpp.lib)
optimized json_vc${MSVC_SUFFIX}_libmt)
else(MSVC12)
set(JSONCPP_LIBRARIES
debug json_vc${MSVC_SUFFIX}d
optimized json_vc${MSVC_SUFFIX})
endif(MSVC12)
elseif (DARWIN) elseif (DARWIN)
set(JSONCPP_LIBRARIES json_linux-gcc-4.0.1_libmt) set(JSONCPP_LIBRARIES json_linux-gcc-4.0.1_libmt)
elseif (LINUX) elseif (LINUX)
set(JSONCPP_LIBRARIES jsoncpp) set(JSONCPP_LIBRARIES jsoncpp)
endif (WINDOWS) endif (WINDOWS)
set(JSONCPP_INCLUDE_DIR set(JSONCPP_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include/jsoncpp)
${LIBS_PREBUILT_DIR}/include/jsoncpp
${LIBS_PREBUILT_LEGACY_DIR}/include/jsoncpp
)
endif (STANDALONE) endif (STANDALONE)

View File

@@ -1,6 +1,7 @@
# -*- cmake -*- # -*- cmake -*-
include(Audio) include(Audio)
include(OPENAL)
set(LLAUDIO_INCLUDE_DIRS set(LLAUDIO_INCLUDE_DIRS
${LIBS_OPEN_DIR}/llaudio ${LIBS_OPEN_DIR}/llaudio

View File

@@ -1,18 +1,25 @@
# -*- cmake -*- # -*- cmake -*-
# these should be moved to their own cmake file
include(Prebuilt)
include(Boost)
include(Colladadom) include(Colladadom)
use_prebuilt_binary(libxml2)
set(LLPRIMITIVE_INCLUDE_DIRS set(LLPRIMITIVE_INCLUDE_DIRS
${LIBS_OPEN_DIR}/llprimitive ${LIBS_OPEN_DIR}/llprimitive
${COLLADADOM_INCLUDE_DIRS} ${COLLADADOM_INCLUDE_DIRS}
) )
if (WINDOWS) if (WINDOWS)
set(LLPRIMITIVE_LIBRARIES set(LLPRIMITIVE_LIBRARIES
debug llprimitive llprimitive
optimized llprimitive ${COLLADADOM_LIBRARIES}
${COLLADADOM_LIBRARIES} libxml2_a
) ${BOOST_SYSTEM_LIBRARIES}
)
else (WINDOWS) else (WINDOWS)
set(LLPRIMITIVE_LIBRARIES set(LLPRIMITIVE_LIBRARIES
llprimitive llprimitive

View File

@@ -1,13 +1,12 @@
# ll_deploy_sharedlibs_command # ll_deploy_sharedlibs_command
# target_exe: the cmake target of the executable for which the shared libs will be deployed. # target_exe: the cmake target of the executable for which the shared libs will be deployed.
macro(ll_deploy_sharedlibs_command target_exe) macro(ll_deploy_sharedlibs_command target_exe)
SET(OUTPUT_PATH $<TARGET_FILE:${target_exe}>) set(OUTPUT_PATH $<TARGET_FILE_DIR:${target_exe}>)
if(DARWIN) if(DARWIN)
SET_TEST_PATH(SEARCH_DIRS) SET_TEST_PATH(SEARCH_DIRS)
get_target_property(IS_BUNDLE ${target_exe} MACOSX_BUNDLE) get_target_property(IS_BUNDLE ${target_exe} MACOSX_BUNDLE)
if(IS_BUNDLE) if(IS_BUNDLE)
# If its a bundle the exe is not in the target location, this should find it.
set(OUTPUT_PATH ${OUTPUT_PATH}/../Resources) set(OUTPUT_PATH ${OUTPUT_PATH}/../Resources)
endif(IS_BUNDLE) endif(IS_BUNDLE)
elseif(WINDOWS) elseif(WINDOWS)
@@ -38,8 +37,7 @@ macro(ll_stage_sharedlib DSO_TARGET)
# Also this directory is shared with RunBuildTest.cmake, y'know, for the tests. # Also this directory is shared with RunBuildTest.cmake, y'know, for the tests.
set_target_properties(${DSO_TARGET} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${SHARED_LIB_STAGING_DIR}) set_target_properties(${DSO_TARGET} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${SHARED_LIB_STAGING_DIR})
if(NOT WINDOWS) if(NOT WINDOWS)
get_target_property(DSO_PATH ${DSO_TARGET} LOCATION)
SET(DSO_PATH $<TARGET_FILE:${DSO_TARGET}>)
get_filename_component(DSO_FILE ${DSO_PATH} NAME) get_filename_component(DSO_FILE ${DSO_PATH} NAME)
if(DARWIN) if(DARWIN)
set(SHARED_LIB_STAGING_DIR_CONFIG ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources) set(SHARED_LIB_STAGING_DIR_CONFIG ${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/Resources)

View File

@@ -1,42 +1,50 @@
# -*- cmake -*- # -*- cmake -*-
if(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED) if(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)
set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES") set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES")
include(Variables) include(Variables)
if (NOT STANDALONE) set(ARCH_PREBUILT_DIRS ${AUTOBUILD_INSTALL_DIR}/lib)
set(ARCH_PREBUILT_DIRS_PLUGINS ${AUTOBUILD_INSTALL_DIR}/plugins)
set(ARCH_PREBUILT_DIRS_RELEASE ${AUTOBUILD_INSTALL_DIR}/lib/release)
set(ARCH_PREBUILT_DIRS_DEBUG ${AUTOBUILD_INSTALL_DIR}/lib/debug)
if (WINDOWS)
set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs)
set(EXE_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs)
elseif (LINUX)
set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs/lib)
set(EXE_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs/bin)
elseif (DARWIN)
set(SHARED_LIB_STAGING_DIR ${CMAKE_BINARY_DIR}/sharedlibs)
set(EXE_STAGING_DIR "${CMAKE_BINARY_DIR}/sharedlibs")
endif (WINDOWS)
if(CMAKE_BUILD_TYPE) # Autobuild packages must provide 'release' versions of libraries, but may provide versions for
string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_LOWER) # specific build types. AUTOBUILD_LIBS_INSTALL_DIRS lists first the build type directory and then
endif(CMAKE_BUILD_TYPE) # the 'release' directory (as a default fallback).
# *NOTE - we have to take special care to use CMAKE_CFG_INTDIR on IDE generators (like mac and
# windows) and CMAKE_BUILD_TYPE on Makefile based generators (like linux). The reason for this is
# that CMAKE_BUILD_TYPE is essentially meaningless at configuration time for IDE generators and
# CMAKE_CFG_INTDIR is meaningless at build time for Makefile generators
if(WINDOWS OR DARWIN)
# the cmake xcode and VS generators implicitly append ${CMAKE_CFG_INTDIR} to the library paths for us
# fortunately both windows and darwin are case insensitive filesystems so this works.
set(AUTOBUILD_LIBS_INSTALL_DIRS "${AUTOBUILD_INSTALL_DIR}/lib/")
else(WINDOWS OR DARWIN)
# else block is for linux and any other makefile based generators
string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_LOWER)
set(AUTOBUILD_LIBS_INSTALL_DIRS ${AUTOBUILD_INSTALL_DIR}/lib/${CMAKE_BUILD_TYPE_LOWER})
endif(WINDOWS OR DARWIN)
if(WINDOWS OR ${CMAKE_GENERATOR} MATCHES "Xcode") if (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Release")
# the cmake xcode and VS generators implicitly append ${CMAKE_CFG_INTDIR} to the library paths for us # When we're building something other than Release, append the
# fortunately both windows and darwin are case insensitive filesystems so this works. # packages/lib/release directory to deal with autobuild packages that don't
set(ARCH_PREBUILT_LINK_DIRS # provide (e.g.) lib/debug libraries.
${LIBS_PREBUILT_DIR}/lib list(APPEND AUTOBUILD_LIBS_INSTALL_DIRS ${ARCH_PREBUILT_DIRS_RELEASE})
${LIBS_PREBUILT_LEGACY_DIR}/lib endif (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Release")
)
else(WINDOWS OR ${CMAKE_GENERATOR} MATCHES "Xcode")
# else block is for linux and any other makefile based generators
set(ARCH_PREBUILT_LINK_DIRS
${LIBS_PREBUILT_DIR}/lib/${CMAKE_BUILD_TYPE_LOWER}
${LIBS_PREBUILT_LEGACY_DIR}/lib/${CMAKE_BUILD_TYPE_LOWER}
)
endif(WINDOWS OR ${CMAKE_GENERATOR} MATCHES "Xcode")
if (NOT "${CMAKE_BUILD_TYPE_LOWER}" STREQUAL "release") link_directories(${AUTOBUILD_LIBS_INSTALL_DIRS})
# When we're building something other than Release, append the
# packages/lib/release directory to deal with autobuild packages that don't
# provide (e.g.) lib/debug libraries.
list(APPEND ARCH_PREBUILT_LINK_DIRS
${LIBS_PREBUILT_DIR}/lib/release
${LIBS_PREBUILT_LEGACY_DIR}/lib/release
)
endif (NOT "${CMAKE_BUILD_TYPE_LOWER}" STREQUAL "release")
endif (NOT STANDALONE)
link_directories(${ARCH_PREBUILT_LINK_DIRS})
if (LINUX) if (LINUX)
set(DL_LIBRARY dl) set(DL_LIBRARY dl)
@@ -50,6 +58,7 @@ if (WINDOWS)
set(WINDOWS_LIBRARIES set(WINDOWS_LIBRARIES
advapi32 advapi32
shell32 shell32
ole32
ws2_32 ws2_32
mswsock mswsock
psapi psapi

View File

@@ -7,7 +7,11 @@ if (STANDALONE)
message(STATUS "Building without N-DoF joystick support") message(STATUS "Building without N-DoF joystick support")
endif(NOT NDOF_FOUND) endif(NOT NDOF_FOUND)
else (STANDALONE) else (STANDALONE)
use_prebuilt_binary(ndofdev) if (WINDOWS OR DARWIN)
use_prebuilt_binary(libndofdev)
elseif (LINUX)
use_prebuilt_binary(open-libndofdev)
endif (WINDOWS OR DARWIN)
if (WINDOWS) if (WINDOWS)
set(NDOF_LIBRARY libndofdev) set(NDOF_LIBRARY libndofdev)
@@ -15,10 +19,7 @@ else (STANDALONE)
set(NDOF_LIBRARY ndofdev) set(NDOF_LIBRARY ndofdev)
endif (WINDOWS) endif (WINDOWS)
set(NDOF_INCLUDE_DIR set(NDOF_INCLUDE_DIR ${ARCH_PREBUILT_DIRS}/include/ndofdev)
${LIBS_PREBUILT_DIR}/include/ndofdev
${LIBS_PREBUILT_LEGACY_DIR}/include/ndofdev
)
set(NDOF_FOUND 1) set(NDOF_FOUND 1)
endif (STANDALONE) endif (STANDALONE)
@@ -26,6 +27,8 @@ if (NDOF_FOUND)
add_definitions(-DLIB_NDOF=1) add_definitions(-DLIB_NDOF=1)
include_directories(${NDOF_INCLUDE_DIR}) include_directories(${NDOF_INCLUDE_DIR})
else (NDOF_FOUND) else (NDOF_FOUND)
message(STATUS "Building without N-DoF joystick support")
set(NDOF_INCLUDE_DIR "") set(NDOF_INCLUDE_DIR "")
set(NDOF_LIBRARY "") set(NDOF_LIBRARY "")
endif (NDOF_FOUND) endif (NDOF_FOUND)

View File

@@ -7,16 +7,13 @@ set(OpenSSL_FIND_REQUIRED ON)
if (STANDALONE OR USE_SYSTEM_OPENSSL) if (STANDALONE OR USE_SYSTEM_OPENSSL)
include(FindOpenSSL) include(FindOpenSSL)
else (STANDALONE OR USE_SYSTEM_OPENSSL) else (STANDALONE OR USE_SYSTEM_OPENSSL)
use_prebuilt_binary(openSSL) use_prebuilt_binary(openssl)
if (WINDOWS) if (WINDOWS)
set(OPENSSL_LIBRARIES ssleay32 libeay32) set(OPENSSL_LIBRARIES ssleay32 libeay32)
else (WINDOWS) else (WINDOWS)
set(OPENSSL_LIBRARIES ssl) set(OPENSSL_LIBRARIES ssl)
endif (WINDOWS) endif (WINDOWS)
set(OPENSSL_INCLUDE_DIRS set(OPENSSL_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
${LIBS_PREBUILT_DIR}/include
${LIBS_PREBUILT_LEGACY_DIR}/include
)
endif (STANDALONE OR USE_SYSTEM_OPENSSL) endif (STANDALONE OR USE_SYSTEM_OPENSSL)
if (LINUX) if (LINUX)

View File

@@ -9,11 +9,7 @@ if (STANDALONE)
else (STANDALONE) else (STANDALONE)
use_prebuilt_binary(libpng) use_prebuilt_binary(libpng)
if (WINDOWS) if (WINDOWS)
if(MSVC12) set(PNG_LIBRARIES libpng16)
set(PNG_LIBRARIES libpng16)
else(MSVC12)
set(PNG_LIBRARIES libpng15)
endif(MSVC12)
elseif(DARWIN) elseif(DARWIN)
set(PNG_LIBRARIES png15) set(PNG_LIBRARIES png15)
else(LINUX) else(LINUX)

View File

@@ -3,14 +3,64 @@
if(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED) if(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)
set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES") set(${CMAKE_CURRENT_LIST_FILE}_INCLUDED "YES")
include(FindAutobuild)
include(Variables)
if(INSTALL_PROPRIETARY)
include(FindSCP)
endif(INSTALL_PROPRIETARY)
set(PREBUILD_TRACKING_DIR ${AUTOBUILD_INSTALL_DIR}/cmake_tracking)
# For the library installation process;
# see cmake/Prebuild.cmake for the counterpart code.
if ("${CMAKE_SOURCE_DIR}/../autobuild.xml" IS_NEWER_THAN "${PREBUILD_TRACKING_DIR}/sentinel_installed")
file(MAKE_DIRECTORY ${PREBUILD_TRACKING_DIR})
file(WRITE ${PREBUILD_TRACKING_DIR}/sentinel_installed "0")
endif ("${CMAKE_SOURCE_DIR}/../autobuild.xml" IS_NEWER_THAN "${PREBUILD_TRACKING_DIR}/sentinel_installed")
# The use_prebuilt_binary macro handles automated installation of package
# dependencies using autobuild. The goal is that 'autobuild install' should
# only be run when we know we need to install a new package. This should be
# the case in a clean checkout, or if autobuild.xml has been updated since the
# last run (encapsulated by the file ${PREBUILD_TRACKING_DIR}/sentinel_installed),
# or if a previous attempt to install the package has failed (the exit status
# of previous attempts is serialized in the file
# ${PREBUILD_TRACKING_DIR}/${_binary}_installed)
macro (use_prebuilt_binary _binary) macro (use_prebuilt_binary _binary)
if(NOT STANDALONE) if (NOT DEFINED USESYSTEMLIBS_${_binary})
get_property(PREBUILT_PACKAGES TARGET prepare PROPERTY PREBUILT) set(USESYSTEMLIBS_${_binary} ${USESYSTEMLIBS})
list(FIND PREBUILT_PACKAGES ${_binary} _index) endif (NOT DEFINED USESYSTEMLIBS_${_binary})
if(_index LESS 0)
set_property(TARGET prepare APPEND PROPERTY PREBUILT ${_binary}) if (NOT USESYSTEMLIBS_${_binary})
endif(_index LESS 0) if("${${_binary}_installed}" STREQUAL "" AND EXISTS "${PREBUILD_TRACKING_DIR}/${_binary}_installed")
endif(NOT STANDALONE) file(READ ${PREBUILD_TRACKING_DIR}/${_binary}_installed "${_binary}_installed")
if(DEBUG_PREBUILT)
message(STATUS "${_binary}_installed: \"${${_binary}_installed}\"")
endif(DEBUG_PREBUILT)
endif("${${_binary}_installed}" STREQUAL "" AND EXISTS "${PREBUILD_TRACKING_DIR}/${_binary}_installed")
if(${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/${_binary}_installed OR NOT ${${_binary}_installed} EQUAL 0)
if(DEBUG_PREBUILT)
message("cd ${CMAKE_SOURCE_DIR} && ${AUTOBUILD_EXECUTABLE} install
--install-dir=${AUTOBUILD_INSTALL_DIR}
${_binary} ")
endif(DEBUG_PREBUILT)
execute_process(COMMAND "${AUTOBUILD_EXECUTABLE}"
install
--install-dir=${AUTOBUILD_INSTALL_DIR}
-p ${AUTOBUILD_PLATFORM_NAME}
${_binary}
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
RESULT_VARIABLE ${_binary}_installed
)
file(WRITE ${PREBUILD_TRACKING_DIR}/${_binary}_installed "${${_binary}_installed}")
endif(${PREBUILD_TRACKING_DIR}/sentinel_installed IS_NEWER_THAN ${PREBUILD_TRACKING_DIR}/${_binary}_installed OR NOT ${${_binary}_installed} EQUAL 0)
if(NOT ${_binary}_installed EQUAL 0)
message(FATAL_ERROR
"Failed to download or unpack prebuilt '${_binary}'."
" Process returned ${${_binary}_installed}.")
endif (NOT ${_binary}_installed EQUAL 0)
endif (NOT USESYSTEMLIBS_${_binary})
endmacro (use_prebuilt_binary _binary) endmacro (use_prebuilt_binary _binary)
endif(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED) endif(NOT DEFINED ${CMAKE_CURRENT_LIST_FILE}_INCLUDED)

View File

@@ -8,7 +8,7 @@ macro (check_message_template _target)
PRE_LINK PRE_LINK
COMMAND ${PYTHON_EXECUTABLE} COMMAND ${PYTHON_EXECUTABLE}
ARGS ${SCRIPTS_DIR}/template_verifier.py ARGS ${SCRIPTS_DIR}/template_verifier.py
--mode=development --cache_master --mode=development --cache_master --master_url=${TEMPLATE_VERIFIER_MASTER_URL} ${TEMPLATE_VERIFIER_OPTIONS}
COMMENT "Verifying message template" COMMENT "Verifying message template - See http://wiki.secondlife.com/wiki/Template_verifier.py"
) )
endmacro (check_message_template) endmacro (check_message_template)

View File

@@ -23,26 +23,59 @@ set(LIBS_CLOSED_PREFIX)
set(LIBS_OPEN_PREFIX) set(LIBS_OPEN_PREFIX)
set(SCRIPTS_PREFIX ../scripts) set(SCRIPTS_PREFIX ../scripts)
set(VIEWER_PREFIX) set(VIEWER_PREFIX)
set(INTEGRATION_TESTS_PREFIX)
set(LIBS_CLOSED_DIR ${CMAKE_SOURCE_DIR}/${LIBS_CLOSED_PREFIX})
set(LIBS_OPEN_DIR ${CMAKE_SOURCE_DIR}/${LIBS_OPEN_PREFIX})
set(SCRIPTS_DIR ${CMAKE_SOURCE_DIR}/${SCRIPTS_PREFIX})
set(VIEWER_DIR ${CMAKE_SOURCE_DIR}/${VIEWER_PREFIX})
set(DISABLE_TCMALLOC OFF CACHE BOOL "Disable linkage of TCMalloc. (64bit builds automatically disable TCMalloc)") set(DISABLE_TCMALLOC OFF CACHE BOOL "Disable linkage of TCMalloc. (64bit builds automatically disable TCMalloc)")
set(LL_TESTS OFF CACHE BOOL "Build and run unit and integration tests (disable for build timing runs to reduce variation)") set(LL_TESTS OFF CACHE BOOL "Build and run unit and integration tests (disable for build timing runs to reduce variation)")
set(DISABLE_FATAL_WARNINGS TRUE CACHE BOOL "Set this to FALSE to enable fatal warnings.") set(DISABLE_FATAL_WARNINGS TRUE CACHE BOOL "Set this to FALSE to enable fatal warnings.")
if(LIBS_CLOSED_DIR)
file(TO_CMAKE_PATH "${LIBS_CLOSED_DIR}" LIBS_CLOSED_DIR)
else(LIBS_CLOSED_DIR)
set(LIBS_CLOSED_DIR ${CMAKE_SOURCE_DIR}/${LIBS_CLOSED_PREFIX})
endif(LIBS_CLOSED_DIR)
if(LIBS_COMMON_DIR)
file(TO_CMAKE_PATH "${LIBS_COMMON_DIR}" LIBS_COMMON_DIR)
else(LIBS_COMMON_DIR)
set(LIBS_COMMON_DIR ${CMAKE_SOURCE_DIR}/${LIBS_OPEN_PREFIX})
endif(LIBS_COMMON_DIR)
set(LIBS_OPEN_DIR ${LIBS_COMMON_DIR})
set(SCRIPTS_DIR ${CMAKE_SOURCE_DIR}/${SCRIPTS_PREFIX})
set(VIEWER_DIR ${CMAKE_SOURCE_DIR}/${VIEWER_PREFIX})
set(AUTOBUILD_INSTALL_DIR ${CMAKE_BINARY_DIR}/packages)
set(LIBS_PREBUILT_DIR ${AUTOBUILD_INSTALL_DIR} CACHE PATH
"Location of prebuilt libraries.")
if (EXISTS ${CMAKE_SOURCE_DIR}/Server.cmake)
# We use this as a marker that you can try to use the proprietary libraries.
set(INSTALL_PROPRIETARY ON CACHE BOOL "Install proprietary binaries")
endif (EXISTS ${CMAKE_SOURCE_DIR}/Server.cmake)
set(TEMPLATE_VERIFIER_OPTIONS "" CACHE STRING "Options for scripts/template_verifier.py")
set(TEMPLATE_VERIFIER_MASTER_URL "http://bitbucket.org/lindenlab/master-message-template/raw/tip/message_template.msg" CACHE STRING "Location of the master message template")
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
"Build type. One of: Debug Release RelWithDebInfo" FORCE)
endif (NOT CMAKE_BUILD_TYPE)
if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
set(WINDOWS ON BOOL FORCE) set(WINDOWS ON BOOL FORCE)
if (WORD_SIZE EQUAL 32) if (WORD_SIZE EQUAL 64)
set(ARCH i686) set(ARCH x86_64 CACHE STRING "Viewer Architecture")
set(LL_ARCH ${ARCH}_win64)
set(LL_ARCH_DIR ${ARCH}-win64)
set(WORD_SIZE 64)
set(AUTOBUILD_PLATFORM_NAME "windows64")
else (WORD_SIZE EQUAL 64)
set(ARCH i686 CACHE STRING "Viewer Architecture")
set(LL_ARCH ${ARCH}_win32) set(LL_ARCH ${ARCH}_win32)
set(LL_ARCH_DIR ${ARCH}-win32) set(LL_ARCH_DIR ${ARCH}-win32)
elseif (WORD_SIZE EQUAL 64) set(WORD_SIZE 32)
set(ARCH x86_64) set(AUTOBUILD_PLATFORM_NAME "windows")
set(LL_ARCH ${ARCH}_win) endif (WORD_SIZE EQUAL 64)
set(LL_ARCH_DIR ${ARCH}-win)
endif (WORD_SIZE EQUAL 32)
endif (${CMAKE_SYSTEM_NAME} MATCHES "Windows") endif (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") if (${CMAKE_SYSTEM_NAME} MATCHES "Linux")
@@ -99,25 +132,6 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
OUTPUT_VARIABLE XCODE_VERSION ) OUTPUT_VARIABLE XCODE_VERSION )
string(REGEX REPLACE "(\r?\n)+$" "" XCODE_VERSION "${XCODE_VERSION}") string(REGEX REPLACE "(\r?\n)+$" "" XCODE_VERSION "${XCODE_VERSION}")
# # To support a different SDK update these Xcode settings:
# if (XCODE_VERSION GREATER 4.9) # (Which would be 5.0+)
# set(CMAKE_OSX_DEPLOYMENT_TARGET 10.8)
# set(CMAKE_OSX_SYSROOT macosx10.9)
# else (XCODE_VERION GREATER 4.9)
# if (XCODE_VERSION GREATER 4.5)
# set(CMAKE_OSX_DEPLOYMENT_TARGET 10.7)
# set(CMAKE_OSX_SYSROOT macosx10.8)
# else (XCODE_VERSION GREATER 4.5)
# if (XCODE_VERSION GREATER 4.2)
# set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6)
# set(CMAKE_OSX_SYSROOT macosx10.7)
# else (XCODE_VERSION GREATER 4.2)
# set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6)
# set(CMAKE_OSX_SYSROOT macosx10.7)
# endif (XCODE_VERSION GREATER 4.2)
# endif (XCODE_VERSION GREATER 4.5)
# endif (XCODE_VERSION GREATER 4.9)
# Hardcode SDK we build against until we can test and allow newer ones # Hardcode SDK we build against until we can test and allow newer ones
# as autodetected in the code above # as autodetected in the code above
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6) set(CMAKE_OSX_DEPLOYMENT_TARGET 10.6)
@@ -151,28 +165,11 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(LL_ARCH_DIR universal-darwin) set(LL_ARCH_DIR universal-darwin)
endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") endif (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(LIBS_PREBUILT_DIR ${CMAKE_BINARY_DIR}/packages CACHE PATH
"Location of prebuilt libraries.")
set(LIBS_PREBUILT_LEGACY_DIR ${CMAKE_BINARY_DIR}/packages/libraries/${LL_ARCH_DIR} CACHE PATH
"Legacy location of prebuilt libraries.")
if (WINDOWS AND WORD_SIZE EQUAL 32)
set(PREBUILT_TYPE windows)
elseif (WINDOWS AND WORD_SIZE EQUAL 64)
set(PREBUILT_TYPE windows64)
elseif(DARWIN)
set(PREBUILT_TYPE darwin)
elseif(LINUX AND WORD_SIZE EQUAL 32)
set(PREBUILT_TYPE linux)
elseif(LINUX AND WORD_SIZE EQUAL 64)
set(PREBUILT_TYPE linux64)
endif(WINDOWS AND WORD_SIZE EQUAL 32)
# Default deploy grid # Default deploy grid
set(GRID agni CACHE STRING "Target Grid") set(GRID agni CACHE STRING "Target Grid")
set(VIEWER_CHANNEL "Singularity" CACHE STRING "Viewer Channel Name") set(VIEWER_CHANNEL "Singularity" CACHE STRING "Viewer Channel Name")
set(VIEWER_LOGIN_CHANNEL "${VIEWER_CHANNEL}" CACHE STRING "Fake login channel for A/B Testing") set(VIEWER_LOGIN_CHANNEL "${VIEWER_CHANNEL}" CACHE STRING "Fake login channel for A/B Testing")
set(VIEWER_BRANDING_ID "singularity" CACHE STRING "Viewer branding id (currently secondlife|snowglobe)") set(VIEWER_BRANDING_ID "singularity" CACHE STRING "Viewer branding id (currently secondlife|snowglobe)")

View File

@@ -2,7 +2,7 @@
include(Prebuilt) include(Prebuilt)
if (NOT STANDALONE) if (NOT STANDALONE)
use_prebuilt_binary(vivox) use_prebuilt_binary(slvoice)
if(LINUX) if(LINUX)
use_prebuilt_binary(libuuid) use_prebuilt_binary(libuuid)
if (${ARCH} STREQUAL "x86_64") if (${ARCH} STREQUAL "x86_64")

View File

@@ -8,9 +8,13 @@ if (STANDALONE)
include(FindXmlRpcEpi) include(FindXmlRpcEpi)
else (STANDALONE) else (STANDALONE)
use_prebuilt_binary(xmlrpc-epi) use_prebuilt_binary(xmlrpc-epi)
set(XMLRPCEPI_LIBRARIES xmlrpc-epi) if (WINDOWS)
set(XMLRPCEPI_INCLUDE_DIRS set(XMLRPCEPI_LIBRARIES
${LIBS_PREBUILT_DIR}/include debug xmlrpc-epid
${LIBS_PREBUILT_LEGACY_DIR}/include optimized xmlrpc-epi
) )
else (WINDOWS)
set(XMLRPCEPI_LIBRARIES xmlrpc-epi)
endif (WINDOWS)
set(XMLRPCEPI_INCLUDE_DIRS ${LIBS_PREBUILT_DIR}/include)
endif (STANDALONE) endif (STANDALONE)

View File

@@ -1,30 +1,24 @@
/** /**
* @file cmake_dummy.cpp * @file cmake_dummy.cpp
* *
* $LicenseInfo:firstyear=2008&license=viewergpl$ * $LicenseInfo:firstyear=2008&license=viewerlgpl$
*
* Copyright (c) 2008-2009, Linden Research, Inc.
*
* Second Life Viewer Source Code * Second Life Viewer Source Code
* The source code in this file ("Source Code") is provided by Linden Lab * Copyright (C) 2010, Linden Research, Inc.
* to you under the terms of the GNU General Public License, version 2.0
* ("GPL"), unless you have obtained a separate licensing agreement
* ("Other License"), formally executed by you and Linden Lab. Terms of
* the GPL can be found in doc/GPL-license.txt in this distribution, or
* online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
* *
* There are special exceptions to the terms and conditions of the GPL as * This library is free software; you can redistribute it and/or
* it is applied to this Source Code. View the full text of the exception * modify it under the terms of the GNU Lesser General Public
* in the file doc/FLOSS-exception.txt in this software distribution, or * License as published by the Free Software Foundation;
* online at * version 2.1 of the License only.
* http://secondlifegrid.net/programs/open_source/licensing/flossexception
* *
* By copying, modifying or distributing this software, you acknowledge * This library is distributed in the hope that it will be useful,
* that you have read and understood your obligations described above, * but WITHOUT ANY WARRANTY; without even the implied warranty of
* and agree to abide by those obligations. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
* *
* ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO * You should have received a copy of the GNU Lesser General Public
* WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, * License along with this library; if not, write to the Free Software
* COMPLETENESS OR PERFORMANCE. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*
* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
* $/LicenseInfo$ * $/LicenseInfo$
*/ */

View File

@@ -1,4 +1,28 @@
#!/usr/bin/env python #!/usr/bin/env python
"""\
@file start-client.py
$LicenseInfo:firstyear=2010&license=viewerlgpl$
Second Life Viewer Source Code
Copyright (C) 2010-2011, Linden Research, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation;
version 2.1 of the License only.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
$/LicenseInfo$
"""
import sys, getopt import sys, getopt
import os import os
import llstart import llstart

View File

@@ -1,941 +0,0 @@
#!/usr/bin/env python
#
# @file develop.py
# @authors Bryan O'Sullivan, Mark Palange, Aaron Brashears
# @brief Fire and forget script to appropriately configure cmake for SL.
#
# $LicenseInfo:firstyear=2007&license=viewergpl$
#
# Copyright (c) 2007-2009, Linden Research, Inc.
#
# Second Life Viewer Source Code
# The source code in this file ("Source Code") is provided by Linden Lab
# to you under the terms of the GNU General Public License, version 2.0
# ("GPL"), unless you have obtained a separate licensing agreement
# ("Other License"), formally executed by you and Linden Lab. Terms of
# the GPL can be found in doc/GPL-license.txt in this distribution, or
# online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
#
# There are special exceptions to the terms and conditions of the GPL as
# it is applied to this Source Code. View the full text of the exception
# in the file doc/FLOSS-exception.txt in this software distribution, or
# online at
# http://secondlifegrid.net/programs/open_source/licensing/flossexception
#
# By copying, modifying or distributing this software, you acknowledge
# that you have read and understood your obligations described above,
# and agree to abide by those obligations.
#
# ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
# WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
# COMPLETENESS OR PERFORMANCE.
# $/LicenseInfo$
import errno
import getopt
import os
import random
import re
import shutil
import socket
import sys
import commands
import shlex
class CommandError(Exception):
pass
def mkdir(path):
try:
os.mkdir(path)
return path
except OSError, err:
if err.errno != errno.EEXIST or not os.path.isdir(path):
raise
def prettyprint_path_for_cmake(path):
if 'a' <= path[0] <= 'z' and path[1] == ':':
# CMake wants DOS drive letters to be in uppercase. The above
# condition never asserts on platforms whose full path names
# always begin with a slash, so we don't need to test whether
# we are running on Windows.
path = path[0].upper() + path[1:]
return path
def getcwd():
return prettyprint_path_for_cmake(os.getcwd())
source_indra = prettyprint_path_for_cmake(os.path.dirname(os.path.realpath(__file__)))
def quote(opts):
return '"' + '" "'.join([ opt.replace('"', '') for opt in opts ]) + '"'
class PlatformSetup(object):
generator = None
build_types = {}
for t in ('Debug', 'Release', 'RelWithDebInfo'):
build_types[t.lower()] = t
build_type = build_types['relwithdebinfo']
standalone = 'OFF'
unattended = 'OFF'
universal = 'OFF'
project_name = 'Singularity'
distcc = True
cmake_opts = []
word_size = 32
using_express = False
def __init__(self):
self.script_dir = os.path.realpath(
os.path.dirname(__import__(__name__).__file__))
def os(self):
'''Return the name of the OS.'''
raise NotImplemented('os')
def arch(self):
'''Return the CPU architecture.'''
return None
def platform(self):
'''Return a stringified two-tuple of the OS name and CPU
architecture.'''
ret = self.os()
if self.arch():
ret += '-' + self.arch()
return ret
def build_dirs(self):
'''Return the top-level directories in which builds occur.
This can return more than one directory, e.g. if doing a
32-bit viewer and server build on Linux.'''
if(os.path.basename(os.path.normpath(os.getcwd())) == 'indra'):
prefix = '../'
else:
prefix = ''
return [prefix+'build-' + self.platform()]
def cmake_commandline(self, src_dir, build_dir, opts, simple):
'''Return the command line to run cmake with.'''
args = dict(
dir=src_dir,
generator=self.generator,
opts=quote(opts),
standalone=self.standalone,
unattended=self.unattended,
word_size=self.word_size,
type=self.build_type.upper(),
)
#if simple:
# return 'cmake %(opts)s %(dir)r' % args
return ('cmake -DCMAKE_BUILD_TYPE:STRING=%(type)s '
'-DSTANDALONE:BOOL=%(standalone)s '
'-DUNATTENDED:BOOL=%(unattended)s '
'-DWORD_SIZE:STRING=%(word_size)s '
'-G %(generator)r %(opts)s %(dir)r' % args)
def run_cmake(self, args=[]):
'''Run cmake.'''
# do a sanity check to make sure we have a generator
if not hasattr(self, 'generator'):
raise "No generator available for '%s'" % (self.__name__,)
cwd = getcwd()
created = []
try:
for d in self.build_dirs():
simple = True
if mkdir(d):
created.append(d)
simple = False
try:
os.chdir(d)
cmd = self.cmake_commandline(source_indra, d, args, simple)
print 'Running %r in %r' % (cmd, d)
self.run(cmd, 'cmake')
finally:
os.chdir(cwd)
except:
# If we created a directory in which to run cmake and
# something went wrong, the directory probably just
# contains garbage, so delete it.
os.chdir(cwd)
for d in created:
print 'Cleaning %r' % d
shutil.rmtree(d)
raise
def parse_build_opts(self, arguments):
opts, targets = getopt.getopt(arguments, 'D:o:', ['option='])
build_opts = []
for o, a in opts:
if o in ('-o', '--option'):
build_opts.append(a)
return build_opts, targets
def run_build(self, opts, targets):
'''Build the default targets for this platform.'''
raise NotImplemented('run_build')
def cleanup(self):
'''Delete all build directories.'''
cleaned = 0
for d in self.build_dirs():
if os.path.isdir(d):
print 'Cleaning %r' % d
shutil.rmtree(d)
cleaned += 1
if not cleaned:
print 'Nothing to clean up!'
def is_internal_tree(self):
'''Indicate whether we are building in an internal source tree.'''
return os.path.isdir(os.path.join(self.script_dir, 'newsim'))
def find_in_path(self, name, defval=None, basename=False):
for ext in self.exe_suffixes:
name_ext = name + ext
if os.sep in name_ext:
path = os.path.abspath(name_ext)
if os.access(path, os.X_OK):
return [basename and os.path.basename(path) or path]
for p in os.getenv('PATH', self.search_path).split(os.pathsep):
path = os.path.join(p, name_ext)
if os.access(path, os.X_OK):
return [basename and os.path.basename(path) or path]
if defval:
return [defval]
return []
class UnixSetup(PlatformSetup):
'''Generic Unixy build instructions.'''
search_path = '/usr/bin:/usr/local/bin'
exe_suffixes = ('',)
def __init__(self):
PlatformSetup.__init__(self)
super(UnixSetup, self).__init__()
self.generator = 'Unix Makefiles'
def os(self):
return 'unix'
def arch(self):
cpu = os.uname()[-1]
if cpu.endswith('386'):
cpu = 'i386'
elif cpu.endswith('86'):
cpu = 'i686'
elif cpu in ('athlon',):
cpu = 'i686'
elif cpu == 'Power Macintosh':
cpu = 'ppc'
elif cpu == 'x86_64' and self.word_size == 32:
cpu = 'i686'
return cpu
def run(self, command, name=None):
'''Run a program. If the program fails, raise an exception.'''
ret = os.system(command)
if ret:
if name is None:
name = command.split(None, 1)[0]
if os.WIFEXITED(ret):
st = os.WEXITSTATUS(ret)
if st == 127:
event = 'was not found'
else:
event = 'exited with status %d' % st
elif os.WIFSIGNALED(ret):
event = 'was killed by signal %d' % os.WTERMSIG(ret)
else:
event = 'died unexpectedly (!?) with 16-bit status %d' % ret
raise CommandError('the command %r %s' %
(name, event))
class LinuxSetup(UnixSetup):
def __init__(self):
UnixSetup.__init__(self)
super(LinuxSetup, self).__init__()
try:
self.debian_sarge = open('/etc/debian_version').read().strip() == '3.1'
except:
self.debian_sarge = False
def os(self):
return 'linux'
def build_dirs(self):
return [PlatformSetup.build_dirs(self)[0]+'-'+self.build_type.lower()]
def cmake_commandline(self, src_dir, build_dir, opts, simple):
args = dict(
dir=src_dir,
generator=self.generator,
opts=quote(opts),
standalone=self.standalone,
unattended=self.unattended,
type=self.build_type.upper(),
project_name=self.project_name,
word_size=self.word_size,
cxx="g++"
)
cmd = (('cmake -DCMAKE_BUILD_TYPE:STRING=%(type)s '
'-G %(generator)r -DSTANDALONE:BOOL=%(standalone)s '
'-DWORD_SIZE:STRING=%(word_size)s '
'-DROOT_PROJECT_NAME:STRING=%(project_name)s '
'%(opts)s %(dir)r')
% args)
if 'CXX' not in os.environ:
args.update({'cmd':cmd})
cmd = ('CXX=%(cxx)r %(cmd)s' % args)
return cmd
def run_build(self, opts, targets):
job_count = None
for i in range(len(opts)):
if opts[i].startswith('-j'):
try:
job_count = int(opts[i][2:])
except ValueError:
try:
job_count = int(opts[i+1])
except ValueError:
job_count = True
def get_cpu_count():
count = 0
for line in open('/proc/cpuinfo'):
if re.match(r'processor\s*:', line):
count += 1
return count
def localhost():
count = get_cpu_count()
return 'localhost/' + str(count), count
def get_distcc_hosts():
try:
hosts = []
name = os.getenv('DISTCC_DIR', '/etc/distcc') + '/hosts'
for l in open(name):
l = l[l.find('#')+1:].strip()
if l: hosts.append(l)
return hosts
except IOError:
return (os.getenv('DISTCC_HOSTS', '').split() or
[localhost()[0]])
def count_distcc_hosts():
cpus = 0
hosts = 0
for host in get_distcc_hosts():
m = re.match(r'.*/(\d+)', host)
hosts += 1
cpus += m and int(m.group(1)) or 1
return hosts, cpus
def mk_distcc_hosts(basename, range, num_cpus):
'''Generate a list of LL-internal machines to build on.'''
loc_entry, cpus = localhost()
hosts = [loc_entry]
dead = []
stations = [s for s in xrange(range) if s not in dead]
random.shuffle(stations)
hosts += ['%s%d.lindenlab.com/%d,lzo' % (basename, s, num_cpus) for s in stations]
cpus += 2 * len(stations)
return ' '.join(hosts), cpus
if job_count is None:
hosts, job_count = count_distcc_hosts()
if hosts == 1:
hostname = socket.gethostname()
if hostname.startswith('station'):
hosts, job_count = mk_distcc_hosts('station', 36, 2)
os.environ['DISTCC_HOSTS'] = hosts
if hostname.startswith('eniac'):
hosts, job_count = mk_distcc_hosts('eniac', 71, 2)
os.environ['DISTCC_HOSTS'] = hosts
if job_count > 4:
job_count = 4;
opts.extend(['-j', str(job_count)])
if targets:
targets = ' '.join(targets)
else:
targets = 'all'
for d in self.build_dirs():
cmd = 'make -C %r %s %s' % (d, ' '.join(opts), targets)
print 'Running %r' % cmd
self.run(cmd)
class DarwinSetup(UnixSetup):
def __init__(self):
UnixSetup.__init__(self)
super(DarwinSetup, self).__init__()
self.generator = 'Xcode'
def os(self):
return 'darwin'
def arch(self):
if self.universal == 'ON':
return 'universal'
else:
return UnixSetup.arch(self)
def build_dirs(self):
if(self.generator == 'Xcode'):
return PlatformSetup.build_dirs(self)
else:
return [PlatformSetup.build_dirs(self)[0]+'-'+self.build_type.lower()]
def cmake_commandline(self, src_dir, build_dir, opts, simple):
args = dict(
dir=src_dir,
generator=self.generator,
opts=quote(opts),
standalone=self.standalone,
word_size=self.word_size,
unattended=self.unattended,
project_name=self.project_name,
universal='',
type='',
)
if(self.generator != 'Xcode'):
args['type'] = '-DCMAKE_BUILD_TYPE=%s' % self.build_type.upper()
if self.universal == 'ON':
args['universal'] = '-DCMAKE_OSX_ARCHITECTURES:STRING=\'i386;ppc\''
#if simple:
# return 'cmake %(opts)s %(dir)r' % args
return ('cmake -G %(generator)r '
'%(type)s '
'-DSTANDALONE:BOOL=%(standalone)s '
'-DUNATTENDED:BOOL=%(unattended)s '
'-DWORD_SIZE:STRING=%(word_size)s '
'-DROOT_PROJECT_NAME:STRING=%(project_name)s '
'%(universal)s '
'%(opts)s %(dir)r' % args)
def run_build(self, opts, targets):
if(self.generator != 'Xcode'):
if targets:
targets = ' '.join(targets)
else:
targets = 'all'
for d in self.build_dirs():
cmd = 'make -C %r %s %s' % (d, ' '.join(opts), targets)
print 'Running %r' % cmd
self.run(cmd)
return
cwd = getcwd()
if targets:
targets = ' '.join(['-target ' + repr(t) for t in targets])
else:
targets = ''
cmd = ('xcodebuild -configuration %s %s %s' %
(self.build_type, ' '.join(opts), targets))
for d in self.build_dirs():
try:
os.chdir(d)
print 'Running %r in %r' % (cmd, d)
self.run(cmd)
finally:
os.chdir(cwd)
class WindowsSetup(PlatformSetup):
gens = {
'vc100' : {
'gen' : r'Visual Studio 10',
'ver' : r'10.0'
},
'vc120' : {
'gen' : r'Visual Studio 12',
'ver' : r'12.0'
}
}
gens['vs2010'] = gens['vc100']
gens['vs2013'] = gens['vc120']
search_path = r'C:\windows'
exe_suffixes = ('.exe', '.bat', '.com')
def __init__(self):
PlatformSetup.__init__(self)
super(WindowsSetup, self).__init__()
self._generator = None
self.incredibuild = False
def _get_generator(self):
if self._generator is None:
for version in 'vc100'.split():
if self.find_visual_studio(version):
self._generator = version
print 'Building with ', self.gens[version]['gen']
break
else:
print >> sys.stderr, 'Cannot find a Visual Studio installation, testing for express editions'
for version in 'vc100'.split():
if self.find_visual_studio_express(version):
self._generator = version
self.using_express = True
print 'Building with ', self.gens[version]['gen'] , "Express edition"
break
else:
for version in 'vc100'.split():
if self.find_visual_studio_express_single(version):
self._generator = version
self.using_express = True
print 'Building with ', self.gens[version]['gen'] , "Express edition"
break
else:
print >> sys.stderr, 'Cannot find any Visual Studio installation'
sys.exit(1)
return self._generator
def _set_generator(self, gen):
self._generator = gen
generator = property(_get_generator, _set_generator)
def get_gen_str(self, gen):
if gen is None:
gen = self._generator
return self.gens[gen.lower()]['ver']
def os(self):
return 'win32'
def build_dirs(self):
if(os.path.basename(os.path.normpath(os.getcwd())) == 'indra'):
prefix = '../'
else:
prefix = ''
if self.word_size == 64:
return [prefix+'build-' + self.generator + '-Win64']
else:
return [prefix+'build-' + self.generator]
def cmake_commandline(self, src_dir, build_dir, opts, simple):
args = dict(
dir=src_dir,
generator=self.gens[self.generator.lower()]['gen'],
opts=quote(opts),
standalone=self.standalone,
unattended=self.unattended,
project_name=self.project_name,
word_size=self.word_size,
)
if self.word_size == 64:
args["generator"] += r' Win64'
#if simple:
# return 'cmake %(opts)s "%(dir)s"' % args
return ('cmake -G "%(generator)s" '
'-DSTANDALONE:BOOL=%(standalone)s '
'-DUNATTENDED:BOOL=%(unattended)s '
'-DWORD_SIZE:STRING=%(word_size)s '
'-DROOT_PROJECT_NAME:STRING=\"%(project_name)s\" '
'%(opts)s "%(dir)s"' % args)
def get_HKLM_registry_value(self, key_str, value_str):
import _winreg
reg = _winreg.ConnectRegistry(None, _winreg.HKEY_LOCAL_MACHINE)
key = _winreg.OpenKey(reg, key_str)
value = _winreg.QueryValueEx(key, value_str)[0]
print 'Found: %s' % value
return value
def find_visual_studio(self, gen=None):
gen = self.get_gen_str(gen)
value_str = (r'EnvironmentDirectory')
key_str = (r'SOFTWARE\Microsoft\VisualStudio\%s\Setup\VS' %
gen)
print ('Reading VS environment from HKEY_LOCAL_MACHINE\%s\%s' %
(key_str, value_str))
try:
return self.get_HKLM_registry_value(key_str, value_str)
except WindowsError, err:
key_str = (r'SOFTWARE\Wow6432Node\Microsoft\VisualStudio\%s\Setup\VS' %
gen)
try:
return self.get_HKLM_registry_value(key_str, value_str)
except:
print >> sys.stderr, "Didn't find ", self.gens[gen]['gen']
return ''
def find_msbuild(self, gen=None):
gen = self.get_gen_str(gen)
key_str = (r'SOFTWARE\Microsoft\MSBuild\ToolsVersions\12.0')
print ('Checking MSBuild support for vs ver = %s' % gen)
if not self.get_HKLM_registry_value(key_str+'\\'+gen, "VCTargetsPath"):
return (None, None)
print ('Reading MSBuild location from HKEY_LOCAL_MACHINE\%s\MSBuildToolsPath' %
key_str)
print key_str
try:
return (self.get_HKLM_registry_value(key_str, 'MSBuildToolsPath'), gen)
except WindowsError, err:
key_str = (r'SOFTWARE\Wow6432Node\Microsoft\MSBuild\ToolsVersions\%s' %
gen)
try:
return (self.get_HKLM_registry_value(key_str, 'MSBuildToolsPath'), gen)
except WindowsError, err:
print 'Didn\'t find msbuild'
return (None, None)
def find_visual_studio_express(self, gen=None):
gen = self.get_gen_str(gen)
try:
import _winreg
key_str = (r'SOFTWARE\Microsoft\VCEXpress\%s\Setup\VC' %
gen)
value_str = (r'ProductDir')
print ('Reading VS environment from HKEY_LOCAL_MACHINE\%s\%s' %
(key_str, value_str))
print key_str
reg = _winreg.ConnectRegistry(None, _winreg.HKEY_LOCAL_MACHINE)
key = _winreg.OpenKey(reg, key_str)
value = _winreg.QueryValueEx(key, value_str)[0]+"IDE"
print 'Found: %s' % value
return value
except WindowsError, err:
print >> sys.stderr, "Didn't find ", gen
return ''
def find_visual_studio_express_single(self, gen=None):
gen = self.get_gen_str(gen)
try:
import _winreg
key_str = (r'SOFTWARE\Microsoft\VCEXpress\%s_Config\Setup\VC' %
gen)
value_str = (r'ProductDir')
print ('Reading VS environment from HKEY_CURRENT_USER\%s\%s' %
(key_str, value_str))
print key_str
reg = _winreg.ConnectRegistry(None, _winreg.HKEY_CURRENT_USER)
key = _winreg.OpenKey(reg, key_str)
value = _winreg.QueryValueEx(key, value_str)[0]+"IDE"
print 'Found: %s' % value
return value
except WindowsError, err:
print >> sys.stderr, "Didn't find ", gen
return ''
def get_build_cmd(self):
if self.incredibuild:
config = self.build_type
if self.gens[self.generator]['ver'] in [ r'8.0', r'9.0' ]:
config = '\"%s|Win32\"' % config
return "buildconsole \"%s.sln\" /build %s" % (self.project_name, config), None
environment = self.find_visual_studio()
if environment == '':
environment = self.find_visual_studio_express()
if environment == '':
environment = self.find_visual_studio_express_single()
if environment == '':
print >> sys.stderr, "Something went very wrong during build stage, could not find a Visual Studio?"
else:
build_dirs=self.build_dirs()
print >> sys.stderr, "\nSolution generation complete, it can can now be found in:", build_dirs[0]
print >> sys.stderr, "\nAs you are using an Express Visual Studio, the build step cannot be automated"
print >> sys.stderr, "\nPlease see https://wiki.secondlife.com/wiki/Microsoft_Visual_Studio#Extra_steps_for_Visual_Studio_Express_editions for Visual Studio Express specific information"
exit(0)
msbuild_dir, tool_ver = self.find_msbuild()
if msbuild_dir is not None and tool_ver is not None:
return ('\"%smsbuild.exe\" \"%s.sln\" /p:configuration=%s /p:VisualStudioVersion=%s' %
(msbuild_dir, self.project_name, self.build_type, tool_ver)), True
# devenv.com is CLI friendly, devenv.exe... not so much.
return ('"%sdevenv.com" \"%s.sln\" /build %s' %
(self.find_visual_studio(), self.project_name, self.build_type)), None
def run(self, command, name=None):
'''Run a program. If the program fails, raise an exception.'''
ret = os.system('\"'+command+'\"')
if ret:
if name is None:
name = os.path.normpath(shlex.split(command.encode('utf8'),posix=False)[0].strip('"'))
path = self.find_in_path(name)
if not path:
ret = 'was not found'
else:
ret = 'exited with status %d' % ret
raise CommandError('the command %r %s' %
(name, ret))
def run_cmake(self, args=[]):
'''Override to add the vstool.exe call after running cmake.'''
PlatformSetup.run_cmake(self, args)
if self.unattended == 'OFF':
if self.using_express == False:
self.run_vstool()
def run_vstool(self):
for build_dir in self.build_dirs():
stamp = os.path.join(build_dir, 'vstool.txt')
try:
prev_build = open(stamp).read().strip()
except IOError:
prev_build = ''
if prev_build == self.build_type:
# Only run vstool if the build type has changed.
continue
if(os.path.basename(os.path.normpath(os.getcwd())) == 'indra'):
tool_path = os.path.join('tools','vstool','VSTool.exe')
else:
tool_path = os.path.join('indra','tools','vstool','VSTool.exe')
vstool_cmd = (tool_path +
' --solution \"' +
os.path.join(build_dir,'%s.sln' % self.project_name) +
'\" --config ' + self.build_type +
' --startup secondlife-bin')
print 'Running vstool %r in %r' % (vstool_cmd, getcwd())
self.run(vstool_cmd)
print >> open(stamp, 'w'), self.build_type
def run_build(self, opts, targets):
cwd = getcwd()
build_cmd, msbuild = self.get_build_cmd()
for d in self.build_dirs():
try:
os.chdir(d)
if targets:
if msbuild:
cmd = '%s /target:%s %s' % (build_cmd, ';'.join(targets), ' '.join(opts))
print 'Running build(targets) %r in %r' % (cmd, d)
self.run(cmd)
else:
for t in targets:
cmd = '%s /project %s %s' % (build_cmd, t, ' '.join(opts))
print 'Running build(targets) %r in %r' % (cmd, d)
self.run(cmd)
else:
cmd = '%s %s' % (build_cmd, ' '.join(opts))
print 'Running build %r in %r' % (cmd, d)
self.run(cmd)
finally:
os.chdir(cwd)
class CygwinSetup(WindowsSetup):
def __init__(self):
super(CygwinSetup, self).__init__()
self.generator = 'vc80'
def cmake_commandline(self, src_dir, build_dir, opts, simple):
dos_dir = commands.getoutput("cygpath -w %s" % src_dir)
args = dict(
dir=dos_dir,
generator=self.gens[self.generator.lower()]['gen'],
opts=quote(opts),
standalone=self.standalone,
unattended=self.unattended,
project_name=self.project_name,
word_size=self.word_size,
)
if self.word_size == 64:
args["generator"] += r' Win64'
#if simple:
# return 'cmake %(opts)s "%(dir)s"' % args
return ('cmake -G "%(generator)s" '
'-DUNATTENDED:BOOl=%(unattended)s '
'-DSTANDALONE:BOOL=%(standalone)s '
'-DWORD_SIZE:STRING=%(word_size)s '
'-DROOT_PROJECT_NAME:STRING=%(project_name)s '
'%(opts)s "%(dir)s"' % args)
def run(self, command, name=None):
'''Run a program. If the program fails, raise an exception.'''
ret = os.system(command)
if ret:
if name is None:
name = os.path.normpath(shlex.split(command.encode('utf8'),posix=False)[0].strip('"'))
path = self.find_in_path(name)
if not path:
ret = 'was not found'
else:
ret = 'exited with status %d' % ret
raise CommandError('the command %r %s' %
(name, ret))
setup_platform = {
'darwin': DarwinSetup,
'linux2': LinuxSetup,
'linux3': LinuxSetup,
'win32' : WindowsSetup,
'cygwin' : CygwinSetup
}
usage_msg = '''
Usage: develop.py [options] [command [command-options]]
Options:
-h | --help print this help message
--standalone build standalone, without Linden prebuild libraries
--unattended build unattended, do not invoke any tools requiring
a human response
--universal build a universal binary on Mac OS X (unsupported)
-t | --type=NAME build type ("Debug", "Release", or "RelWithDebInfo")
-m32 | -m64 build architecture (32-bit or 64-bit)
-N | --no-distcc disable use of distcc
-G | --generator=NAME generator name
Windows: VC100 (VS2010) (default)
Mac OS X: Xcode (default), Unix Makefiles
Linux: Unix Makefiles (default), KDevelop3
-p | --project=NAME set the root project name. (Doesn't effect makefiles)
Commands:
build configure and build default target
clean delete all build directories, does not affect sources
configure configure project by running cmake (default if none given)
printbuilddirs print the build directory that will be used
Command-options for "configure":
We use cmake variables to change the build configuration.
-DPACKAGE:BOOL=ON Create "package" target to make installers
-DLL_TESTS:BOOL=OFF Don't generate unit test projects
-DEXAMPLEPLUGIN:BOOL=OFF Don't generate example plugin project
-DDISABLE_TCMALLOC:BOOL=ON Disable linkage of TCMalloc. (64bit builds automatically disable TCMalloc)
-DRELEASE_CRASH_REPORTING:BOOL=ON Enable Google Breakpad crash reporting
-DFMODSTUDIO:BOOL=ON Use FMOD Studio audio libraries
-DFMODEX:BOOL=ON Use FMOD Ex audio libraries
Examples:
Set up a Visual Studio 2010 project with "package" target:
develop.py -G vc100 configure -DPACKAGE:BOOL=ON
'''
def main(arguments):
setup = setup_platform[sys.platform]()
try:
opts, args = getopt.getopt(
arguments,
'?hNt:p:G:m:',
['help', 'standalone', 'no-distcc', 'unattended', 'type=', 'incredibuild', 'generator=', 'project='])
except getopt.GetoptError, err:
print >> sys.stderr, 'Error:', err
print >> sys.stderr, """
Note: You must pass -D options to cmake after the "configure" command
For example: develop.py configure -DSERVER:BOOL=OFF"""
print >> sys.stderr, usage_msg.strip()
sys.exit(1)
for o, a in opts:
if o in ('-?', '-h', '--help'):
print usage_msg.strip()
sys.exit(0)
elif o in ('--standalone',):
setup.standalone = 'ON'
elif o in ('--unattended',):
setup.unattended = 'ON'
elif o in ('-m',):
if a in ('32', '64'):
setup.word_size = int(a)
else:
print >> sys.stderr, 'Error: unknown word size', repr(a)
print >> sys.stderr, 'Supported word sizes: 32, 64'
sys.exit(1)
elif o in ('-t', '--type'):
try:
setup.build_type = setup.build_types[a.lower()]
except KeyError:
print >> sys.stderr, 'Error: unknown build type', repr(a)
print >> sys.stderr, 'Supported build types:'
types = setup.build_types.values()
types.sort()
for t in types:
print ' ', t
sys.exit(1)
elif o in ('-G', '--generator'):
setup.generator = a
elif o in ('-N', '--no-distcc'):
setup.distcc = False
elif o in ('-p', '--project'):
setup.project_name = a
elif o in ('--incredibuild'):
setup.incredibuild = True
else:
print >> sys.stderr, 'INTERNAL ERROR: unhandled option', repr(o)
sys.exit(1)
if not args:
setup.run_cmake()
return
try:
cmd = args.pop(0)
if cmd in ('cmake', 'configure'):
setup.run_cmake(args)
elif cmd == 'build':
if os.getenv('DISTCC_DIR') is None:
distcc_dir = os.path.join(getcwd(), '.distcc')
if not os.path.exists(distcc_dir):
os.mkdir(distcc_dir)
print "setting DISTCC_DIR to %s" % distcc_dir
os.environ['DISTCC_DIR'] = distcc_dir
else:
print "DISTCC_DIR is set to %s" % os.getenv('DISTCC_DIR')
for d in setup.build_dirs():
if not os.path.exists(d):
raise CommandError('run "develop.py cmake" first')
setup.run_cmake()
opts, targets = setup.parse_build_opts(args)
setup.run_build(opts, targets)
elif cmd == 'clean':
if args:
raise CommandError('clean takes no arguments')
setup.cleanup()
elif cmd == 'printbuilddirs':
for d in setup.build_dirs():
print >> sys.stdout, d
else:
print >> sys.stderr, 'Error: unknown subcommand', repr(cmd)
print >> sys.stderr, "(run 'develop.py --help' for help)"
sys.exit(1)
except getopt.GetoptError, err:
print >> sys.stderr, 'Error with %r subcommand: %s' % (cmd, err)
sys.exit(1)
if __name__ == '__main__':
try:
main(sys.argv[1:])
except CommandError, err:
print >> sys.stderr, 'Error:', err
sys.exit(1)

View File

@@ -1,3 +1,24 @@
#!/usr/bin/python
## $LicenseInfo:firstyear=2011&license=viewerlgpl$
## Second Life Viewer Source Code
## Copyright (C) 2011, Linden Research, Inc.
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation;
## version 2.1 of the License only.
##
## This library is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## Lesser General Public License for more details.
##
## You should have received a copy of the GNU Lesser General Public
## License along with this library; if not, write to the Free Software
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
##
## Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
## $/LicenseInfo$
import warnings import warnings

View File

@@ -1,3 +1,24 @@
#!/usr/bin/python
## $LicenseInfo:firstyear=2011&license=viewerlgpl$
## Second Life Viewer Source Code
## Copyright (C) 2011, Linden Research, Inc.
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation;
## version 2.1 of the License only.
##
## This library is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## Lesser General Public License for more details.
##
## You should have received a copy of the GNU Lesser General Public
## License along with this library; if not, write to the Free Software
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
##
## Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
## $/LicenseInfo$
from indra.base import llsd, lluuid from indra.base import llsd, lluuid
from indra.ipc import siesta from indra.ipc import siesta
import datetime, math, unittest import datetime, math, unittest

View File

@@ -36,7 +36,6 @@ $/LicenseInfo$
# Using cElementTree might cause some unforeseen problems, so here's a # Using cElementTree might cause some unforeseen problems, so here's a
# convenient off switch. # convenient off switch.
use_celementree = True use_celementree = True
try: try:

View File

@@ -1,3 +1,24 @@
#!/usr/bin/python
## $LicenseInfo:firstyear=2011&license=viewerlgpl$
## Second Life Viewer Source Code
## Copyright (C) 2011, Linden Research, Inc.
##
## This library is free software; you can redistribute it and/or
## modify it under the terms of the GNU Lesser General Public
## License as published by the Free Software Foundation;
## version 2.1 of the License only.
##
## This library is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
## Lesser General Public License for more details.
##
## You should have received a copy of the GNU Lesser General Public
## License along with this library; if not, write to the Free Software
## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
##
## Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
## $/LicenseInfo$
r"""UUID objects (universally unique identifiers) according to RFC 4122. r"""UUID objects (universally unique identifiers) according to RFC 4122.
This module provides immutable UUID objects (class UUID) and the functions This module provides immutable UUID objects (class UUID) and the functions

View File

@@ -30,5 +30,3 @@ set_source_files_properties(${libpathing_HEADER_FILES}
PROPERTIES HEADER_FILE_ONLY TRUE) PROPERTIES HEADER_FILE_ONLY TRUE)
add_library(nd_Pathing STATIC ${libpathing_SOURCE_FILES} ${libpathing_HEADER_FILES} ) add_library(nd_Pathing STATIC ${libpathing_SOURCE_FILES} ${libpathing_HEADER_FILES} )
add_dependencies(nd_Pathing prepare)

View File

@@ -100,5 +100,3 @@ set_source_files_properties(${llaudio_HEADER_FILES}
list(APPEND llaudio_SOURCE_FILES ${llaudio_HEADER_FILES}) list(APPEND llaudio_SOURCE_FILES ${llaudio_HEADER_FILES})
add_library (llaudio ${llaudio_SOURCE_FILES}) add_library (llaudio ${llaudio_SOURCE_FILES})
add_dependencies(llaudio prepare)

View File

@@ -73,4 +73,3 @@ set_source_files_properties(${llcharacter_HEADER_FILES}
list(APPEND llcharacter_SOURCE_FILES ${llcharacter_HEADER_FILES}) list(APPEND llcharacter_SOURCE_FILES ${llcharacter_HEADER_FILES})
add_library (llcharacter ${llcharacter_SOURCE_FILES}) add_library (llcharacter ${llcharacter_SOURCE_FILES})
add_dependencies(llcharacter prepare)

View File

@@ -7,7 +7,11 @@ include(00-Common)
include(LLCommon) include(LLCommon)
include(APR) include(APR)
include(Linking) include(Linking)
include(Boost)
include(LLSharedLibs)
include(GoogleBreakpad) include(GoogleBreakpad)
include(Copy3rdPartyLibs)
include(ZLIB)
include_directories( include_directories(
${EXPAT_INCLUDE_DIRS} ${EXPAT_INCLUDE_DIRS}
@@ -251,11 +255,22 @@ set_source_files_properties(${llcommon_HEADER_FILES}
list(APPEND llcommon_SOURCE_FILES ${cwdebug_SOURCE_FILES}) list(APPEND llcommon_SOURCE_FILES ${cwdebug_SOURCE_FILES})
list(APPEND llcommon_SOURCE_FILES ${llcommon_HEADER_FILES}) list(APPEND llcommon_SOURCE_FILES ${llcommon_HEADER_FILES})
add_library (llcommon SHARED ${llcommon_SOURCE_FILES}) if(LLCOMMON_LINK_SHARED)
if(WINDOWS) add_library (llcommon SHARED ${llcommon_SOURCE_FILES})
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /GL") if(NOT WORD_SIZE EQUAL 32)
endif(WINDOWS) if(NOT WINDOWS)
add_dependencies(llcommon prepare) add_definitions(-fPIC)
endif(NOT WINDOWS)
endif(NOT WORD_SIZE EQUAL 32)
if(WINDOWS)
# always generate llcommon.pdb, even for "Release" builds
set_target_properties(llcommon PROPERTIES LINK_FLAGS "/DEBUG")
endif(WINDOWS)
ll_stage_sharedlib(llcommon)
else(LLCOMMON_LINK_SHARED)
add_library (llcommon ${llcommon_SOURCE_FILES})
endif(LLCOMMON_LINK_SHARED)
target_link_libraries( target_link_libraries(
llcommon llcommon
${BREAKPAD_EXCEPTION_HANDLER_LIBRARIES} ${BREAKPAD_EXCEPTION_HANDLER_LIBRARIES}
@@ -280,3 +295,5 @@ if (DARWIN)
INSTALL_NAME_DIR "@executable_path/../Resources" INSTALL_NAME_DIR "@executable_path/../Resources"
) )
endif (DARWIN) endif (DARWIN)
add_dependencies(llcommon stage_third_party_libs)

View File

@@ -174,10 +174,10 @@ S32 wchar_to_utf8chars(llwchar in_char, char* outchars)
return outchars - base; return outchars - base;
} }
S32 utf16chars_to_wchar(const U16* inchars, llwchar* outchar) S32 utf16chars_to_wchar(const utf16strtype* inchars, llwchar* outchar)
{ {
const U16* base = inchars; const utf16strtype* base = inchars;
U16 cur_char = *inchars++; utf16strtype cur_char = *inchars++;
llwchar char32 = cur_char; llwchar char32 = cur_char;
if ((cur_char >= 0xD800) && (cur_char <= 0xDFFF)) if ((cur_char >= 0xD800) && (cur_char <= 0xDFFF))
{ {
@@ -236,7 +236,7 @@ LLWString utf16str_to_wstring(const llutf16string &utf16str, S32 len)
S32 i = 0; S32 i = 0;
// craziness to make gcc happy (llutf16string.c_str() is tweaked on linux): // craziness to make gcc happy (llutf16string.c_str() is tweaked on linux):
const U16* chars16 = &(*(utf16str.begin())); const utf16strtype* chars16 = &(*(utf16str.begin()));
while (i < len) while (i < len)
{ {
llwchar cur_char; llwchar cur_char;
@@ -257,18 +257,18 @@ S32 utf16str_wstring_length(const llutf16string &utf16str, const S32 utf16_len)
{ {
S32 surrogate_pairs = 0; S32 surrogate_pairs = 0;
// ... craziness to make gcc happy (llutf16string.c_str() is tweaked on linux): // ... craziness to make gcc happy (llutf16string.c_str() is tweaked on linux):
const U16 *const utf16_chars = &(*(utf16str.begin())); const utf16strtype *const utf16_chars = &(*(utf16str.begin()));
S32 i = 0; S32 i = 0;
while (i < utf16_len) while (i < utf16_len)
{ {
const U16 c = utf16_chars[i++]; const utf16strtype c = utf16_chars[i++];
if (c >= 0xD800 && c <= 0xDBFF) // See http://en.wikipedia.org/wiki/UTF-16 if (c >= 0xD800 && c <= 0xDBFF) // See http://en.wikipedia.org/wiki/UTF-16
{ // Have first byte of a surrogate pair { // Have first byte of a surrogate pair
if (i >= utf16_len) if (i >= utf16_len)
{ {
break; break;
} }
const U16 d = utf16_chars[i]; const utf16strtype d = utf16_chars[i];
if (d >= 0xDC00 && d <= 0xDFFF) if (d >= 0xDC00 && d <= 0xDFFF)
{ // Have valid second byte of a surrogate pair { // Have valid second byte of a surrogate pair
surrogate_pairs++; surrogate_pairs++;
@@ -621,22 +621,6 @@ bool LLStringOps::isHexString(const std::string& str)
} }
#if LL_WINDOWS #if LL_WINDOWS
// documentation moved to header. Phoenix 2007-11-27
namespace snprintf_hack
{
int snprintf(char *str, size_t size, const char *format, ...)
{
va_list args;
va_start(args, format);
int num_written = _vsnprintf(str, size, format, args); /* Flawfinder: ignore */
va_end(args);
str[size-1] = '\0'; // always null terminate
return num_written;
}
}
std::string ll_convert_wide_to_string(const wchar_t* in, unsigned int code_page) std::string ll_convert_wide_to_string(const wchar_t* in, unsigned int code_page)
{ {
std::string out; std::string out;

View File

@@ -501,7 +501,14 @@ LL_COMMON_API std::string rawstr_to_utf8(const std::string& raw);
// //
// We should never use UTF16 except when communicating with Win32! // We should never use UTF16 except when communicating with Win32!
// //
typedef std::basic_string<U16> llutf16string;
#if _WIN32 && _NATIVE_WCHAR_T_DEFINED
typedef wchar_t utf16strtype;
#else
typedef U16 utf16strtype;
#endif
typedef std::basic_string<utf16strtype> llutf16string;
LL_COMMON_API LLWString utf16str_to_wstring(const llutf16string &utf16str, S32 len); LL_COMMON_API LLWString utf16str_to_wstring(const llutf16string &utf16str, S32 len);
LL_COMMON_API LLWString utf16str_to_wstring(const llutf16string &utf16str); LL_COMMON_API LLWString utf16str_to_wstring(const llutf16string &utf16str);
@@ -586,32 +593,6 @@ LL_COMMON_API std::string utf8str_removeCRLF(const std::string& utf8str);
*/ */
//@{ //@{
/**
* @brief Implementation the expected snprintf interface.
*
* If the size of the passed in buffer is not large enough to hold the string,
* two bad things happen:
* 1. resulting formatted string is NOT null terminated
* 2. Depending on the platform, the return value could be a) the required
* size of the buffer to copy the entire formatted string or b) -1.
* On Windows with VS.Net 2003, it returns -1 e.g.
*
* safe_snprintf always adds a NULL terminator so that the caller does not
* need to check for return value or need to add the NULL terminator.
* It does not, however change the return value - to let the caller know
* that the passed in buffer size was not large enough to hold the
* formatted string.
*
*/
// Deal with the differeneces on Windows
namespace snprintf_hack
{
LL_COMMON_API int snprintf(char *str, size_t size, const char *format, ...);
}
using snprintf_hack::snprintf;
/** /**
* @brief Convert a wide string to std::string * @brief Convert a wide string to std::string
* *

View File

@@ -54,7 +54,7 @@ set_source_files_properties(${llimage_HEADER_FILES}
list(APPEND llimage_SOURCE_FILES ${llimage_HEADER_FILES}) list(APPEND llimage_SOURCE_FILES ${llimage_HEADER_FILES})
add_library (llimage ${llimage_SOURCE_FILES}) add_library (llimage ${llimage_SOURCE_FILES})
add_dependencies(llimage prepare)
target_link_libraries( target_link_libraries(
llimage llimage
${JPEG_LIBRARIES} ${JPEG_LIBRARIES}

View File

@@ -41,7 +41,7 @@ IF(WIN32)
ENDIF(WIN32) ENDIF(WIN32)
add_library (llimagej2coj ${llimagej2coj_SOURCE_FILES}) add_library (llimagej2coj ${llimagej2coj_SOURCE_FILES})
add_dependencies(llimagej2coj prepare)
target_link_libraries( target_link_libraries(
llimagej2coj llimagej2coj
${OPENJPEG_LIBRARIES} ${OPENJPEG_LIBRARIES}

View File

@@ -58,4 +58,3 @@ set_source_files_properties(${llinventory_HEADER_FILES}
list(APPEND llinventory_SOURCE_FILES ${llinventory_HEADER_FILES}) list(APPEND llinventory_SOURCE_FILES ${llinventory_HEADER_FILES})
add_library (llinventory ${llinventory_SOURCE_FILES}) add_library (llinventory ${llinventory_SOURCE_FILES})
add_dependencies(llinventory prepare)

View File

@@ -97,4 +97,3 @@ set_source_files_properties(${llmath_HEADER_FILES}
list(APPEND llmath_SOURCE_FILES ${llmath_HEADER_FILES}) list(APPEND llmath_SOURCE_FILES ${llmath_HEADER_FILES})
add_library (llmath ${llmath_SOURCE_FILES}) add_library (llmath ${llmath_SOURCE_FILES})
add_dependencies(llmath prepare)

View File

@@ -33,10 +33,21 @@
#endif #endif
// Add this in if we want boost math constants. // Add this in if we want boost math constants.
#include <boost/bind.hpp>
#if defined(LL_WINDOWS)
#pragma warning(push)
// warning C4348: 'boost::spirit::terminal<...>::result_helper': redefinition of default parameter: parameter 3, 4
#pragma warning(disable: 4348)
#endif
//#include <boost/math/constants/constants.hpp> //#include <boost/math/constants/constants.hpp>
#include <boost/spirit/include/phoenix.hpp> #include <boost/spirit/include/phoenix.hpp>
#include <boost/spirit/include/qi.hpp> #include <boost/spirit/include/qi.hpp>
#if defined(LL_WINDOWS)
#pragma warning(pop)
#endif
namespace expression { namespace expression {
@@ -55,31 +66,37 @@ T max_glue(T a, T b)
return std::max(a, b); return std::max(a, b);
} }
template<typename RT> struct lazy_pow_
{
template <typename X, typename Y>
struct result { typedef X type; };
template <typename X, typename Y>
X operator()(X x, Y y) const
{
return std::pow(x, y);
}
};
struct lazy_ufunc_ struct lazy_ufunc_
{ {
typedef RT result_type; template <typename F, typename A1>
struct result { typedef A1 type; };
template <typename F, typename A1> template <typename F, typename A1>
struct result { typedef RT type; }; A1 operator()(F f, A1 a1) const
template <typename F, typename A1>
RT operator()(F f, A1 a1) const
{ {
return f(a1); return f(a1);
} }
}; };
template<typename RT>
struct lazy_bfunc_ struct lazy_bfunc_
{ {
typedef RT result_type; template <typename F, typename A1, typename A2>
struct result { typedef A1 type; };
template <typename F, typename A1, typename A2> template <typename F, typename A1, typename A2>
struct result { typedef RT type; }; A1 operator()(F f, A1 a1, A2 a2) const
template <typename F, typename A1, typename A2>
RT operator()(F f, A1 a1, A2 a2) const
{ {
return f(a1, a2); return f(a1, a2);
} }
@@ -172,8 +189,9 @@ struct grammar
using boost::spirit::qi::no_case; using boost::spirit::qi::no_case;
using boost::spirit::qi::_val; using boost::spirit::qi::_val;
boost::phoenix::function< lazy_ufunc_<FPT> > lazy_ufunc; boost::phoenix::function<lazy_pow_> lazy_pow;
boost::phoenix::function< lazy_bfunc_<FPT> > lazy_bfunc; boost::phoenix::function<lazy_ufunc_> lazy_ufunc;
boost::phoenix::function<lazy_bfunc_> lazy_bfunc;
expression = expression =
term [_val = _1] term [_val = _1]
@@ -191,7 +209,7 @@ struct grammar
factor = factor =
primary [_val = _1] primary [_val = _1]
>> *( ("**" >> factor [_val = boost::phoenix::bind(static_cast<FPT (*)(FPT,FPT)>(&std::pow),_val,_1)]) >> *( ("**" >> factor [_val = lazy_pow(_val, _1)])
) )
; ;

View File

@@ -220,7 +220,7 @@ set_source_files_properties(${llmessage_HEADER_FILES}
list(APPEND llmessage_SOURCE_FILES ${llmessage_HEADER_FILES}) list(APPEND llmessage_SOURCE_FILES ${llmessage_HEADER_FILES})
add_library (llmessage ${llmessage_SOURCE_FILES}) add_library (llmessage ${llmessage_SOURCE_FILES})
add_dependencies(llmessage prepare)
target_link_libraries( target_link_libraries(
llmessage llmessage
${CURL_LIBRARIES} ${CURL_LIBRARIES}

View File

@@ -45,7 +45,7 @@ class PollSet;
// For ordering a std::set with AICurlEasyRequest objects. // For ordering a std::set with AICurlEasyRequest objects.
struct AICurlEasyRequestCompare { struct AICurlEasyRequestCompare {
bool operator()(AICurlEasyRequest const& h1, AICurlEasyRequest const& h2) { return h1.get() < h2.get(); } bool operator()(AICurlEasyRequest const& h1, AICurlEasyRequest const& h2) const { return h1.get() < h2.get(); }
}; };
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------

View File

@@ -30,7 +30,6 @@
#include "sys.h" #include "sys.h"
#include "aihttptimeoutpolicy.h" #include "aihttptimeoutpolicy.h"
#define NOMINMAX
#include "llerror.h" #include "llerror.h"
#include "lldefs.h" #include "lldefs.h"
#include "v3math.h" #include "v3math.h"

View File

@@ -62,8 +62,6 @@ if(LINUX AND STANDALONE)
target_link_libraries (llplugin rt dl) target_link_libraries (llplugin rt dl)
endif(LINUX AND STANDALONE) endif(LINUX AND STANDALONE)
add_dependencies(llplugin prepare)
add_subdirectory(slplugin) add_subdirectory(slplugin)
# # Add tests # # Add tests

View File

@@ -62,4 +62,3 @@ set_source_files_properties(${llprimitive_HEADER_FILES}
list(APPEND llprimitive_SOURCE_FILES ${llprimitive_HEADER_FILES}) list(APPEND llprimitive_SOURCE_FILES ${llprimitive_HEADER_FILES})
add_library (llprimitive ${llprimitive_SOURCE_FILES}) add_library (llprimitive ${llprimitive_SOURCE_FILES})
add_dependencies(llprimitive prepare)

View File

@@ -2452,7 +2452,7 @@ void LLModel::Decomposition::fromLLSD(LLSD& decomp)
range = max-min; range = max-min;
U16 count = position.size()/6; size_t count = position.size()/6;
for (U32 j = 0; j < count; ++j) for (U32 j = 0; j < count; ++j)
{ {

View File

@@ -8,6 +8,7 @@ include(LLCommon)
include(LLImage) include(LLImage)
include(LLMath) include(LLMath)
include(LLRender) include(LLRender)
include(LLVFS)
include(LLWindow) include(LLWindow)
include(LLXML) include(LLXML)
include(LLVFS) include(LLVFS)
@@ -18,6 +19,7 @@ include_directories(
${LLIMAGE_INCLUDE_DIRS} ${LLIMAGE_INCLUDE_DIRS}
${LLMATH_INCLUDE_DIRS} ${LLMATH_INCLUDE_DIRS}
${LLRENDER_INCLUDE_DIRS} ${LLRENDER_INCLUDE_DIRS}
${LLVFS_INCLUDE_DIRS}
${LLWINDOW_INCLUDE_DIRS} ${LLWINDOW_INCLUDE_DIRS}
${LLXML_INCLUDE_DIRS} ${LLXML_INCLUDE_DIRS}
${LLVFS_INCLUDE_DIRS} ${LLVFS_INCLUDE_DIRS}
@@ -82,4 +84,3 @@ endif (DARWIN)
list(APPEND llrender_SOURCE_FILES ${llrender_HEADER_FILES}) list(APPEND llrender_SOURCE_FILES ${llrender_HEADER_FILES})
add_library (llrender ${llrender_SOURCE_FILES}) add_library (llrender ${llrender_SOURCE_FILES})
add_dependencies(llrender prepare)

View File

@@ -60,7 +60,6 @@ set_source_files_properties(${llvfs_HEADER_FILES}
list(APPEND llvfs_SOURCE_FILES ${llvfs_HEADER_FILES}) list(APPEND llvfs_SOURCE_FILES ${llvfs_HEADER_FILES})
add_library (llvfs ${llvfs_SOURCE_FILES}) add_library (llvfs ${llvfs_SOURCE_FILES})
add_dependencies(llvfs prepare)
target_link_libraries(llvfs target_link_libraries(llvfs
${Boost_FILESYSTEM_LIBRARY} ${Boost_FILESYSTEM_LIBRARY}

View File

@@ -878,7 +878,7 @@ LLDir::SepOff LLDir::needSep(const std::string& path, const std::string& name) c
{ {
// But if BOTH path and name bring a separator, we need not add one. // But if BOTH path and name bring a separator, we need not add one.
// Moreover, we should actually skip the leading separator of 'name'. // Moreover, we should actually skip the leading separator of 'name'.
return SepOff(false, seplen); return SepOff(false, static_cast<U8>(seplen));
} }
// Here we know that either path_ends_sep or name_starts_sep is true -- // Here we know that either path_ends_sep or name_starts_sep is true --
// but not both. So don't add a separator, and don't skip any characters: // but not both. So don't add a separator, and don't skip any characters:

View File

@@ -11,7 +11,6 @@
project(llwindow) project(llwindow)
include(00-Common) include(00-Common)
include(DirectX)
include(LLCommon) include(LLCommon)
include(LLImage) include(LLImage)
include(LLMath) include(LLMath)
@@ -144,11 +143,9 @@ if (llwindow_HEADER_FILES)
endif (llwindow_HEADER_FILES) endif (llwindow_HEADER_FILES)
list(APPEND viewer_SOURCE_FILES ${viewer_HEADER_FILES}) list(APPEND viewer_SOURCE_FILES ${viewer_HEADER_FILES})
add_library (llwindow add_library (llwindow
${llwindow_SOURCE_FILES} ${llwindow_SOURCE_FILES}
${viewer_SOURCE_FILES} ${viewer_SOURCE_FILES}
) )
add_dependencies(llwindow prepare)
target_link_libraries (llwindow ${llwindow_LINK_LIBRARIES}) target_link_libraries (llwindow ${llwindow_LINK_LIBRARIES})

View File

@@ -37,7 +37,7 @@ set_source_files_properties(${llxml_HEADER_FILES}
list(APPEND llxml_SOURCE_FILES ${llxml_HEADER_FILES}) list(APPEND llxml_SOURCE_FILES ${llxml_HEADER_FILES})
add_library (llxml ${llxml_SOURCE_FILES}) add_library (llxml ${llxml_SOURCE_FILES})
add_dependencies(llxml prepare)
target_link_libraries( target_link_libraries(
llxml llxml
${EXPAT_LIBRARIES} ${EXPAT_LIBRARIES}

View File

@@ -263,7 +263,7 @@ void AIXMLElement::close_child(void)
mIndentation -= 2; mIndentation -= 2;
} }
AIXMLElement::~AIXMLElement() AIXMLElement::~AIXMLElement() noexcept(false)
{ {
if (mHasChildren) if (mHasChildren)
{ {

View File

@@ -64,7 +64,7 @@ class AIXMLElement
public: public:
AIXMLElement(std::ostream& os, char const* name, int indentation); AIXMLElement(std::ostream& os, char const* name, int indentation);
~AIXMLElement(); ~AIXMLElement() noexcept(false);
template<typename T> template<typename T>
void attribute(char const* name, T const& attribute); void attribute(char const* name, T const& attribute);

View File

@@ -4,8 +4,9 @@ project(viewer)
include(00-Common) include(00-Common)
include(Boost) include(Boost)
include(BuildPackagesInfo)
include(CMakeCopyIfDifferent)
include(DBusGlib) include(DBusGlib)
include(DirectX)
include(ELFIO) include(ELFIO)
if(FMODSTUDIO) if(FMODSTUDIO)
include(FMODSTUDIO) include(FMODSTUDIO)
@@ -13,11 +14,12 @@ endif(FMODSTUDIO)
if(FMODEX) if(FMODEX)
include(FMODEX) include(FMODEX)
endif(FMODEX) endif(FMODEX)
include(OPENAL) include(GLOD)
include(FindOpenGL) include(FindOpenGL)
include(Hunspell) include(Hunspell)
include(JsonCpp) include(JsonCpp)
include(LLAddBuildTest) include(LLAddBuildTest)
include(LLAppearance)
include(LLAudio) include(LLAudio)
include(LLCharacter) include(LLCharacter)
include(LLCommon) include(LLCommon)
@@ -38,12 +40,12 @@ include(LLXML)
include(Linking) include(Linking)
include(NDOF) include(NDOF)
include(NVAPI) include(NVAPI)
include(OPENAL)
include(StateMachine) include(StateMachine)
include(TemplateCheck) include(TemplateCheck)
include(UI) include(UI)
include(ViewerMiscLibs) include(ViewerMiscLibs)
include(GLOD)
include(LLAppearance)
if (WINDOWS) if (WINDOWS)
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP) set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP)
@@ -74,8 +76,6 @@ include_directories(
${LLWINDOW_INCLUDE_DIRS} ${LLWINDOW_INCLUDE_DIRS}
${LLXML_INCLUDE_DIRS} ${LLXML_INCLUDE_DIRS}
${LLAPPEARANCE_INCLUDE_DIRS} ${LLAPPEARANCE_INCLUDE_DIRS}
# ${LSCRIPT_INCLUDE_DIRS}
# ${LSCRIPT_INCLUDE_DIRS}/lscript_compile
) )
set(viewer_SOURCE_FILES set(viewer_SOURCE_FILES
@@ -1212,13 +1212,6 @@ if (WINDOWS)
PROPERTIES PROPERTIES
COMPILE_FLAGS "/Ycllviewerprecompiledheaders.h" COMPILE_FLAGS "/Ycllviewerprecompiledheaders.h"
) )
foreach( src_file ${viewer_SOURCE_FILES} )
set_source_files_properties(
${src_file}
PROPERTIES
COMPILE_FLAGS "/Yullviewerprecompiledheaders.h"
)
endforeach( src_file ${viewer_SOURCE_FILES} )
list(APPEND viewer_SOURCE_FILES llviewerprecompiledheaders.cpp) list(APPEND viewer_SOURCE_FILES llviewerprecompiledheaders.cpp)
# Add resource files to the project. # Add resource files to the project.
@@ -1274,20 +1267,13 @@ if (WINDOWS)
list(APPEND viewer_SOURCE_FILES ${viewer_RESOURCE_FILES}) list(APPEND viewer_SOURCE_FILES ${viewer_RESOURCE_FILES})
find_library(DINPUT_LIBRARY dinput8 ${DIRECTX_LIBRARY_DIR})
find_library(DXGUID_LIBRARY dxguid ${DIRECTX_LIBRARY_DIR})
mark_as_advanced(
DINPUT_LIBRARY
DXGUID_LIBRARY
)
# see EXP-1765 - theory is opengl32.lib needs to be included before gdi32.lib (windows libs) # see EXP-1765 - theory is opengl32.lib needs to be included before gdi32.lib (windows libs)
set(viewer_LIBRARIES set(viewer_LIBRARIES
opengl32 opengl32
advapi32 advapi32
comdlg32 comdlg32
${DINPUT_LIBRARY} dinput8
${DXGUID_LIBRARY} dxguid
gdi32 gdi32
kernel32 kernel32
odbc32 odbc32
@@ -1300,27 +1286,6 @@ if (WINDOWS)
Wbemuuid Wbemuuid
winspool winspool
) )
find_library(DEBUG_INTEL_MEMOPS_LIBRARY ll_intel_memops
PATHS
${LIBS_PREBUILT_DIR}/lib/debug
${LIBS_PREBUILT_LEGACY_DIR}/lib/debug
"${QUICKTIME_SDK_DIR}\\libraries"
)
find_library(RELEASE_INTEL_MEMOPS_LIBRARY ll_intel_memops
PATHS
${LIBS_PREBUILT_DIR}/lib/release
${LIBS_PREBUILT_LEGACY_DIR}/lib/release
"${QUICKTIME_SDK_DIR}\\libraries"
)
if (DEBUG_INTEL_MEMOPS_LIBRARY AND RELEASE_INTEL_MEMOPS_LIBRARY)
list(APPEND viewer_LIBRARIES optimized ${RELEASE_INTEL_MEMOPS_LIBRARY})
list(APPEND viewer_LIBRARIES debug ${DEBUG_INTEL_MEMOPS_LIBRARY})
mark_as_advanced(RELEASE_INTEL_MEMOPS_LIBRARY)
mark_as_advanced(DEBUG_INTEL_MEMOPS_LIBRARY)
endif (DEBUG_INTEL_MEMOPS_LIBRARY AND RELEASE_INTEL_MEMOPS_LIBRARY)
endif (WINDOWS) endif (WINDOWS)
# Add the xui files. This is handy for searching for xui elements # Add the xui files. This is handy for searching for xui elements
@@ -1418,42 +1383,8 @@ add_executable(${VIEWER_BINARY_NAME}
${viewer_SOURCE_FILES} ${viewer_SOURCE_FILES}
) )
if (!DISABLE_TEMPLATE_CHECK)
check_message_template(${VIEWER_BINARY_NAME})
endif (!DISABLE_TEMPLATE_CHECK)
set(PACKAGE OFF CACHE BOOL set(PACKAGE OFF CACHE BOOL
"Add a package_viewer target that builds an installer package.") "Add a package target that builds an installer package.")
if(FMOD_LIBRARY_RELEASE)
get_filename_component(fmod_lib_rel_name ${FMOD_LIBRARY_RELEASE} NAME)
get_filename_component(fmod_lib_deb_name ${FMOD_LIBRARY_DEBUG} NAME)
add_custom_command(OUTPUT fmod_lib.marker
COMMENT "Copying fmod library to executable directory"
COMMAND ${CMAKE_COMMAND} -E copy_if_different "$<$<NOT:$<CONFIG:debug>>:${FMOD_LIBRARY_RELEASE}>$<$<CONFIG:debug>:${FMOD_LIBRARY_DEBUG}>" "${CMAKE_CFG_INTDIR}/$<$<NOT:$<CONFIG:debug>>:${fmod_lib_rel_name}>$<$<CONFIG:debug>:${fmod_lib_deb_name}>"
DEPENDS "${FMOD_LIBRARY_RELEASE}")
add_custom_target(fmod_lib_copy DEPENDS fmod_lib.marker prepare)
if(DARWIN AND FMOD_EXTERNAL_LIB)
add_custom_command(OUTPUT fmod_lib_install.marker
COMMAND install_name_tool -id "@executable_path/../Resources/$<$<NOT:$<CONFIG:debug>>:${fmod_lib_rel_name}>$<$<CONFIG:debug>:${FMOD_LIBRARY_DEBUG}>" "${CMAKE_CFG_INTDIR}/$<$<NOT:$<CONFIG:debug>>:${fmod_lib_rel_name}>$<$<CONFIG:debug>:${fmod_lib_deb_name}>"
DEPENDS fmod_lib.marker)
add_dependencies(fmod_lib_copy fmod_lib_install.marker)
endif(DARWIN AND FMOD_EXTERNAL_LIB)
add_dependencies(${VIEWER_BINARY_NAME} fmod_lib_copy)
#viewer_manifest.py needs these libraries (for now its all dylib)
if(MANIFEST_LIBRARIES)
set(MANIFEST_LIBRARIES ${MANIFEST_LIBRARIES}|optimized ${fmod_lib_rel_name}|debug ${fmod_lib_deb_name})
else(MANIFEST_LIBRARIES)
set(MANIFEST_LIBRARIES optimized ${fmod_lib_rel_name}|debug ${fmod_lib_deb_name})
endif(MANIFEST_LIBRARIES)
if(WINDOWS) #If windows, fmod_lib_<config> points to a dll. The correct .lib needs to be linked (but copying is not necessary)
set(EXTRA_LINKER_FLAGS_RELEASE "/DELAYLOAD:${fmod_lib_rel_name}")
set(EXTRA_LINKER_FLAGS_DEBUG "/DELAYLOAD:${fmod_lib_deb_name}")
endif(WINDOWS)
list(APPEND viewer_LIBRARIES optimized "${FMOD_LINK_LIBRARY_RELEASE}" debug "${FMOD_LINK_LIBRARY_DEBUG}" )
endif(FMOD_LIBRARY_RELEASE)
if (WINDOWS) if (WINDOWS)
set(release_flags "/MAP") set(release_flags "/MAP")
@@ -1466,6 +1397,119 @@ if (WINDOWS)
LINK_FLAGS_RELWITHDEBINFO "${release_flags} ${EXTRA_LINKER_FLAGS_RELEASE}" LINK_FLAGS_RELWITHDEBINFO "${release_flags} ${EXTRA_LINKER_FLAGS_RELEASE}"
) )
if(USE_PRECOMPILED_HEADERS)
set_target_properties(
${VIEWER_BINARY_NAME}
PROPERTIES
COMPILE_FLAGS "/Yullviewerprecompiledheaders.h"
)
endif(USE_PRECOMPILED_HEADERS)
# If adding a file to viewer_manifest.py in the WindowsManifest.construct() method, be sure to add the dependency
# here.
# *NOTE:Mani - This is a crappy hack to have important dependencies for the viewer_manifest copy action
# be met. I'm looking forward to a source-code split-up project next year that will address this kind of thing.
# In the meantime, if you have any ideas on how to easily maintain one list, either here or in viewer_manifest.py
# and have the build deps get tracked *please* tell me about it.
if(USE_TCMALLOC)
# Configure a var for tcmalloc location, if used.
# Note the need to specify multiple names explicitly.
set(GOOGLE_PERF_TOOLS_SOURCE
${SHARED_LIB_STAGING_DIR}/Release/libtcmalloc_minimal.dll
${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/libtcmalloc_minimal.dll
${SHARED_LIB_STAGING_DIR}/Debug/libtcmalloc_minimal-debug.dll
)
endif(USE_TCMALLOC)
set(COPY_INPUT_DEPENDENCIES
# The following commented dependencies are determined at variably at build time. Can't do this here.
#${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/libtcmalloc_minimal.dll => None ... Skipping libtcmalloc_minimal.dll
${CMAKE_SOURCE_DIR}/../etc/message.xml
${CMAKE_SOURCE_DIR}/../scripts/messages/message_template.msg
${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/llcommon.dll
${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/libapr-1.dll
${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/libaprutil-1.dll
${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/libapriconv-1.dll
${SHARED_LIB_STAGING_DIR}/Release/glod.dll
${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/glod.dll
${SHARED_LIB_STAGING_DIR}/Debug/glod.dll
${SHARED_LIB_STAGING_DIR}/Release/openjpeg.dll
${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/openjpeg.dll
${SHARED_LIB_STAGING_DIR}/Debug/openjpegd.dll
${SHARED_LIB_STAGING_DIR}/Release/libhunspell.dll
${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/libhunspell.dll
${SHARED_LIB_STAGING_DIR}/Debug/libhunspell.dll
${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/SLVoice.exe
${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/vivoxsdk.dll
${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/ortp.dll
${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/libsndfile-1.dll
${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/zlib1.dll
${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/vivoxplatform.dll
${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/vivoxoal.dll
${SHARED_LIB_STAGING_DIR}/${CMAKE_CFG_INTDIR}/ca-bundle.crt
${GOOGLE_PERF_TOOLS_SOURCE}
${CMAKE_CURRENT_SOURCE_DIR}/licenses-win32.txt
${CMAKE_CURRENT_SOURCE_DIR}/featuretable.txt
${CMAKE_CURRENT_SOURCE_DIR}/featuretable_xp.txt
${ARCH_PREBUILT_DIRS_RELEASE}/libeay32.dll
${ARCH_PREBUILT_DIRS_RELEASE}/ssleay32.dll
${ARCH_PREBUILT_DIRS_DEBUG}/libeay32.dll
${ARCH_PREBUILT_DIRS_DEBUG}/ssleay32.dll
SLPlugin
media_plugin_quicktime
media_plugin_cef
windows-crash-logger
)
if (FMODSTUDIO)
if (WORD_SIZE EQUAL 64)
list(APPEND COPY_INPUT_DEPENDENCIES
${SHARED_LIB_STAGING_DIR}/Release/fmod64.dll
${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/fmod64.dll
${SHARED_LIB_STAGING_DIR}/Debug/fmodL64.dll
)
else (WORD_SIZE EQUAL 64)
list(APPEND COPY_INPUT_DEPENDENCIES
${SHARED_LIB_STAGING_DIR}/Release/fmod.dll
${SHARED_LIB_STAGING_DIR}/RelWithDebInfo/fmod.dll
${SHARED_LIB_STAGING_DIR}/Debug/fmodL.dll
)
endif (WORD_SIZE EQUAL 64)
endif (FMODSTUDIO)
add_custom_command(
OUTPUT ${CMAKE_CFG_INTDIR}/copy_touched.bat
COMMAND ${PYTHON_EXECUTABLE}
ARGS
${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
--actions=copy
--arch=${ARCH}
--artwork=${ARTWORK_DIR}
--branding_id=${VIEWER_BRANDING_ID}
--build=${CMAKE_CURRENT_BINARY_DIR}
--channel=${VIEWER_CHANNEL}
--configuration=${CMAKE_CFG_INTDIR}
--dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
--grid=${GRID}
--login_channel=${VIEWER_LOGIN_CHANNEL}
--source=${CMAKE_CURRENT_SOURCE_DIR}
--touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/copy_touched.bat
--extra_libraries="${MANIFEST_LIBRARIES}"
DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
stage_third_party_libs
${COPY_INPUT_DEPENDENCIES}
COMMENT "Performing viewer_manifest copy"
)
add_custom_target(copy_w_viewer_manifest ALL DEPENDS ${CMAKE_CFG_INTDIR}/copy_touched.bat)
add_dependencies(${VIEWER_BINARY_NAME} stage_third_party_libs llcommon copy_w_viewer_manifest)
if (EXISTS ${CMAKE_SOURCE_DIR}/copy_win_scripts)
add_dependencies(${VIEWER_BINARY_NAME} copy_win_scripts)
endif (EXISTS ${CMAKE_SOURCE_DIR}/copy_win_scripts)
# sets the 'working directory' for debugging from visual studio. # sets the 'working directory' for debugging from visual studio.
if (NOT UNATTENDED) if (NOT UNATTENDED)
add_custom_command( add_custom_command(
@@ -1481,32 +1525,6 @@ if (WINDOWS)
) )
endif (NOT UNATTENDED) endif (NOT UNATTENDED)
add_custom_command(
TARGET ${VIEWER_BINARY_NAME} PRE_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS
-E
copy_if_different
${CMAKE_CURRENT_SOURCE_DIR}/../../scripts/messages/message_template.msg
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/app_settings/message_template.msg
COMMENT "Copying message_template.msg to the runtime folder."
)
add_custom_command(
TARGET ${VIEWER_BINARY_NAME} PRE_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS
-E
copy_if_different
${CMAKE_CURRENT_SOURCE_DIR}/../../etc/message.xml
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/app_settings/message.xml
COMMENT "Copying message.xml to the runtime folder."
)
if (EXISTS ${CMAKE_SOURCE_DIR}/copy_win_scripts)
add_dependencies(${VIEWER_BINARY_NAME} copy_win_scripts)
endif (EXISTS ${CMAKE_SOURCE_DIR}/copy_win_scripts)
add_custom_command( add_custom_command(
OUTPUT ${CMAKE_CFG_INTDIR}/touched.bat OUTPUT ${CMAKE_CFG_INTDIR}/touched.bat
COMMAND ${PYTHON_EXECUTABLE} COMMAND ${PYTHON_EXECUTABLE}
@@ -1527,40 +1545,14 @@ if (WINDOWS)
DEPENDS DEPENDS
${VIEWER_BINARY_NAME} ${VIEWER_BINARY_NAME}
${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
${COPY_INPUT_DEPENDENCIES}
) )
add_custom_command(
OUTPUT ${CMAKE_CFG_INTDIR}/copy_touched.bat
COMMAND ${PYTHON_EXECUTABLE}
ARGS
${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
--arch=${ARCH}
--artwork=${ARTWORK_DIR}
--actions=copy
--branding_id=${VIEWER_BRANDING_ID}
--build=${CMAKE_CURRENT_BINARY_DIR}
--channel=${VIEWER_CHANNEL}
--configuration=${CMAKE_CFG_INTDIR}
--dest=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
--grid=${GRID}
--login_channel=${VIEWER_LOGIN_CHANNEL}
--source=${CMAKE_CURRENT_SOURCE_DIR}
--touch=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/copy_touched.bat
--extra_libraries="${MANIFEST_LIBRARIES}"
DEPENDS
${VIEWER_BINARY_NAME}
${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
COMMENT "Performing viewer_manifest copy"
)
add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_quicktime media_plugin_webkit basic_plugin_filepicker)
if(WORD_SIZE EQUAL 32)
add_dependencies(${VIEWER_BINARY_NAME} winmm_shim)
endif(WORD_SIZE EQUAL 32)
if (PACKAGE) if (PACKAGE)
add_custom_target(package_viewer ALL DEPENDS ${CMAKE_CFG_INTDIR}/touched.bat) add_custom_target(llpackage ALL DEPENDS
${CMAKE_CFG_INTDIR}/touched.bat
windows-setup-build-all
)
endif (PACKAGE) endif (PACKAGE)
endif (WINDOWS) endif (WINDOWS)
@@ -1679,8 +1671,8 @@ if (LINUX)
add_custom_target(copy_l_viewer_manifest ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.copy_touched) add_custom_target(copy_l_viewer_manifest ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/.${product}.copy_touched)
if (PACKAGE) if (PACKAGE)
add_custom_target(package_viewer ALL DEPENDS ${product}.tar.bz2) add_custom_target(llpackage ALL DEPENDS ${product}.tar.bz2)
add_dependencies(package_viewer copy_l_viewer_manifest) add_dependencies(llpackage copy_l_viewer_manifest)
endif (PACKAGE) endif (PACKAGE)
endif (LINUX) endif (LINUX)
@@ -1723,10 +1715,10 @@ if (DARWIN)
add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_quicktime media_plugin_webkit basic_plugin_filepicker) add_dependencies(${VIEWER_BINARY_NAME} SLPlugin media_plugin_quicktime media_plugin_webkit basic_plugin_filepicker)
if (PACKAGE) if (PACKAGE)
add_custom_target(package_viewer ALL DEPENDS ${VIEWER_BINARY_NAME}) add_custom_target(llpackage ALL DEPENDS ${VIEWER_BINARY_NAME})
add_custom_command( add_custom_command(
TARGET package_viewer POST_BUILD TARGET llpackage POST_BUILD
COMMAND ${PYTHON_EXECUTABLE} COMMAND ${PYTHON_EXECUTABLE}
ARGS ARGS
${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py ${CMAKE_CURRENT_SOURCE_DIR}/viewer_manifest.py
@@ -1764,7 +1756,7 @@ if (PACKAGE)
# set(VIEWER_EXE_GLOBS "${VIEWER_BINARY_NAME}${CMAKE_EXECUTABLE_SUFFIX} slplugin.exe") # set(VIEWER_EXE_GLOBS "${VIEWER_BINARY_NAME}${CMAKE_EXECUTABLE_SUFFIX} slplugin.exe")
set(VIEWER_EXE_GLOBS "${VIEWER_BINARY_NAME}${CMAKE_EXECUTABLE_SUFFIX}") set(VIEWER_EXE_GLOBS "${VIEWER_BINARY_NAME}${CMAKE_EXECUTABLE_SUFFIX}")
set(VIEWER_LIB_GLOB "*${CMAKE_SHARED_MODULE_SUFFIX}") set(VIEWER_LIB_GLOB "*${CMAKE_SHARED_MODULE_SUFFIX}")
set(VIEWER_DUMP_SYMS dump_syms.exe) set(VIEWER_COPY_MANIFEST copy_w_viewer_manifest)
endif (WINDOWS) endif (WINDOWS)
if (DARWIN) if (DARWIN)
list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}") list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}")
@@ -1773,18 +1765,16 @@ if (PACKAGE)
list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/plugins/gstreamer010/${CMAKE_CFG_INTDIR}") list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/plugins/gstreamer010/${CMAKE_CFG_INTDIR}")
list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/plugins/quicktime/${CMAKE_CFG_INTDIR}") list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/plugins/quicktime/${CMAKE_CFG_INTDIR}")
list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/plugins/webkit/${CMAKE_CFG_INTDIR}") list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_BINARY_DIR}/plugins/webkit/${CMAKE_CFG_INTDIR}")
set(VIEWER_SYMBOL_FILE "${SYMBOL_NAME}-darwin.tar.bz2") set(VIEWER_SYMBOL_FILE "${SYMBOL_NAME}-darwin.tar.bz2")
set(VIEWER_EXE_GLOBS "'${VIEWER_BRANDING_NAME}' SLPlugin") set(VIEWER_EXE_GLOBS "'${VIEWER_BRANDING_NAME}' SLPlugin")
set(VIEWER_LIB_GLOB "*.dylib") set(VIEWER_LIB_GLOB "*.dylib")
set(VIEWER_DUMP_SYMS dump_syms)
endif (DARWIN) endif (DARWIN)
if (LINUX) if (LINUX)
list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_CURRENT_BINARY_DIR}/packaged") list(APPEND SYMBOL_SEARCH_DIRS "${CMAKE_CURRENT_BINARY_DIR}/packaged")
set(VIEWER_SYMBOL_FILE "${SYMBOL_NAME}-linux-${ARCH}.tar.bz2") set(VIEWER_SYMBOL_FILE "${SYMBOL_NAME}-linux-${ARCH}.tar.bz2")
set(VIEWER_EXE_GLOBS "${VIEWER_BRANDING_ID}-do-not-run-directly SLPlugin") set(VIEWER_EXE_GLOBS "${VIEWER_BRANDING_ID}-do-not-run-directly SLPlugin")
set(VIEWER_LIB_GLOB "*${CMAKE_SHARED_MODULE_SUFFIX}*") set(VIEWER_LIB_GLOB "*${CMAKE_SHARED_MODULE_SUFFIX}*")
set(VIEWER_COPY_MANIFEST copy_l_viewer_manifest) set(VIEWER_COPY_MANIFEST copy_l_viewer_manifest)
set(VIEWER_DUMP_SYMS dump_syms)
endif (LINUX) endif (LINUX)
if(RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) if(RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING)
@@ -1803,7 +1793,7 @@ if (PACKAGE)
"${SYMBOL_SEARCH_DIRS}" "${SYMBOL_SEARCH_DIRS}"
"${VIEWER_EXE_GLOBS}" "${VIEWER_EXE_GLOBS}"
"${VIEWER_LIB_GLOB}" "${VIEWER_LIB_GLOB}"
"${LIBS_PREBUILT_DIR}/bin/${VIEWER_DUMP_SYMS}|${LIBS_PREBUILT_LEGACY_DIR}/bin/${VIEWER_DUMP_SYMS}" "${AUTOBUILD_INSTALL_DIR}/bin/dump_syms"
"${VIEWER_SYMBOL_FILE}" "${VIEWER_SYMBOL_FILE}"
DEPENDS generate_breakpad_symbols.py DEPENDS generate_breakpad_symbols.py
VERBATIM) VERBATIM)
@@ -1813,143 +1803,13 @@ if (PACKAGE)
if(VIEWER_COPY_MANIFEST) if(VIEWER_COPY_MANIFEST)
add_dependencies(generate_breakpad_symbols ${VIEWER_COPY_MANIFEST}) add_dependencies(generate_breakpad_symbols ${VIEWER_COPY_MANIFEST})
endif(VIEWER_COPY_MANIFEST) endif(VIEWER_COPY_MANIFEST)
add_dependencies(package_viewer generate_breakpad_symbols) add_dependencies(llpackage generate_breakpad_symbols)
endif(RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) endif(RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING)
endif (PACKAGE) endif (PACKAGE)
# Add tests # Add tests
if (LL_TESTS) if (LL_TESTS)
ADD_VIEWER_BUILD_TEST(llagentaccess viewer)
#ADD_VIEWER_BUILD_TEST(llworldmap viewer)
#ADD_VIEWER_BUILD_TEST(llworldmipmap viewer)
ADD_VIEWER_BUILD_TEST(lltextureinfo viewer)
ADD_VIEWER_BUILD_TEST(lltextureinfodetails viewer)
ADD_VIEWER_BUILD_TEST(lltexturestatsuploader viewer)
#ADD_VIEWER_COMM_BUILD_TEST(lltranslate viewer "")
endif (LL_TESTS) endif (LL_TESTS)
# Don't do these for DARWIN or LINUX here -- they're taken care of by viewer_manifest.py check_message_template(${VIEWER_BINARY_NAME})
if (WINDOWS)
IF(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
FOREACH(RUNTIME_LIB ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS})
add_custom_command(
TARGET ${VIEWER_BINARY_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS
-E
copy_if_different
${RUNTIME_LIB}
${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Copying ${RUNTIME_LIB} to the runtime folder."
)
ENDFOREACH(RUNTIME_LIB ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS})
ENDIF(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS)
SET(BUILT_LLCOMMON $<TARGET_FILE:llcommon>)
set_target_properties(llcommon
PROPERTIES
LINK_FLAGS "/debug /NODEFAULTLIB:LIBCMT"
LINK_FLAGS_DEBUG "/NODEFAULTLIB:\"LIBCMT;LIBCMTD;MSVCRT\""
LINK_FLAGS_RELEASE "${release_flags} /LTCG"
LINK_FLAGS_RELWITHDEBINFO "${release_flags}"
)
add_custom_command(
TARGET ${VIEWER_BINARY_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS
-E
copy_if_different
${BUILT_LLCOMMON}
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
COMMENT "Copying llcommon.dll to the runtime folder."
)
SET(BUILT_SLPLUGIN $<TARGET_FILE:SLPlugin>)
add_custom_command(
TARGET ${VIEWER_BINARY_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS
-E
copy_if_different
${BUILT_SLPLUGIN}
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
COMMENT "Copying SLPlugin executable to the runtime folder."
)
SET(BUILT_WEBKIT_PLUGIN $<TARGET_FILE:media_plugin_webkit>)
add_custom_command(
TARGET ${VIEWER_BINARY_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS
-E
copy_if_different
${BUILT_WEBKIT_PLUGIN}
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/llplugin
COMMENT "Copying WebKit Plugin to the runtime folder."
)
SET(BUILT_QUICKTIME_PLUGIN $<TARGET_FILE:media_plugin_quicktime>)
add_custom_command(
TARGET ${VIEWER_BINARY_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS
-E
copy_if_different
${BUILT_QUICKTIME_PLUGIN}
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/llplugin
COMMENT "Copying Quicktime Plugin to the runtime folder."
)
SET(BUILT_FILEPICKER_PLUGIN $<TARGET_FILE:basic_plugin_filepicker>)
add_custom_command(
TARGET ${VIEWER_BINARY_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS
-E
copy_if_different
${BUILT_FILEPICKER_PLUGIN}
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/llplugin
COMMENT "Copying filepicker Plugin to the runtime folder."
)
# winmm doesn't build on windows 64
if(WORD_SIZE EQUAL 32)
SET(BUILT_WINMM_SHIM_PLUGIN $<TARGET_FILE:winmm_shim>)
add_custom_command(
TARGET ${VIEWER_BINARY_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS
-E
copy_if_different
${BUILT_WINMM_SHIM_PLUGIN}
${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}
COMMENT "Copying winmm.dll to the runtime folder."
)
endif(WORD_SIZE EQUAL 32)
# Copying the mime_types.xml file to app_settings
set(mime_types_source "${CMAKE_SOURCE_DIR}/newview/skins/default/xui/en-us")
set(mime_types_dest "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/app_settings")
add_custom_command(
TARGET ${VIEWER_BINARY_NAME} POST_BUILD
COMMAND ${CMAKE_COMMAND}
ARGS
-E
copy_if_different
${mime_types_source}/mime_types_windows.xml
${mime_types_dest}/mime_types.xml
COMMENT "Copying mime_types_windows.xml to mime_types.xml."
)
endif (WINDOWS)
if (DARWIN)
# Don't do this here -- it's taken care of by viewer_manifest.py
# add_custom_command(TARGET ${VIEWER_BINARY_NAME} POST_BUILD
# COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_SOURCE_DIR}/../libraries/universal-darwin/lib/release/libllqtwebkit.dylib ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/llplugin/
# DEPENDS ${CMAKE_SOURCE_DIR}/../libraries/universal-darwin/lib/release/libllqtwebkit.dylib
# )
endif (DARWIN)

View File

@@ -19,9 +19,14 @@
#define ASPELL_WRAPPER 1 #define ASPELL_WRAPPER 1
#if LL_WINDOWS #if LL_WINDOWS
#include "hunspell/hunspelldll.h" #pragma push_macro("near")
#ifdef near
#undef near
#endif
#include <hunspell/hunspelldll.h>
#pragma pop_macro("near")
#else #else
#include "hunspell/hunspell.hxx" #include <hunspell/hunspell.hxx>
#endif #endif
class lggHunSpell_Wrapper class lggHunSpell_Wrapper

View File

@@ -122,6 +122,8 @@ bool create_app_mutex()
return result; return result;
} }
#define NVAPI_APPNAME L"Second Life"
void ll_nvapi_init(NvDRSSessionHandle hSession) void ll_nvapi_init(NvDRSSessionHandle hSession)
{ {
// (2) load all the system settings into the session // (2) load all the system settings into the session
@@ -132,12 +134,9 @@ void ll_nvapi_init(NvDRSSessionHandle hSession)
return; return;
} }
NvAPI_UnicodeString profile_name; NvAPI_UnicodeString wsz = { 0 };
//std::string app_name = LLTrans::getString("APP_NAME"); memcpy_s(wsz, sizeof(wsz), NVAPI_APPNAME, sizeof(NVAPI_APPNAME));
std::string app_name("Second Life"); // <alchemy/> status = NvAPI_DRS_SetCurrentGlobalProfile(hSession, wsz);
llutf16string w_app_name = utf8str_to_utf16str(app_name);
wsprintf(profile_name, L"%s", w_app_name.c_str());
status = NvAPI_DRS_SetCurrentGlobalProfile(hSession, profile_name);
if (status != NVAPI_OK) if (status != NVAPI_OK)
{ {
nvapi_error(status); nvapi_error(status);
@@ -409,11 +408,8 @@ const S32 MAX_CONSOLE_LINES = 500;
void create_console() void create_console()
{ {
int h_con_handle;
long l_std_handle;
CONSOLE_SCREEN_BUFFER_INFO coninfo; CONSOLE_SCREEN_BUFFER_INFO coninfo;
FILE *fp;
// allocate a console for this app // allocate a console for this app
AllocConsole(); AllocConsole();
@@ -423,48 +419,16 @@ void create_console()
coninfo.dwSize.Y = MAX_CONSOLE_LINES; coninfo.dwSize.Y = MAX_CONSOLE_LINES;
SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE), coninfo.dwSize); SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE), coninfo.dwSize);
// redirect unbuffered STDOUT to the console // Redirect the CRT standard input, output, and error handles to the console
l_std_handle = (long)GetStdHandle(STD_OUTPUT_HANDLE); freopen("CONIN$", "r", stdin);
h_con_handle = _open_osfhandle(l_std_handle, _O_TEXT); freopen("CONOUT$", "w", stdout);
if (h_con_handle == -1) freopen("CONOUT$", "w", stderr);
{
LL_WARNS() << "create_console() failed to open stdout handle" << LL_ENDL; setvbuf( stdin, NULL, _IONBF, 0 );
} setvbuf( stdout, NULL, _IONBF, 0 );
else setvbuf( stderr, NULL, _IONBF, 0 );
{
fp = _fdopen( h_con_handle, "w" );
*stdout = *fp;
setvbuf( stdout, NULL, _IONBF, 0 );
}
// redirect unbuffered STDIN to the console
l_std_handle = (long)GetStdHandle(STD_INPUT_HANDLE);
h_con_handle = _open_osfhandle(l_std_handle, _O_TEXT);
if (h_con_handle == -1)
{
LL_WARNS() << "create_console() failed to open stdin handle" << LL_ENDL;
}
else
{
fp = _fdopen( h_con_handle, "r" );
*stdin = *fp;
setvbuf( stdin, NULL, _IONBF, 0 );
}
// redirect unbuffered STDERR to the console
l_std_handle = (long)GetStdHandle(STD_ERROR_HANDLE);
h_con_handle = _open_osfhandle(l_std_handle, _O_TEXT);
if (h_con_handle == -1)
{
LL_WARNS() << "create_console() failed to open stderr handle" << LL_ENDL;
}
else
{
fp = _fdopen( h_con_handle, "w" );
*stderr = *fp;
setvbuf( stderr, NULL, _IOFBF, 1024 ); //Assigning a buffer improves speed a LOT, esp on vista/win7
//_IOLBF is borked.
}
} }

View File

@@ -181,12 +181,18 @@ public:
{ {
mNotifyCallback(*value); mNotifyCallback(*value);
} }
} }
virtual bool is_required(void) const
{ virtual bool is_required(void) const
return mIsRequired; {
} return mIsRequired;
}
virtual bool adjacent_tokens_only() const
{
return false;
}
protected: protected:
void xparse(boost::any& value_store, void xparse(boost::any& value_store,
const std::vector<std::string>& new_tokens) const const std::vector<std::string>& new_tokens) const

View File

@@ -508,11 +508,7 @@ void LLFloaterRegionInfo::refreshFromRegion(LLViewerRegion* region)
mInfoPanels.begin(), mInfoPanels.begin(),
mInfoPanels.end(), mInfoPanels.end(),
llbind2nd( llbind2nd(
#if LL_WINDOWS
std::mem_fun1(&LLPanelRegionInfo::refreshFromRegion),
#else
std::mem_fun(&LLPanelRegionInfo::refreshFromRegion), std::mem_fun(&LLPanelRegionInfo::refreshFromRegion),
#endif
region)); region));
} }

View File

@@ -738,7 +738,7 @@ BOOL LLPanelEditWearable::postBuild()
{ {
LL_WARNS() << "could not get wearable dictionary entry for wearable of type: " << mType << LL_ENDL; LL_WARNS() << "could not get wearable dictionary entry for wearable of type: " << mType << LL_ENDL;
} }
U8 num_subparts = wearable_entry->mSubparts.size(); U8 num_subparts = (U8) wearable_entry->mSubparts.size();
for (U8 index = 0; index < num_subparts; ++index) for (U8 index = 0; index < num_subparts; ++index)
{ {
@@ -859,7 +859,7 @@ void LLPanelEditWearable::draw()
const LLEditWearableDictionary::WearableEntry *wearable_entry = LLEditWearableDictionary::getInstance()->getWearable(mType); const LLEditWearableDictionary::WearableEntry *wearable_entry = LLEditWearableDictionary::getInstance()->getWearable(mType);
if (wearable_entry) if (wearable_entry)
{ {
U8 num_subparts = wearable_entry->mSubparts.size(); U8 num_subparts = (U8) wearable_entry->mSubparts.size();
for (U8 index = 0; index < num_subparts; ++index) for (U8 index = 0; index < num_subparts; ++index)
{ {

View File

@@ -1757,7 +1757,7 @@ void LLVOVolume::setNumTEs(const U8 num_tes)
} }
else if(old_num_tes > num_tes && mMediaImplList.size() > num_tes) //old faces removed else if(old_num_tes > num_tes && mMediaImplList.size() > num_tes) //old faces removed
{ {
U8 end = mMediaImplList.size() ; size_t end = mMediaImplList.size() ;
for(U8 i = num_tes; i < end ; i++) for(U8 i = num_tes; i < end ; i++)
{ {
removeMediaImpl(i) ; removeMediaImpl(i) ;

View File

@@ -39,7 +39,7 @@
#include "llviewermedia.h" // FIXME: don't use LLViewerMedia internals #include "llviewermedia.h" // FIXME: don't use LLViewerMedia internals
// third-party JSONCPP // third-party JSONCPP
#include <json/reader.h> // JSONCPP #include <jsoncpp/reader.h> // JSONCPP
/* /*
* Workflow: * Workflow:

View File

@@ -20,9 +20,7 @@
#include <stack> #include <stack>
#include "rlvcommon.h" #include "rlvcommon.h"
#if LL_GNUC || LL_INTELC || LL_CLANG
#include "rlvhelper.h" // Needed to make GCC happy #include "rlvhelper.h" // Needed to make GCC happy
#endif // LL_GNUC
// ============================================================================ // ============================================================================

View File

@@ -21,9 +21,12 @@
#include "llinventoryobserver.h" #include "llinventoryobserver.h"
#include "llsingleton.h" #include "llsingleton.h"
#include "rlvdefines.h"
#include "rlvhelper.h" #include "rlvhelper.h"
#include "rlvlocks.h" #include "rlvlocks.h"
#include <boost/format.hpp>
// ============================================================================ // ============================================================================
// RlvInventory class declaration // RlvInventory class declaration
// //
@@ -305,7 +308,7 @@ inline bool RlvInventory::isFoldedFolder(const LLInventoryCategory* pFolder, boo
// .(<attachpt>) type folder // .(<attachpt>) type folder
(0 != RlvAttachPtLookup::getAttachPointIndex(pFolder)) (0 != RlvAttachPtLookup::getAttachPointIndex(pFolder))
// .(nostrip) folder // .(nostrip) folder
|| ( (pFolder) && (".("RLV_FOLDER_FLAG_NOSTRIP")" == pFolder->getName()) ) || ((pFolder) && ((boost::format("%1%%2%%3%") % ".(" % RLV_FOLDER_FLAG_NOSTRIP % ")").str() == pFolder->getName()))
// Composite folder (if composite folders are enabled and we're asked to look for them) // Composite folder (if composite folders are enabled and we're asked to look for them)
#ifdef RLV_EXPERIMENTAL_COMPOSITEFOLDERS #ifdef RLV_EXPERIMENTAL_COMPOSITEFOLDERS
|| ( (fCheckComposite) && (RlvSettings::getEnableComposites()) && || ( (fCheckComposite) && (RlvSettings::getEnableComposites()) &&

View File

@@ -56,4 +56,3 @@ set_source_files_properties(${statemachine_HEADER_FILES}
list(APPEND statemachine_SOURCE_FILES ${statemachine_HEADER_FILES}) list(APPEND statemachine_SOURCE_FILES ${statemachine_HEADER_FILES})
add_library (statemachine ${statemachine_SOURCE_FILES}) add_library (statemachine ${statemachine_SOURCE_FILES})
add_dependencies(statemachine prepare)

View File

@@ -36,5 +36,3 @@ set(basic_plugin_base_HEADER_FILES
add_library(basic_plugin_base add_library(basic_plugin_base
${basic_plugin_base_SOURCE_FILES} ${basic_plugin_base_SOURCE_FILES}
) )
add_dependencies(basic_plugin_base prepare)

View File

@@ -0,0 +1,271 @@
#region Using Directives
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using System.Reflection;
using System.Security.Permissions;
#endregion
namespace TestDispatchUtility
{
/// <summary>
/// Provides helper methods for working with COM IDispatch objects that have a registered type library.
/// </summary>
public static class DispatchUtility
{
#region Private Constants
private const int S_OK = 0; //From WinError.h
private const int LOCALE_SYSTEM_DEFAULT = 2 << 10; //From WinNT.h == 2048 == 0x800
#endregion
#region Public Methods
/// <summary>
/// Gets whether the specified object implements IDispatch.
/// </summary>
/// <param name="obj">An object to check.</param>
/// <returns>True if the object implements IDispatch. False otherwise.</returns>
public static bool ImplementsIDispatch(object obj)
{
bool result = obj is IDispatchInfo;
return result;
}
/// <summary>
/// Gets a Type that can be used with reflection.
/// </summary>
/// <param name="obj">An object that implements IDispatch.</param>
/// <param name="throwIfNotFound">Whether an exception should be thrown if a Type can't be obtained.</param>
/// <returns>A .NET Type that can be used with reflection.</returns>
/// <exception cref="InvalidCastException">If <paramref name="obj"/> doesn't implement IDispatch.</exception>
[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
public static Type GetType(object obj, bool throwIfNotFound)
{
RequireReference(obj, "obj");
Type result = GetType((IDispatchInfo)obj, throwIfNotFound);
return result;
}
/// <summary>
/// Tries to get the DISPID for the requested member name.
/// </summary>
/// <param name="obj">An object that implements IDispatch.</param>
/// <param name="name">The name of a member to lookup.</param>
/// <param name="dispId">If the method returns true, this holds the DISPID on output.
/// If the method returns false, this value should be ignored.</param>
/// <returns>True if the member was found and resolved to a DISPID. False otherwise.</returns>
/// <exception cref="InvalidCastException">If <paramref name="obj"/> doesn't implement IDispatch.</exception>
[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)]
public static bool TryGetDispId(object obj, string name, out int dispId)
{
RequireReference(obj, "obj");
bool result = TryGetDispId((IDispatchInfo)obj, name, out dispId);
return result;
}
/// <summary>
/// Invokes a member by DISPID.
/// </summary>
/// <param name="obj">An object that implements IDispatch.</param>
/// <param name="dispId">The DISPID of a member. This can be obtained using
/// <see cref="TryGetDispId(object, string, out int)"/>.</param>
/// <param name="args">The arguments to pass to the member.</param>
/// <returns>The member's return value.</returns>
/// <remarks>
/// This can invoke a method or a property get accessor.
/// </remarks>
public static object Invoke(object obj, int dispId, object[] args)
{
string memberName = "[DispId=" + dispId + "]";
object result = Invoke(obj, memberName, args);
return result;
}
/// <summary>
/// Invokes a member by name.
/// </summary>
/// <param name="obj">An object.</param>
/// <param name="memberName">The name of the member to invoke.</param>
/// <param name="args">The arguments to pass to the member.</param>
/// <returns>The member's return value.</returns>
/// <remarks>
/// This can invoke a method or a property get accessor.
/// </remarks>
public static object Invoke(object obj, string memberName, object[] args)
{
RequireReference(obj, "obj");
Type type = obj.GetType();
object result = type.InvokeMember(memberName, BindingFlags.InvokeMethod | BindingFlags.GetProperty,
null, obj, args, null);
return result;
}
#endregion
#region Private Methods
/// <summary>
/// Requires that the value is non-null.
/// </summary>
/// <typeparam name="T">The type of the value.</typeparam>
/// <param name="value">The value to check.</param>
/// <param name="name">The name of the value.</param>
private static void RequireReference<T>(T value, string name) where T : class
{
if (value == null)
{
throw new ArgumentNullException(name);
}
}
/// <summary>
/// Gets a Type that can be used with reflection.
/// </summary>
/// <param name="dispatch">An object that implements IDispatch.</param>
/// <param name="throwIfNotFound">Whether an exception should be thrown if a Type can't be obtained.</param>
/// <returns>A .NET Type that can be used with reflection.</returns>
private static Type GetType(IDispatchInfo dispatch, bool throwIfNotFound)
{
RequireReference(dispatch, "dispatch");
Type result = null;
int typeInfoCount;
int hr = dispatch.GetTypeInfoCount(out typeInfoCount);
if (hr == S_OK && typeInfoCount > 0)
{
// Type info isn't usually culture-aware for IDispatch, so we might as well pass
// the default locale instead of looking up the current thread's LCID each time
// (via CultureInfo.CurrentCulture.LCID).
dispatch.GetTypeInfo(0, LOCALE_SYSTEM_DEFAULT, out result);
}
if (result == null && throwIfNotFound)
{
// If the GetTypeInfoCount called failed, throw an exception for that.
Marshal.ThrowExceptionForHR(hr);
// Otherwise, throw the same exception that Type.GetType would throw.
throw new TypeLoadException();
}
return result;
}
/// <summary>
/// Tries to get the DISPID for the requested member name.
/// </summary>
/// <param name="dispatch">An object that implements IDispatch.</param>
/// <param name="name">The name of a member to lookup.</param>
/// <param name="dispId">If the method returns true, this holds the DISPID on output.
/// If the method returns false, this value should be ignored.</param>
/// <returns>True if the member was found and resolved to a DISPID. False otherwise.</returns>
private static bool TryGetDispId(IDispatchInfo dispatch, string name, out int dispId)
{
RequireReference(dispatch, "dispatch");
RequireReference(name, "name");
bool result = false;
// Members names aren't usually culture-aware for IDispatch, so we might as well
// pass the default locale instead of looking up the current thread's LCID each time
// (via CultureInfo.CurrentCulture.LCID).
Guid iidNull = Guid.Empty;
int hr = dispatch.GetDispId(ref iidNull, ref name, 1, LOCALE_SYSTEM_DEFAULT, out dispId);
const int DISP_E_UNKNOWNNAME = unchecked((int)0x80020006); //From WinError.h
const int DISPID_UNKNOWN = -1; //From OAIdl.idl
if (hr == S_OK)
{
result = true;
}
else if (hr == DISP_E_UNKNOWNNAME && dispId == DISPID_UNKNOWN)
{
// This is the only supported "error" case because it means IDispatch
// is saying it doesn't know the member we asked about.
result = false;
}
else
{
// The other documented result codes are all errors.
Marshal.ThrowExceptionForHR(hr);
}
return result;
}
#endregion
#region Private Interfaces
/// <summary>
/// A partial declaration of IDispatch used to lookup Type information and DISPIDs.
/// </summary>
/// <remarks>
/// This interface only declares the first three methods of IDispatch. It omits the
/// fourth method (Invoke) because there are already plenty of ways to do dynamic
/// invocation in .NET. But the first three methods provide dynamic type metadata
/// discovery, which .NET doesn't provide normally if you have a System.__ComObject
/// RCW instead of a strongly-typed RCW.
/// <para/>
/// Note: The original declaration of IDispatch is in OAIdl.idl.
/// </remarks>
[ComImport]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[Guid("00020400-0000-0000-C000-000000000046")]
private interface IDispatchInfo
{
/// <summary>
/// Gets the number of Types that the object provides (0 or 1).
/// </summary>
/// <param name="typeInfoCount">Returns 0 or 1 for the number of Types provided by <see cref="GetTypeInfo"/>.</param>
/// <remarks>
/// http://msdn.microsoft.com/en-us/library/da876d53-cb8a-465c-a43e-c0eb272e2a12(VS.85)
/// </remarks>
[PreserveSig]
int GetTypeInfoCount(out int typeInfoCount);
/// <summary>
/// Gets the Type information for an object if <see cref="GetTypeInfoCount"/> returned 1.
/// </summary>
/// <param name="typeInfoIndex">Must be 0.</param>
/// <param name="lcid">Typically, LOCALE_SYSTEM_DEFAULT (2048).</param>
/// <param name="typeInfo">Returns the object's Type information.</param>
/// <remarks>
/// http://msdn.microsoft.com/en-us/library/cc1ec9aa-6c40-4e70-819c-a7c6dd6b8c99(VS.85)
/// </remarks>
void GetTypeInfo(int typeInfoIndex, int lcid, [MarshalAs(UnmanagedType.CustomMarshaler,
MarshalTypeRef = typeof(System.Runtime.InteropServices.CustomMarshalers.TypeToTypeInfoMarshaler))] out Type typeInfo);
/// <summary>
/// Gets the DISPID of the specified member name.
/// </summary>
/// <param name="riid">Must be IID_NULL. Pass a copy of Guid.Empty.</param>
/// <param name="name">The name of the member to look up.</param>
/// <param name="nameCount">Must be 1.</param>
/// <param name="lcid">Typically, LOCALE_SYSTEM_DEFAULT (2048).</param>
/// <param name="dispId">If a member with the requested <paramref name="name"/>
/// is found, this returns its DISPID and the method's return value is 0.
/// If the method returns a non-zero value, then this parameter's output value is
/// undefined.</param>
/// <returns>Zero for success. Non-zero for failure.</returns>
/// <remarks>
/// http://msdn.microsoft.com/en-us/library/6f6cf233-3481-436e-8d6a-51f93bf91619(VS.85)
/// </remarks>
[PreserveSig]
int GetDispId(ref Guid riid, ref string name, int nameCount, int lcid, out int dispId);
// NOTE: The real IDispatch also has an Invoke method next, but we don't need it.
// We can invoke methods using .NET's Type.InvokeMember method with the special
// [DISPID=n] syntax for member "names", or we can get a .NET Type using GetTypeInfo
// and invoke methods on that through reflection.
// Type.InvokeMember: http://msdn.microsoft.com/en-us/library/de3dhzwy.aspx
}
#endregion
}
}

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="12.0"> <Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup> <PropertyGroup>
<ProjectType>Local</ProjectType> <ProjectType>Local</ProjectType>
<ProductVersion>8.0.50727</ProductVersion> <ProductVersion>8.0.50727</ProductVersion>
@@ -26,8 +26,9 @@
</FileUpgradeFlags> </FileUpgradeFlags>
<UpgradeBackupLocation> <UpgradeBackupLocation>
</UpgradeBackupLocation> </UpgradeBackupLocation>
<TargetFrameworkVersion>v2.0</TargetFrameworkVersion> <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<OldToolsVersion>2.0</OldToolsVersion> <OldToolsVersion>2.0</OldToolsVersion>
<TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>.\</OutputPath> <OutputPath>.\</OutputPath>

Binary file not shown.

View File

@@ -1,7 +1,5 @@
Microsoft Visual Studio Solution File, Format Version 12.00 Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2013 # Visual Studio 2010
VisualStudioVersion = 12.0.30723.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VSTool", "VSTool.csproj", "{96943E2D-1373-4617-A117-D0F997A94919}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "VSTool", "VSTool.csproj", "{96943E2D-1373-4617-A117-D0F997A94919}"
EndProject EndProject
Global Global

View File

@@ -0,0 +1,3 @@
<?xml version="1.0"?>
<configuration>
<startup><supportedRuntime version="v2.0.50727"/></startup></configuration>

View File

@@ -5,11 +5,10 @@
using System; using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.IO;
using System.Reflection; using System.Reflection;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Runtime.InteropServices.ComTypes; using System.Runtime.InteropServices.ComTypes;
using Microsoft.CSharp;
namespace VSTool namespace VSTool
{ {
@@ -19,6 +18,39 @@ namespace VSTool
// visualstudio and handle them. // visualstudio and handle them.
public class MessageFilter : IOleMessageFilter public class MessageFilter : IOleMessageFilter
{ {
//
// IOleMessageFilter functions.
// Handle incoming thread requests.
int IOleMessageFilter.HandleInComingCall(int dwCallType,
IntPtr hTaskCaller, int dwTickCount, IntPtr
lpInterfaceInfo)
{
//Return the flag SERVERCALL_ISHANDLED.
return 0;
}
// Thread call was rejected, so try again.
int IOleMessageFilter.RetryRejectedCall(IntPtr
hTaskCallee, int dwTickCount, int dwRejectType)
{
if (dwRejectType == 2)
// flag = SERVERCALL_RETRYLATER.
{
// Retry the thread call immediately if return >=0 &
// <100.
return 99;
}
// Too busy; cancel call.
return -1;
}
int IOleMessageFilter.MessagePending(IntPtr hTaskCallee,
int dwTickCount, int dwPendingType)
{
//Return the flag PENDINGMSG_WAITDEFPROCESS.
return 2;
}
// //
// Class containing the IOleMessageFilter // Class containing the IOleMessageFilter
// thread error-handling functions. // thread error-handling functions.
@@ -38,49 +70,16 @@ namespace VSTool
CoRegisterMessageFilter(null, out oldFilter); CoRegisterMessageFilter(null, out oldFilter);
} }
//
// IOleMessageFilter functions.
// Handle incoming thread requests.
int IOleMessageFilter.HandleInComingCall(int dwCallType,
System.IntPtr hTaskCaller, int dwTickCount, System.IntPtr
lpInterfaceInfo)
{
//Return the flag SERVERCALL_ISHANDLED.
return 0;
}
// Thread call was rejected, so try again.
int IOleMessageFilter.RetryRejectedCall(System.IntPtr
hTaskCallee, int dwTickCount, int dwRejectType)
{
if (dwRejectType == 2)
// flag = SERVERCALL_RETRYLATER.
{
// Retry the thread call immediately if return >=0 &
// <100.
return 99;
}
// Too busy; cancel call.
return -1;
}
int IOleMessageFilter.MessagePending(System.IntPtr hTaskCallee,
int dwTickCount, int dwPendingType)
{
//Return the flag PENDINGMSG_WAITDEFPROCESS.
return 2;
}
// Implement the IOleMessageFilter interface. // Implement the IOleMessageFilter interface.
[DllImport("Ole32.dll")] [DllImport("Ole32.dll")]
private static extern int private static extern int
CoRegisterMessageFilter(IOleMessageFilter newFilter, out CoRegisterMessageFilter(IOleMessageFilter newFilter, out
IOleMessageFilter oldFilter); IOleMessageFilter oldFilter);
} }
[ComImport(), Guid("00000016-0000-0000-C000-000000000046"), [ComImport, Guid("00000016-0000-0000-C000-000000000046"),
InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown)] InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
interface IOleMessageFilter internal interface IOleMessageFilter
{ {
[PreserveSig] [PreserveSig]
int HandleInComingCall( int HandleInComingCall(
@@ -102,13 +101,13 @@ namespace VSTool
int dwPendingType); int dwPendingType);
} }
class ViaCOM internal class ViaCOM
{ {
public static object GetProperty(object from_obj, string prop_name) public static object GetProperty(object from_obj, string prop_name)
{ {
try try
{ {
Type objType = from_obj.GetType(); var objType = from_obj.GetType();
return objType.InvokeMember( return objType.InvokeMember(
prop_name, prop_name,
BindingFlags.GetProperty, null, BindingFlags.GetProperty, null,
@@ -127,8 +126,8 @@ namespace VSTool
{ {
try try
{ {
object[] args = { new_value }; object[] args = {new_value};
Type objType = from_obj.GetType(); var objType = from_obj.GetType();
return objType.InvokeMember( return objType.InvokeMember(
prop_name, prop_name,
BindingFlags.DeclaredOnly | BindingFlags.DeclaredOnly |
@@ -152,7 +151,7 @@ namespace VSTool
{ {
try try
{ {
Type objType = from_obj.GetType(); var objType = from_obj.GetType();
return objType.InvokeMember( return objType.InvokeMember(
method_name, method_name,
BindingFlags.DeclaredOnly | BindingFlags.DeclaredOnly |
@@ -171,40 +170,32 @@ namespace VSTool
throw e; throw e;
} }
} }
}; }
/// <summary> /// <summary>
/// The main entry point class for VSTool. /// The main entry point class for VSTool.
/// </summary> /// </summary>
class VSToolMain internal class VSToolMain
{ {
#region Interop imports private static readonly bool ignore_case = true;
[DllImport("ole32.dll")]
public static extern int GetRunningObjectTable(int reserved, out IRunningObjectTable prot);
[DllImport("ole32.dll")] private static string solution_name;
public static extern int CreateBindCtx(int reserved, out IBindCtx ppbc); private static bool use_new_vs;
#endregion private static readonly Hashtable projectDict = new Hashtable();
private static string startup_project;
private static string config;
static System.Boolean ignore_case = true; private static object dte;
private static object solution;
static string solution_name = null;
static bool use_new_vs = false;
static Hashtable projectDict = new Hashtable();
static string startup_project = null;
static string config = null;
static object dte = null;
static object solution = null;
/// <summary> /// <summary>
/// The main entry point for the application. /// The main entry point for the application.
/// </summary> /// </summary>
[STAThread] [STAThread]
static int Main(string[] args) private static int Main(string[] args)
{ {
int retVal = 0; var retVal = 0;
bool need_save = false; var need_save = false;
try try
{ {
@@ -212,7 +203,7 @@ namespace VSTool
Console.WriteLine("Editing solution: {0}", solution_name); Console.WriteLine("Editing solution: {0}", solution_name);
bool found_open_solution = GetDTEAndSolution(); var found_open_solution = GetDTEAndSolution();
if (dte == null || solution == null) if (dte == null || solution == null)
{ {
@@ -226,8 +217,8 @@ namespace VSTool
// and list the type of each project. // and list the type of each project.
foreach (DictionaryEntry p in projectDict) foreach (DictionaryEntry p in projectDict)
{ {
string project_name = (string)p.Key; var project_name = (string) p.Key;
string working_dir = (string)p.Value; var working_dir = (string) p.Value;
if (SetProjectWorkingDir(solution, project_name, working_dir)) if (SetProjectWorkingDir(solution, project_name, working_dir))
{ {
need_save = true; need_save = true;
@@ -279,7 +270,7 @@ namespace VSTool
public static bool parse_command_line(string[] args) public static bool parse_command_line(string[] args)
{ {
string options_desc = var options_desc =
"--solution <solution_name> : MSVC solution name. (required)\n" + "--solution <solution_name> : MSVC solution name. (required)\n" +
"--use_new_vs : Ignore running versions of visual studio.\n" + "--use_new_vs : Ignore running versions of visual studio.\n" +
"--workingdir <project> <dir> : Set working dir of a VC project.\n" + "--workingdir <project> <dir> : Set working dir of a VC project.\n" +
@@ -289,7 +280,7 @@ namespace VSTool
try try
{ {
// Command line param parsing loop. // Command line param parsing loop.
int i = 0; var i = 0;
for (; i < args.Length; ++i) for (; i < args.Length; ++i)
{ {
if ("--solution" == args[i]) if ("--solution" == args[i])
@@ -307,8 +298,8 @@ namespace VSTool
else if ("--workingdir" == args[i]) else if ("--workingdir" == args[i])
{ {
string project_name = args[++i]; var project_name = args[++i];
string working_dir = args[++i]; var working_dir = args[++i];
projectDict.Add(project_name, working_dir); projectDict.Add(project_name, working_dir);
} }
else if ("--config" == args[i]) else if ("--config" == args[i])
@@ -338,12 +329,11 @@ namespace VSTool
throw new ApplicationException("The --solution option is required."); throw new ApplicationException("The --solution option is required.");
} }
} }
catch(ApplicationException e) catch (ApplicationException e)
{ {
Console.WriteLine("Oops! " + e.Message); Console.WriteLine("Oops! " + e.Message);
Console.Write("Command line:"); Console.Write("Command line:");
foreach (string arg in args) foreach (var arg in args)
{ {
Console.Write(" " + arg); Console.Write(" " + arg);
} }
@@ -357,13 +347,13 @@ namespace VSTool
public static bool GetDTEAndSolution() public static bool GetDTEAndSolution()
{ {
bool found_open_solution = true; var found_open_solution = true;
Console.WriteLine("Looking for existing VisualStudio instance..."); Console.WriteLine("Looking for existing VisualStudio instance...");
// Get an instance of the currently running Visual Studio .NET IDE. // Get an instance of the currently running Visual Studio .NET IDE.
// dte = (EnvDTE.DTE)System.Runtime.InteropServices.Marshal.GetActiveObject("VisualStudio.DTE.7.1"); // dte = (EnvDTE.DTE)System.Runtime.InteropServices.Marshal.GetActiveObject("VisualStudio.DTE.7.1");
string full_solution_name = System.IO.Path.GetFullPath(solution_name); var full_solution_name = Path.GetFullPath(solution_name);
if (false == use_new_vs) if (false == use_new_vs)
{ {
dte = GetIDEInstance(full_solution_name); dte = GetIDEInstance(full_solution_name);
@@ -375,17 +365,17 @@ namespace VSTool
{ {
Console.WriteLine(" Didn't find open solution, starting new background VisualStudio instance..."); Console.WriteLine(" Didn't find open solution, starting new background VisualStudio instance...");
Console.WriteLine(" Reading .sln file version..."); Console.WriteLine(" Reading .sln file version...");
string version = GetSolutionVersion(full_solution_name); var version = GetSolutionVersion(full_solution_name);
Console.WriteLine(" Using version: {0}...", version); Console.WriteLine(" Using version: {0}...", version);
string progid = GetVSProgID(version); var progid = GetVSProgID(version);
Type objType = Type.GetTypeFromProgID(progid); var objType = Type.GetTypeFromProgID(progid);
dte = System.Activator.CreateInstance(objType); dte = Activator.CreateInstance(objType);
Console.WriteLine(" Reading solution: \"{0}\"", full_solution_name); Console.WriteLine(" Reading solution: \"{0}\"", full_solution_name);
solution = ViaCOM.GetProperty(dte, "Solution"); solution = ViaCOM.GetProperty(dte, "Solution");
object[] openArgs = { full_solution_name }; object[] openArgs = {full_solution_name};
ViaCOM.CallMethod(solution, "Open", openArgs); ViaCOM.CallMethod(solution, "Open", openArgs);
} }
catch (Exception e) catch (Exception e)
@@ -408,54 +398,57 @@ namespace VSTool
} }
/// <summary> /// <summary>
/// Get the DTE object for the instance of Visual Studio IDE that has /// Get the DTE object for the instance of Visual Studio IDE that has
/// the specified solution open. /// the specified solution open.
/// </summary> /// </summary>
/// <param name="solutionFile">The absolute filename of the solution</param> /// <param name="solutionFile">The absolute filename of the solution</param>
/// <returns>Corresponding DTE object or null if no such IDE is running</returns> /// <returns>Corresponding DTE object or null if no such IDE is running</returns>
public static object GetIDEInstance( string solutionFile ) public static object GetIDEInstance(string solutionFile)
{ {
Hashtable runningInstances = GetIDEInstances( true ); var runningInstances = GetIDEInstances(true);
IDictionaryEnumerator enumerator = runningInstances.GetEnumerator(); var enumerator = runningInstances.GetEnumerator();
while ( enumerator.MoveNext() ) while (enumerator.MoveNext())
{ {
try try
{ {
object ide = enumerator.Value; var ide = enumerator.Value;
if (ide != null) if (ide != null)
{ {
object sol = ViaCOM.GetProperty(ide, "Solution"); var sol = ViaCOM.GetProperty(ide, "Solution");
if (0 == string.Compare((string)ViaCOM.GetProperty(sol, "FullName"), solutionFile, ignore_case)) if (0 == string.Compare((string) ViaCOM.GetProperty(sol, "FullName"), solutionFile, ignore_case))
{ {
return ide; return ide;
} }
} }
} }
catch{} catch
{
// ignored
}
} }
return null; return null;
} }
/// <summary> /// <summary>
/// Get a table of the currently running instances of the Visual Studio .NET IDE. /// Get a table of the currently running instances of the Visual Studio .NET IDE.
/// </summary> /// </summary>
/// <param name="openSolutionsOnly">Only return instances that have opened a solution</param> /// <param name="openSolutionsOnly">Only return instances that have opened a solution</param>
/// <returns>A hashtable mapping the name of the IDE in the running object table to the corresponding DTE object</returns> /// <returns>A hashtable mapping the name of the IDE in the running object table to the corresponding DTE object</returns>
public static Hashtable GetIDEInstances( bool openSolutionsOnly ) public static Hashtable GetIDEInstances(bool openSolutionsOnly)
{ {
Hashtable runningIDEInstances = new Hashtable(); var runningIDEInstances = new Hashtable();
Hashtable runningObjects = GetRunningObjectTable(); var runningObjects = GetRunningObjectTable();
IDictionaryEnumerator rotEnumerator = runningObjects.GetEnumerator(); var rotEnumerator = runningObjects.GetEnumerator();
while ( rotEnumerator.MoveNext() ) while (rotEnumerator.MoveNext())
{ {
string candidateName = (string) rotEnumerator.Key; var candidateName = (string) rotEnumerator.Key;
if (!candidateName.StartsWith("!VisualStudio.DTE")) if (!candidateName.StartsWith("!VisualStudio.DTE"))
continue; continue;
object ide = rotEnumerator.Value; var ide = rotEnumerator.Value;
if (ide == null) if (ide == null)
continue; continue;
@@ -463,36 +456,39 @@ namespace VSTool
{ {
try try
{ {
object sol = ViaCOM.GetProperty(ide, "Solution"); var sol = ViaCOM.GetProperty(ide, "Solution");
string solutionFile = (string)ViaCOM.GetProperty(sol, "FullName"); var solutionFile = (string) ViaCOM.GetProperty(sol, "FullName");
if (solutionFile != String.Empty) if (solutionFile != string.Empty)
{ {
runningIDEInstances[ candidateName ] = ide; runningIDEInstances[candidateName] = ide;
} }
} }
catch {} catch
{
// ignored
}
} }
else else
{ {
runningIDEInstances[ candidateName ] = ide; runningIDEInstances[candidateName] = ide;
} }
} }
return runningIDEInstances; return runningIDEInstances;
} }
/// <summary> /// <summary>
/// Get a snapshot of the running object table (ROT). /// Get a snapshot of the running object table (ROT).
/// </summary> /// </summary>
/// <returns>A hashtable mapping the name of the object in the ROT to the corresponding object</returns> /// <returns>A hashtable mapping the name of the object in the ROT to the corresponding object</returns>
[STAThread] [STAThread]
public static Hashtable GetRunningObjectTable() public static Hashtable GetRunningObjectTable()
{ {
Hashtable result = new Hashtable(); var result = new Hashtable();
int numFetched = 0; var numFetched = 0;
IRunningObjectTable runningObjectTable; IRunningObjectTable runningObjectTable;
IEnumMoniker monikerEnumerator; IEnumMoniker monikerEnumerator;
IMoniker[] monikers = new IMoniker[1]; var monikers = new IMoniker[1];
GetRunningObjectTable(0, out runningObjectTable); GetRunningObjectTable(0, out runningObjectTable);
runningObjectTable.EnumRunning(out monikerEnumerator); runningObjectTable.EnumRunning(out monikerEnumerator);
@@ -507,9 +503,9 @@ namespace VSTool
monikers[0].GetDisplayName(ctx, null, out runningObjectName); monikers[0].GetDisplayName(ctx, null, out runningObjectName);
object runningObjectVal; object runningObjectVal;
runningObjectTable.GetObject( monikers[0], out runningObjectVal); runningObjectTable.GetObject(monikers[0], out runningObjectVal);
result[ runningObjectName ] = runningObjectVal; result[runningObjectName] = runningObjectVal;
} }
return result; return result;
@@ -518,22 +514,20 @@ namespace VSTool
public static string GetSolutionVersion(string solutionFullFileName) public static string GetSolutionVersion(string solutionFullFileName)
{ {
string version; string version;
System.IO.StreamReader solutionStreamReader = null; StreamReader solutionStreamReader = null;
string firstLine;
string format;
try try
{ {
solutionStreamReader = new System.IO.StreamReader(solutionFullFileName); solutionStreamReader = new StreamReader(solutionFullFileName);
string firstLine;
do do
{ {
firstLine = solutionStreamReader.ReadLine(); firstLine = solutionStreamReader.ReadLine();
} } while (firstLine == "");
while (firstLine == "");
format = firstLine.Substring(firstLine.LastIndexOf(" ")).Trim(); var format = firstLine.Substring(firstLine.LastIndexOf(" ")).Trim();
switch(format) switch (format)
{ {
case "7.00": case "7.00":
version = "VC70"; version = "VC70";
@@ -556,18 +550,16 @@ namespace VSTool
break; break;
case "12.00": case "12.00":
version = "VC120"; version = "VC140";
break; break;
default: default:
throw new ApplicationException("Unknown .sln version: " + format); throw new ApplicationException("Unknown .sln version: " + format);
} }
} }
finally finally
{ {
if(solutionStreamReader != null) solutionStreamReader?.Close();
{
solutionStreamReader.Close();
}
} }
return version; return version;
@@ -576,7 +568,7 @@ namespace VSTool
public static string GetVSProgID(string version) public static string GetVSProgID(string version)
{ {
string progid = null; string progid = null;
switch(version) switch (version)
{ {
case "VC70": case "VC70":
progid = "VisualStudio.DTE.7"; progid = "VisualStudio.DTE.7";
@@ -598,12 +590,8 @@ namespace VSTool
progid = "VisualStudio.DTE.10.0"; progid = "VisualStudio.DTE.10.0";
break; break;
case "VC110": case "VC140":
progid = "VisualStudio.DTE.11.0"; progid = "VisualStudio.DTE.14.0";
break;
case "VC120":
progid = "VisualStudio.DTE.12.0";
break; break;
default: default:
@@ -615,23 +603,23 @@ namespace VSTool
public static bool SetProjectWorkingDir(object sol, string project_name, string working_dir) public static bool SetProjectWorkingDir(object sol, string project_name, string working_dir)
{ {
bool made_change = false; var made_change = false;
Console.WriteLine("Looking for project {0}...", project_name); Console.WriteLine("Looking for project {0}...", project_name);
try try
{ {
object prjs = ViaCOM.GetProperty(sol, "Projects"); var prjs = ViaCOM.GetProperty(sol, "Projects");
object count = ViaCOM.GetProperty(prjs, "Count"); var count = ViaCOM.GetProperty(prjs, "Count");
for(int i = 1; i <= (int)count; ++i) for (var i = 1; i <= (int) count; ++i)
{ {
object[] prjItemArgs = { (object)i }; object[] prjItemArgs = {i};
object prj = ViaCOM.CallMethod(prjs, "Item", prjItemArgs); var prj = ViaCOM.CallMethod(prjs, "Item", prjItemArgs);
string name = (string)ViaCOM.GetProperty(prj, "Name"); var name = (string) ViaCOM.GetProperty(prj, "Name");
if (0 == string.Compare(name, project_name, ignore_case)) if (0 == string.Compare(name, project_name, ignore_case))
{ {
Console.WriteLine("Found project: {0}", project_name); Console.WriteLine("Found project: {0}", project_name);
Console.WriteLine("Setting working directory"); Console.WriteLine("Setting working directory");
string full_project_name = (string)ViaCOM.GetProperty(prj, "FullName"); var full_project_name = (string) ViaCOM.GetProperty(prj, "FullName");
Console.WriteLine(full_project_name); Console.WriteLine(full_project_name);
// *NOTE:Mani Thanks to incompatibilities between different versions of the // *NOTE:Mani Thanks to incompatibilities between different versions of the
@@ -642,17 +630,17 @@ namespace VSTool
// without the type casting. Its tedious code, but it seems to work. // without the type casting. Its tedious code, but it seems to work.
// oCfgs should be assigned to a 'Project.Configurations' collection. // oCfgs should be assigned to a 'Project.Configurations' collection.
object oCfgs = ViaCOM.GetProperty(ViaCOM.GetProperty(prj, "Object"), "Configurations"); var oCfgs = ViaCOM.GetProperty(ViaCOM.GetProperty(prj, "Object"), "Configurations");
// oCount will be assigned to the number of configs present in oCfgs. // oCount will be assigned to the number of configs present in oCfgs.
object oCount = ViaCOM.GetProperty(oCfgs, "Count"); var oCount = ViaCOM.GetProperty(oCfgs, "Count");
for (int cfgIndex = 1; cfgIndex <= (int)oCount; ++cfgIndex) for (var cfgIndex = 1; cfgIndex <= (int) oCount; ++cfgIndex)
{ {
object[] itemArgs = {(object)cfgIndex}; object[] itemArgs = {cfgIndex};
object oCfg = ViaCOM.CallMethod(oCfgs, "Item", itemArgs); var oCfg = ViaCOM.CallMethod(oCfgs, "Item", itemArgs);
object oDebugSettings = ViaCOM.GetProperty(oCfg, "DebugSettings"); var oDebugSettings = ViaCOM.GetProperty(oCfg, "DebugSettings");
ViaCOM.SetProperty(oDebugSettings, "WorkingDirectory", (object)working_dir); ViaCOM.SetProperty(oDebugSettings, "WorkingDirectory", working_dir);
} }
break; break;
@@ -660,7 +648,7 @@ namespace VSTool
} }
made_change = true; made_change = true;
} }
catch( Exception e ) catch (Exception e)
{ {
Console.WriteLine(e.Message); Console.WriteLine(e.Message);
Console.WriteLine("Failed to set working dir for project, {0}.", project_name); Console.WriteLine("Failed to set working dir for project, {0}.", project_name);
@@ -671,22 +659,22 @@ namespace VSTool
public static bool SetStartupProject(string startup_project) public static bool SetStartupProject(string startup_project)
{ {
bool result = false; var result = false;
try try
{ {
// You need the 'unique name of the project to set StartupProjects. // You need the 'unique name of the project to set StartupProjects.
// find the project by generic name. // find the project by generic name.
Console.WriteLine("Trying to set \"{0}\" to the startup project", startup_project); Console.WriteLine("Trying to set \"{0}\" to the startup project", startup_project);
object prjs = ViaCOM.GetProperty(solution, "Projects"); var prjs = ViaCOM.GetProperty(solution, "Projects");
object count = ViaCOM.GetProperty(prjs, "Count"); var count = ViaCOM.GetProperty(prjs, "Count");
for (int i = 1; i <= (int)count; ++i) for (var i = 1; i <= (int) count; ++i)
{ {
object[] itemArgs = { (object)i }; object[] itemArgs = {i};
object prj = ViaCOM.CallMethod(prjs, "Item", itemArgs); var prj = ViaCOM.CallMethod(prjs, "Item", itemArgs);
object prjName = ViaCOM.GetProperty(prj, "Name"); var prjName = ViaCOM.GetProperty(prj, "Name");
if (0 == string.Compare((string)prjName, startup_project, ignore_case)) if (0 == string.Compare((string) prjName, startup_project, ignore_case))
{ {
object solBuild = ViaCOM.GetProperty(solution, "SolutionBuild"); var solBuild = ViaCOM.GetProperty(solution, "SolutionBuild");
ViaCOM.SetProperty(solBuild, "StartupProjects", ViaCOM.GetProperty(prj, "UniqueName")); ViaCOM.SetProperty(solBuild, "StartupProjects", ViaCOM.GetProperty(prj, "UniqueName"));
Console.WriteLine(" Success!"); Console.WriteLine(" Success!");
result = true; result = true;
@@ -709,14 +697,14 @@ namespace VSTool
public static bool SetActiveConfig(string config) public static bool SetActiveConfig(string config)
{ {
bool result = false; var result = false;
try try
{ {
Console.WriteLine("Trying to set active config to \"{0}\"", config); Console.WriteLine("Trying to set active config to \"{0}\"", config);
object solBuild = ViaCOM.GetProperty(solution, "SolutionBuild"); var solBuild = ViaCOM.GetProperty(solution, "SolutionBuild");
object solCfgs = ViaCOM.GetProperty(solBuild, "SolutionConfigurations"); var solCfgs = ViaCOM.GetProperty(solBuild, "SolutionConfigurations");
object[] itemArgs = { (object)config }; object[] itemArgs = {config};
object solCfg = ViaCOM.CallMethod(solCfgs, "Item", itemArgs); var solCfg = ViaCOM.CallMethod(solCfgs, "Item", itemArgs);
ViaCOM.CallMethod(solCfg, "Activate", null); ViaCOM.CallMethod(solCfg, "Activate", null);
Console.WriteLine(" Success!"); Console.WriteLine(" Success!");
result = true; result = true;
@@ -728,5 +716,15 @@ namespace VSTool
} }
return result; return result;
} }
#region Interop imports
[DllImport("ole32.dll")]
public static extern int GetRunningObjectTable(int reserved, out IRunningObjectTable prot);
[DllImport("ole32.dll")]
public static extern int CreateBindCtx(int reserved, out IBindCtx ppbc);
#endregion
} }
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -4245,6 +4245,10 @@ version 2.0
{ ObjectOwner Variable 1 } { ObjectOwner Variable 1 }
{ Questions S32 } { Questions S32 }
} }
{
Experience Single
{ ExperienceID LLUUID }
}
} }
// ScriptControlChange // ScriptControlChange

View File

@@ -0,0 +1 @@
326aaa0f3f77faaa62aac6675f2c9c17f5d14116

View File

@@ -0,0 +1,105 @@
#!/usr/bin/env python2
"""\
This module formats the package version and copyright information for the
viewer and its dependent packages.
$LicenseInfo:firstyear=2014&license=viewerlgpl$
Second Life Viewer Source Code
Copyright (C) 2014, Linden Research, Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation;
version 2.1 of the License only.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
$/LicenseInfo$
"""
import os
import sys
import errno
import re
import subprocess
import argparse
parser = argparse.ArgumentParser()
parser.add_argument(
'-p', '--platform',
default=None,
dest='platform',
help='Override the automatically determined platform.')
parsedargs = parser.parse_args()
_autobuild=os.getenv('AUTOBUILD', 'autobuild')
pkg_line=re.compile('^([\w-]+):\s+(.*)$')
def autobuild(*args):
"""
Launch autobuild with specified command-line arguments.
Return its stdout pipe from which the caller can read.
"""
# subprocess wants a list, not a tuple
temp = list(args)
if parsedargs.platform is not None :
temp.append("-p=" + str(parsedargs.platform))
command = [_autobuild] + temp
try:
child = subprocess.Popen(command,
stdin=None, stdout=subprocess.PIPE,
universal_newlines=True)
except OSError as err:
if err.errno != errno.ENOENT:
# Don't attempt to interpret anything but ENOENT
raise
# Here it's ENOENT: subprocess can't find the autobuild executable.
print >>sys.stderr, "packages-formatter on %s: can't run autobuild:\n%s\n%s" % \
(sys.platform, ' '.join(command), err)
sys.exit(1)
# no exceptions yet, let caller read stdout
return child.stdout
version={}
versions=autobuild('install', '--versions')
for line in versions:
pkg_info = pkg_line.match(line)
if pkg_info:
pkg = pkg_info.group(1)
if pkg not in version:
version[pkg] = pkg_info.group(2).strip()
else:
sys.exit("Duplicate version for %s" % pkg)
else:
sys.exit("Unrecognized --versions output: %s" % line)
copyright={}
copyrights=autobuild('install', '--copyrights')
viewer_copyright = copyrights.readline() # first line is the copyright for the viewer itself
for line in copyrights:
pkg_info = pkg_line.match(line)
if pkg_info:
pkg = pkg_info.group(1)
if pkg not in copyright:
copyright[pkg] = pkg_info.group(2).strip()
else:
sys.exit("Duplicate copyright for %s" % pkg)
else:
sys.exit("Unrecognized --copyrights output: %s" % line)
print viewer_copyright
for pkg in sorted(version):
print ': '.join([pkg, version[pkg]])
if pkg in copyright:
print copyright[pkg]
else:
sys.exit("No copyright for %s" % pkg)

View File

@@ -1,33 +1,27 @@
#!/usr/bin/python #!/usr/bin/env python
"""\ """\
@file template_verifier.py @file template_verifier.py
@brief Message template compatibility verifier. @brief Message template compatibility verifier.
$LicenseInfo:firstyear=2007&license=viewergpl$ $LicenseInfo:firstyear=2007&license=viewerlgpl$
Copyright (c) 2007-2009, Linden Research, Inc.
Second Life Viewer Source Code Second Life Viewer Source Code
The source code in this file ("Source Code") is provided by Linden Lab Copyright (C) 2010, Linden Research, Inc.
to you under the terms of the GNU General Public License, version 2.0
("GPL"), unless you have obtained a separate licensing agreement
("Other License"), formally executed by you and Linden Lab. Terms of
the GPL can be found in doc/GPL-license.txt in this distribution, or
online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
There are special exceptions to the terms and conditions of the GPL as This library is free software; you can redistribute it and/or
it is applied to this Source Code. View the full text of the exception modify it under the terms of the GNU Lesser General Public
in the file doc/FLOSS-exception.txt in this software distribution, or License as published by the Free Software Foundation;
online at version 2.1 of the License only.
http://secondlifegrid.net/programs/open_source/licensing/flossexception
By copying, modifying or distributing this software, you acknowledge This library is distributed in the hope that it will be useful,
that you have read and understood your obligations described above, but WITHOUT ANY WARRANTY; without even the implied warranty of
and agree to abide by those obligations. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO You should have received a copy of the GNU Lesser General Public
WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, License along with this library; if not, write to the Free Software
COMPLETENESS OR PERFORMANCE. Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA
$/LicenseInfo$ $/LicenseInfo$
""" """
@@ -72,6 +66,7 @@ add_indra_lib_path()
import optparse import optparse
import os import os
import urllib import urllib
import hashlib
from indra.ipc import compatibility from indra.ipc import compatibility
from indra.ipc import tokenstream from indra.ipc import tokenstream
@@ -203,8 +198,13 @@ def getuser():
import getpass import getpass
return getpass.getuser() return getpass.getuser()
except ImportError: except ImportError:
import win32api import ctypes
return win32api.GetUserName() MAX_PATH = 260 # according to a recent WinDef.h
name = ctypes.create_unicode_buffer(MAX_PATH)
namelen = ctypes.c_int(len(name)) # len in chars, NOT bytes
if not ctypes.windll.advapi32.GetUserNameW(name, ctypes.byref(namelen)):
raise ctypes.WinError()
return name.value
def local_master_cache_filename(): def local_master_cache_filename():
"""Returns the location of the master template cache (which is in the system tempdir) """Returns the location of the master template cache (which is in the system tempdir)
@@ -229,11 +229,14 @@ http://wiki.secondlife.com/wiki/Template_verifier.py
""") """)
parser.add_option( parser.add_option(
'-u', '--master_url', type='string', dest='master_url', '-u', '--master_url', type='string', dest='master_url',
default='http://secondlife.com/app/message_template/master_message_template.msg', default='http://bitbucket.org/lindenlab/master-message-template/raw/tip/message_template.msg',
help="""The url of the master message template.""") help="""The url of the master message template.""")
parser.add_option( parser.add_option(
'-c', '--cache_master', action='store_true', dest='cache_master', '-c', '--cache_master', action='store_true', dest='cache_master',
default=False, help="""Set to true to attempt use local cached copy of the master template.""") default=False, help="""Set to true to attempt use local cached copy of the master template.""")
parser.add_option(
'-f', '--force', action='store_true', dest='force_verification',
default=False, help="""Set to true to skip the sha_1 check and force template verification.""")
options, args = parser.parse_args(sysargs) options, args = parser.parse_args(sysargs)
@@ -270,8 +273,18 @@ http://wiki.secondlife.com/wiki/Template_verifier.py
print "current:", current_filename print "current:", current_filename
current_url = 'file://%s' % current_filename current_url = 'file://%s' % current_filename
# retrieve the contents of the local template and check for syntax # retrieve the contents of the local template
current = fetch(current_url) current = fetch(current_url)
hexdigest = hashlib.sha1(current).hexdigest()
if not options.force_verification:
# Early exist if the template hasn't changed.
sha_url = "%s.sha1" % current_url
current_sha = fetch(sha_url)
if hexdigest == current_sha:
print "Message template SHA_1 has not changed."
sys.exit(0)
# and check for syntax
current_parsed = llmessage.parseTemplateString(current) current_parsed = llmessage.parseTemplateString(current)
if options.cache_master: if options.cache_master:
@@ -302,9 +315,17 @@ http://wiki.secondlife.com/wiki/Template_verifier.py
if acceptable: if acceptable:
explain("--- PASS ---", compat) explain("--- PASS ---", compat)
if options.force_verification == False:
print "Updating sha1 to %s" % hexdigest
sha_filename = "%s.sha1" % current_filename
sha_file = open(sha_filename, 'w')
sha_file.write(hexdigest)
sha_file.close()
else: else:
explain("*** FAIL ***", compat) explain("*** FAIL ***", compat)
return 1 return 1
if __name__ == '__main__': if __name__ == '__main__':
sys.exit(run(sys.argv[1:])) sys.exit(run(sys.argv[1:]))