Build fixes for C++11 on OS X. Includes several rebuilt libraries.

master
Tonya Souther 2016-06-21 15:57:18 -05:00
parent 4e47e36e98
commit cc4ef52b97
19 changed files with 57 additions and 42 deletions

View File

@ -71,9 +71,9 @@
<key>archive</key>
<map>
<key>hash</key>
<string>370de49a91ce91516697db8968f5e8b0</string>
<string>47ddd059d48f650e39796c10ea828689</string>
<key>url</key>
<string>http://downloads.phoenixviewer.com/ndPhysicsStub-1.0-darwin-201505191946-r76.tar.bz2</string>
<string>http://downloads.phoenixviewer.com/ndPhysicsStub-1.0-darwin-201606211534-r77.tar.bz2</string>
</map>
<key>name</key>
<string>darwin</string>
@ -295,9 +295,9 @@
<key>archive</key>
<map>
<key>hash</key>
<string>d0abfb393024eea8cffdfde3ec5b673d</string>
<string>72b06fb0bbc1d52179abf8bd8db9b2df</string>
<key>url</key>
<string>http://downloads.phoenixviewer.com/boost-1.57-darwin-201505120538-r136.tar.bz2</string>
<string>http://downloads.phoenixviewer.com/boost-1.57-darwin64-201606171648.tar.bz2</string>
</map>
<key>name</key>
<string>darwin</string>
@ -347,9 +347,9 @@
<key>archive</key>
<map>
<key>hash</key>
<string>b93d42a16c5a9e6731ca57d363c231e0</string>
<string>a1964fea0954d31c3aa29ae196b17f8f</string>
<key>url</key>
<string>http://downloads.phoenixviewer.com/colladadom-2.3.201505131932-r98-darwin-201505131932-r98.tar.bz2</string>
<string>http://downloads.phoenixviewer.com/colladadom-2.3.201606172015-darwin-201606172015.tar.bz2</string>
</map>
<key>name</key>
<string>darwin</string>
@ -975,9 +975,9 @@
<key>archive</key>
<map>
<key>hash</key>
<string>af760536a469b6e28df675d4c7eca54b</string>
<string>9253e0ebde03d4c2161dfeaf02565758</string>
<key>url</key>
<string>http://downloads.phoenixviewer.com/google_breakpad-1413.201505171732-r96-darwin-201505171732-r96.tar.bz2</string>
<string>http://downloads.phoenixviewer.com/google_breakpad-1413.201606211136-r97-darwin-201606211136-r97.tar.bz2</string>
</map>
<key>name</key>
<string>darwin</string>
@ -1301,9 +1301,9 @@
<key>archive</key>
<map>
<key>hash</key>
<string>bf4bb114d861213eb946c6e8b7e35178</string>
<string>a087b1642025efa765e47e8149b026ee</string>
<key>url</key>
<string>http://downloads.phoenixviewer.com/jsoncpp-0.5.0.201508041108-r34-darwin-201508041108-r34.tar.bz2</string>
<string>http://downloads.phoenixviewer.com/jsoncpp-0.5.0.201606172236-r32-darwin-201606172236-r32.tar.bz2</string>
</map>
<key>name</key>
<string>darwin</string>
@ -2135,9 +2135,9 @@
<key>archive</key>
<map>
<key>hash</key>
<string>64b2e1e2e4869c56c235ba43c1e66bdb</string>
<string>582d360d195d3dfb48695cb5e206cbf1</string>
<key>url</key>
<string>http://downloads.phoenixviewer.com/pcre-8.35.-darwin-201505122041-r52.tar.bz2</string>
<string>http://downloads.phoenixviewer.com/pcre-8.35.-darwin-201606171942.tar.bz2</string>
</map>
<key>name</key>
<string>darwin</string>

View File

@ -312,6 +312,9 @@ if (DARWIN)
set(CMAKE_CXX_LINK_FLAGS "-Wl,-no_compact_unwind -Wl,-headerpad_max_install_names,-search_paths_first")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_CXX_LINK_FLAGS}")
set(DARWIN_extra_cstar_flags "-g -Wno-unused-local-typedef -Wno-deprecated-declarations")
# <FS:TS> Take a deep breath and turn on C++11...
set(DARWIN_extra_cstar_flags "-std=c++11 -stdlib=libc++ -Wno-overloaded-virtual ${DARWIN_extra_cstar_flags}")
# </FS:TS>
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DARWIN_extra_cstar_flags}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${DARWIN_extra_cstar_flags}")
# NOTE: it's critical that the optimization flag is put in front.

View File

@ -152,16 +152,18 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(DARWIN 1)
# now we only support Xcode 6.0 using 10.9 (Mavericks), minimum OS 10.7 (Lion)
set(XCODE_VERSION 6.0)
set(XCODE_VERSION 7.3)
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.7)
set(CMAKE_OSX_SYSROOT macosx10.9)
set(CMAKE_OSX_SYSROOT macosx10.11)
set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvm.clang.1_0")
set(CMAKE_XCODE_ATTRIBUTE_GCC_OPTIMIZATION_LEVEL 3)
set(CMAKE_XCODE_ATTRIBUTE_GCC_STRICT_ALIASING NO)
set(CMAKE_XCODE_ATTRIBUTE_GCC_FAST_MATH NO)
set(CMAKE_XCODE_ATTRIBUTE_CLANG_X86_VECTOR_INSTRUCTIONS ssse3)
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libstdc++")
# <FS:TS> Need libc++ for C++11 and Boost
#set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libstdc++")
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT dwarf-with-dsym)
# Build only for i386 by default, system default on MacOSX 10.6+ is x86_64

View File

@ -45,7 +45,10 @@ typedef FILE LLFILE;
typedef struct _stat llstat;
#else
typedef struct stat llstat;
#include <bits/postypes.h>
//<FS:TS> This file only exists on Linux
# if LL_LINUX
# include <bits/postypes.h>
# endif
#endif
#ifndef S_ISREG

View File

@ -201,7 +201,7 @@
#elif LL_LINUX
#define LL_TYPEOF(exp) typeof(exp)
#elif LL_DARWIN
#define LL_TYPEOF(exp) typeof(exp)
#define LL_TYPEOF(exp) decltype(exp)
#endif
#define LL_TO_STRING_HELPER(x) #x

View File

@ -444,7 +444,7 @@ public:
struct LLDictionaryLess
{
public:
bool operator()(const std::string& a, const std::string& b)
bool operator()(const std::string& a, const std::string& b) const
{
return (LLStringUtil::precedesDict(a, b) ? true : false);
}

View File

@ -122,7 +122,7 @@ LLColor4 LLColor4::cyan6(0.2f, 0.6f, 0.6f, 1.0f);
//////////////////////////////////////////////////////////////////////////////
// conversion
LLColor4::operator const LLColor4U() const
LLColor4::operator /*const*/ LLColor4U() const
{
return LLColor4U(
(U8)llclampb(ll_round(mV[VRED]*255.f)),

View File

@ -131,7 +131,7 @@ class LLColor4
friend const LLColor4& operator*=(LLColor4 &a, const LLColor4 &b); // Doesn't multiply alpha! (for lighting)
// conversion
operator const LLColor4U() const;
operator /*const*/ LLColor4U() const;
// Basic color values.
static LLColor4 red;

View File

@ -130,7 +130,7 @@ public:
static BOOL parseColor4U(const std::string& buf, LLColor4U* value);
// conversion
operator const LLColor4() const
operator /*const*/ LLColor4() const
{
return LLColor4(*this);
}

View File

@ -126,7 +126,7 @@ private:
F32 mValue;
LLUIColor mColor;
bool operator <(const Threshold& other)
bool operator <(const Threshold& other) const
{
return mValue < other.mValue;
}

View File

@ -236,8 +236,8 @@ attributedStringInfo getSegments(NSAttributedString *str)
NSOpenGLPFADoubleBuffer,
NSOpenGLPFAClosestPolicy,
NSOpenGLPFAAccelerated,
NSOpenGLPFASampleBuffers, (samples > 0 ? 1 : 0),
NSOpenGLPFASamples, samples,
NSOpenGLPFASampleBuffers, static_cast<NSOpenGLPixelFormatAttribute>(samples > 0 ? 1 : 0),
NSOpenGLPFASamples, static_cast<NSOpenGLPixelFormatAttribute>(samples),
NSOpenGLPFAStencilSize, 8,
NSOpenGLPFADepthSize, 24,
NSOpenGLPFAAlphaSize, 8,
@ -380,8 +380,8 @@ attributedStringInfo getSegments(NSAttributedString *str)
- (void)mouseMoved:(NSEvent *)theEvent
{
float mouseDeltas[2] = {
[theEvent deltaX],
[theEvent deltaY]
static_cast<float>([theEvent deltaX]),
static_cast<float>([theEvent deltaY])
};
callDeltaUpdate(mouseDeltas, 0);
@ -401,8 +401,8 @@ attributedStringInfo getSegments(NSAttributedString *str)
// The old CoreGraphics APIs we previously relied on are now flagged as obsolete.
// NSEvent isn't obsolete, and provides us with the correct deltas.
float mouseDeltas[2] = {
[theEvent deltaX],
[theEvent deltaY]
static_cast<float>([theEvent deltaX]),
static_cast<float>([theEvent deltaY])
};
callDeltaUpdate(mouseDeltas, 0);
@ -604,13 +604,13 @@ attributedStringInfo getSegments(NSAttributedString *str)
if (mMarkedTextAllowed)
{
unsigned int selected[2] = {
selectedRange.location,
selectedRange.length
static_cast<unsigned int>(selectedRange.location),
static_cast<unsigned int>(selectedRange.length)
};
unsigned int replacement[2] = {
replacementRange.location,
replacementRange.length
static_cast<unsigned int>(replacementRange.location),
static_cast<unsigned int>(replacementRange.length)
};
int string_length = [aString length];

View File

@ -553,7 +553,7 @@ void getPreeditLocation(float *location, unsigned int length)
preeditor->getPreeditLocation(length, &coord, &rect, NULL);
float c[4] = {coord.mX, coord.mY, 0, 0};
float c[4] = {static_cast<float>(coord.mX), static_cast<float>(coord.mY), 0, 0};
convertRectToScreen(gWindowImplementation->getWindow(), c);
@ -909,7 +909,7 @@ BOOL LLWindowMacOSX::setPosition(const LLCoordScreen position)
{
if(mWindow)
{
float pos[2] = {position.mX, position.mY};
float pos[2] = {static_cast<float>(position.mX), static_cast<float>(position.mY)};
setWindowPos(mWindow, pos);
}

View File

@ -109,7 +109,9 @@
callWindowUnhide();
}
- (NSApplicationDelegateReply) applicationShouldTerminate:(NSApplication *)sender
//<FS:TS> This got changed at some point in the SDK.
//- (NSApplicationDelegateReply) applicationShouldTerminate:(NSApplication *)sender
- (NSApplicationTerminateReply) applicationShouldTerminate:(NSApplication *)sender
{
if (!runMainLoop())
{

View File

@ -297,7 +297,7 @@ void LLAppViewerMacOSX::initCrashReporting(bool reportFreeze)
std::string appname = gDirUtilp->getExecutableFilename();
std::string str[] = { "-pid", pid_str.str(), "-dumpdir", logdir, "-procname", appname.c_str() };
std::vector< std::string > args( str, str + ( sizeof ( str ) / sizeof ( std::string ) ) );
LL_WARNS() << "about to launch mac-crash-logger" << pid_str << " " << logdir << " " << appname << LL_ENDL;
LL_WARNS() << "about to launch mac-crash-logger" << pid_str.str() << " " << logdir << " " << appname << LL_ENDL;
launchApplication(&command_str, &args);
}

View File

@ -95,8 +95,8 @@ void LLPanelExperienceListEditor::setExperienceIds( const LLSD& experience_ids )
{
mExperienceIds.clear();
// [SL:KB] - Because GCC likes to be special
// <FS:TS> ...and Clang doesn't (argh!)
#if LL_GNUC
// <FS:TS> ...and Clang does too
#if LL_GNUC || LL_CLANG
std::transform(experience_ids.beginArray(), experience_ids.endArray(), std::inserter(mExperienceIds, mExperienceIds.end()), [](const LLSD& sd) { return sd.asUUID(); });
#else
mExperienceIds.insert(experience_ids.beginArray(), experience_ids.endArray());

View File

@ -116,7 +116,7 @@ void LLSearchHistory::addEntry(const std::string& search_query)
mSearchHistory.push_front(item);
}
bool LLSearchHistory::LLSearchHistoryItem::operator < (const LLSearchHistory::LLSearchHistoryItem& right)
bool LLSearchHistory::LLSearchHistoryItem::operator < (const LLSearchHistory::LLSearchHistoryItem& right) const
{
S32 result = LLStringUtil::compareInsensitive(search_query, right.search_query);

View File

@ -98,7 +98,7 @@ public:
/**
* Allows std::list sorting
*/
bool operator < (const LLSearchHistory::LLSearchHistoryItem& right);
bool operator < (const LLSearchHistory::LLSearchHistoryItem& right) const;
/**
* Allows std::list sorting

View File

@ -313,7 +313,12 @@ U32Bytes gTotalWorldData,
U32 gSimPingCount = 0;
U32Bits gObjectData;
F32Milliseconds gAvgSimPing(0.f);
//<FS:TS> Deal with Clang C++11 pedantry
#if LL_CLANG
U32Bytes gTotalTextureBytesPerBoostLevel[LLViewerTexture::MAX_GL_IMAGE_CATEGORY];
#else
U32Bytes gTotalTextureBytesPerBoostLevel[LLViewerTexture::MAX_GL_IMAGE_CATEGORY] = {U32Bytes(0)};
#endif
extern U32 gVisCompared;
extern U32 gVisTested;

View File

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