From 5e71d9578fb09aa1dff04c40f0a367290e21f6b2 Mon Sep 17 00:00:00 2001 From: Drake Arconis Date: Fri, 30 Nov 2012 11:17:10 -0500 Subject: [PATCH 1/5] A bit of cleanup in preperation for VS2012 --- indra/cmake/00-Common.cmake | 61 +++++++++++-------------------------- indra/develop.py | 24 +++------------ 2 files changed, 22 insertions(+), 63 deletions(-) diff --git a/indra/cmake/00-Common.cmake b/indra/cmake/00-Common.cmake index 5eaca5c32..12009e570 100644 --- a/indra/cmake/00-Common.cmake +++ b/indra/cmake/00-Common.cmake @@ -23,28 +23,32 @@ set(CMAKE_CONFIGURATION_TYPES "RelWithDebInfo;Release;Debug" CACHE STRING # Platform-specific compilation flags. 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) + endif (MSVC10) + # Remove default /Zm1000 flag that cmake inserts string (REPLACE "/Zm1000" " " CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) # Don't build DLLs. set(BUILD_SHARED_LIBS OFF) - set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Od /Zi /MDd /arch:SSE2" + set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Od /Zi /MDd" CACHE STRING "C++ compiler debug options" FORCE) set(CMAKE_CXX_FLAGS_RELWITHDEBINFO - "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Od /Zi /MD /MP /arch:SSE2" + "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /Od /Zi /MD /MP" CACHE STRING "C++ compiler release-with-debug options" FORCE) set(CMAKE_CXX_FLAGS_RELEASE - "${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /O2 /Zi /MD /MP /arch:SSE2 /fp:fast" + "${CMAKE_CXX_FLAGS_RELEASE} ${LL_CXX_FLAGS} /O2 /Zi /MD /MP /fp:fast -D_SECURE_STL=0 -D_HAS_ITERATOR_DEBUGGING=0" CACHE STRING "C++ compiler release options" FORCE) set(CMAKE_C_FLAGS_RELEASE - "${CMAKE_C_FLAGS_RELEASE} ${LL_C_FLAGS} /O2 /Zi /MD /MP /arch:SSE2 /fp:fast" + "${CMAKE_C_FLAGS_RELEASE} ${LL_C_FLAGS} /O2 /Zi /MD /MP /fp:fast" CACHE STRING "C compiler release options" FORCE) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /LARGEADDRESSAWARE") - if(NOT CMAKE_EXE_LINKER_FLAGS_RELEASE MATCHES LARGEADDRESSAWARE) - set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /LARGEADDRESSAWARE") - endif() - set(CMAKE_CXX_STANDARD_LIBRARIES "") set(CMAKE_C_STANDARD_LIBRARIES "") @@ -57,54 +61,25 @@ if (WINDOWS) /W3 /c /Zc:forScope + /Zc:wchar_t- /nologo /Oy- + /arch:SSE2 ) - + # configure win32 API for windows XP+ compatibility 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}") - if(MSVC80 OR MSVC90 OR MSVC10) - set(CMAKE_CXX_FLAGS_RELEASE - "${CMAKE_CXX_FLAGS_RELEASE} -D_SECURE_STL=0 -D_HAS_ITERATOR_DEBUGGING=0" - CACHE STRING "C++ compiler release options" FORCE) - set(CMAKE_C_FLAGS_RELEASE - "${CMAKE_C_FLAGS_RELEASE}" CACHE STRING "C compiler release options" FORCE) - add_definitions( - /Zc:wchar_t- - ) - endif (MSVC80 OR MSVC90 OR MSVC10) - # Are we using the crummy Visual Studio KDU build workaround? if (NOT DISABLE_FATAL_WARNINGS) add_definitions(/WX) endif (NOT DISABLE_FATAL_WARNINGS) - - # 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 (MSVC71) - set(MSVC_DIR 7.1) - set(MSVC_SUFFIX 71) - elseif (MSVC80) - set(MSVC_DIR 8.0) - set(MSVC_SUFFIX 80) - elseif (MSVC90) - set(MSVC_DIR 9.0) - set(MSVC_SUFFIX 90) - elseif (MSVC10) - set(MSVC_DIR 10.0) - set(MSVC_SUFFIX 100) - endif (MSVC71) - if (MSVC10) - SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_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") - endif(MSVC10) + SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_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") - endif (WINDOWS) set (GCC_EXTRA_OPTIMIZATIONS "-ffast-math") diff --git a/indra/develop.py b/indra/develop.py index 5e94ca125..60bc7f387 100755 --- a/indra/develop.py +++ b/indra/develop.py @@ -473,26 +473,11 @@ class DarwinSetup(UnixSetup): class WindowsSetup(PlatformSetup): gens = { - 'vc71' : { - 'gen' : r'Visual Studio 7 .NET 2003', - 'ver' : r'7.1' - }, - 'vc80' : { - 'gen' : r'Visual Studio 8 2005', - 'ver' : r'8.0' - }, - 'vc90' : { - 'gen' : r'Visual Studio 9 2008', - 'ver' : r'9.0' - }, 'vc100' : { 'gen' : r'Visual Studio 10', 'ver' : r'10.0' } } - gens['vs2003'] = gens['vc71'] - gens['vs2005'] = gens['vc80'] - gens['vs2008'] = gens['vc90'] gens['vs2010'] = gens['vc100'] search_path = r'C:\windows' @@ -505,21 +490,21 @@ class WindowsSetup(PlatformSetup): def _get_generator(self): if self._generator is None: - for version in 'vc80 vc90 vc100 vc71'.split(): + 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 'vc80 vc90 vc100 vc71'.split(): + 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 'vc80 vc90 vc100 vc71'.split(): + for version in 'vc100'.split(): if self.find_visual_studio_express_single(version): self._generator = version self.using_express = True @@ -768,8 +753,7 @@ Options: -m32 | -m64 build architecture (32-bit or 64-bit) -N | --no-distcc disable use of distcc -G | --generator=NAME generator name - Windows: VC71 or VS2003 (default), VC80 (VS2005) - VC90 (VS2008), or VC100 (VS2010) + 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) From 364cf1ec73c4f91486f740c160c3217cddf3ef63 Mon Sep 17 00:00:00 2001 From: Drake Arconis Date: Sun, 6 Jan 2013 09:47:02 -0500 Subject: [PATCH 2/5] Bug fix from v3 --- indra/newview/lltoolcomp.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/lltoolcomp.cpp b/indra/newview/lltoolcomp.cpp index 554ace032..2a79e0c32 100644 --- a/indra/newview/lltoolcomp.cpp +++ b/indra/newview/lltoolcomp.cpp @@ -491,7 +491,7 @@ BOOL LLToolCompCreate::handleMouseDown(S32 x, S32 y, MASK mask) mObjectPlacedOnMouseDown = TRUE; - return TRUE; + return handled; } void LLToolCompCreate::pickCallback(const LLPickInfo& pick_info) From 6d379448be58b82e598b7dc98b7a555478a4a131 Mon Sep 17 00:00:00 2001 From: Drake Arconis Date: Mon, 7 Jan 2013 11:59:25 -0500 Subject: [PATCH 3/5] Fixed a build issue in clang --- indra/llcommon/llthread.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h index 549a090ec..b8093ef82 100644 --- a/indra/llcommon/llthread.h +++ b/indra/llcommon/llthread.h @@ -33,7 +33,7 @@ #ifndef LL_LLTHREAD_H #define LL_LLTHREAD_H -#ifdef __GNUC__ +#if (defined(__GNUC__) && !defined(__clang__)) // Needed for is_main_thread() when compiling with optimization (relwithdebinfo). // It doesn't hurt to just always specify it though. #pragma interface From bc3ad59dd5c5654bf7de2ad1f0b569830136b9eb Mon Sep 17 00:00:00 2001 From: Drake Arconis Date: Tue, 8 Jan 2013 06:16:28 -0500 Subject: [PATCH 4/5] Revert "Fixed a build issue in clang" This reverts commit 6d379448be58b82e598b7dc98b7a555478a4a131. --- indra/llcommon/llthread.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llcommon/llthread.h b/indra/llcommon/llthread.h index b8093ef82..549a090ec 100644 --- a/indra/llcommon/llthread.h +++ b/indra/llcommon/llthread.h @@ -33,7 +33,7 @@ #ifndef LL_LLTHREAD_H #define LL_LLTHREAD_H -#if (defined(__GNUC__) && !defined(__clang__)) +#ifdef __GNUC__ // Needed for is_main_thread() when compiling with optimization (relwithdebinfo). // It doesn't hurt to just always specify it though. #pragma interface From 9f7e81cec2f75d4f30f9cb1dd73ec6841ef69dac Mon Sep 17 00:00:00 2001 From: Drake Arconis Date: Tue, 8 Jan 2013 06:17:39 -0500 Subject: [PATCH 5/5] Alt Compiler fixes --- indra/llcommon/llhash.h | 2 +- indra/llcommon/llprocessor.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/llcommon/llhash.h b/indra/llcommon/llhash.h index c0a8bff66..5737f22c4 100644 --- a/indra/llcommon/llhash.h +++ b/indra/llcommon/llhash.h @@ -39,7 +39,7 @@ #include #include #elif LL_DARWIN || LL_LINUX -#if GCC_VERSION >= 40300 || LL_ICC// gcc 4.3 or icc 11 and up +#if GCC_VERSION >= 40300 || LL_ICC || LL_CLANG// gcc 4.3 or icc 11 and up # include #elif GCC_VERSION >= 30400 // gcc 3.4 and up # include diff --git a/indra/llcommon/llprocessor.cpp b/indra/llcommon/llprocessor.cpp index 9532410b7..b05b525d0 100644 --- a/indra/llcommon/llprocessor.cpp +++ b/indra/llcommon/llprocessor.cpp @@ -794,7 +794,7 @@ private: LLPI_SET_INFO_INT(eModel, "model"); - S32 family; + S32 family = 0; if (!cpuinfo["cpu family"].empty() && LLStringUtil::convertToS32(cpuinfo["cpu family"], family)) {