From 1e459a94523e5cc71c21ce1a31645d174c1fabe3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Remko=20Tron=C3=A7on?= Date: Wed, 25 May 2011 21:54:02 +0200 Subject: Added 'assertions' scons flag. diff --git a/BuildTools/SCons/SConstruct b/BuildTools/SCons/SConstruct index 284c032..6914880 100644 --- a/BuildTools/SCons/SConstruct +++ b/BuildTools/SCons/SConstruct @@ -19,6 +19,7 @@ vars.Add(EnumVariable("test", "Compile and run tests", "none", ["none", "all", " vars.Add(BoolVariable("optimize", "Compile with optimizations turned on", "no")) vars.Add(BoolVariable("debug", "Compile with debug information", "yes")) vars.Add(BoolVariable("allow_warnings", "Allow compilation warnings during compilation", "yes")) +vars.Add(BoolVariable("assertions", "Compile with assertions", "yes")) vars.Add(BoolVariable("max_jobs", "Build with maximum number of parallel jobs", "no")) vars.Add(EnumVariable("target", "Choose a target platform for compilation", "native", ["native", "iphone-simulator", "iphone-device", "xcode"])) vars.Add(BoolVariable("swift_mobile", "Build mobile Swift", "no")) @@ -167,6 +168,9 @@ if env.get("mac105", 0) : "-arch", "i386"]) env.Append(FRAMEWORKS = ["Security"]) +if not env["assertions"] : + env.Append(CPPDEFINES = ["NDEBUG"]) + # If we build shared libs on AMD64, we need -fPIC. # This should have no performance impact om AMD64 if env["PLATFORM"] == "posix" and platform.machine() == "x86_64" : diff --git a/SwifTools/Idle/MacOSXIdleQuerier.cpp b/SwifTools/Idle/MacOSXIdleQuerier.cpp index 64e010b..b634fcb 100644 --- a/SwifTools/Idle/MacOSXIdleQuerier.cpp +++ b/SwifTools/Idle/MacOSXIdleQuerier.cpp @@ -26,6 +26,7 @@ int MacOSXIdleQuerier::getIdleTimeSeconds() { uint64_t idle = 0; bool result = CFNumberGetValue((CFNumberRef)property, kCFNumberSInt64Type, &idle); assert(result); + (void) result; CFRelease(property); return idle / 1000000000; } diff --git a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuerier.cpp b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuerier.cpp index 5331964..530e066 100644 --- a/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuerier.cpp +++ b/Swiften/LinkLocal/DNSSD/Bonjour/BonjourQuerier.cpp @@ -23,6 +23,7 @@ BonjourQuerier::BonjourQuerier(EventLoop* eventLoop) : eventLoop(eventLoop), sto int fds[2]; int result = pipe(fds); assert(result == 0); + (void) result; interruptSelectReadSocket = fds[0]; fcntl(interruptSelectReadSocket, F_SETFL, fcntl(interruptSelectReadSocket, F_GETFL)|O_NONBLOCK); interruptSelectWriteSocket = fds[1]; -- cgit v0.10.2-6-g49f6