Allow containing project to override the OS X deployment version

Also fix a build issue due to AuthorizationExecuteWithPriviledges
being deprecated in OS X 10.7 when setting the OS X min deployment
version to 10.7 or later.

MD-19353
test: none
This commit is contained in:
Robert Knight 2014-07-18 13:47:30 +01:00
parent f6ded2035f
commit 81f80d26d2
3 changed files with 12 additions and 3 deletions

View File

@ -44,9 +44,11 @@ if (APPLE)
set(CMAKE_OSX_ARCHITECTURES i386;x86_64)
# Build the updater so that it works on OS X 10.6 and above.
set(MIN_OSX_VERSION 10.6)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=${MIN_OSX_VERSION}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=${MIN_OSX_VERSION}")
if (NOT (DEFINED MIN_OSX_DEPLOYMENT_VERSION))
set(MIN_OSX_DEPLOYMENT_VERSION 10.6)
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=${MIN_OSX_DEPLOYMENT_VERSION}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=${MIN_OSX_DEPLOYMENT_VERSION}")
endif()
add_subdirectory(src)

View File

@ -28,6 +28,7 @@
// platform-specific type aliases
#if defined(PLATFORM_UNIX)
#include <unistd.h>
#define PLATFORM_PID pid_t
#else
#define PLATFORM_PID DWORD

View File

@ -201,6 +201,11 @@ int ProcessUtils::runElevatedLinux(const std::string& executable,
#endif
#ifdef PLATFORM_MAC
// suppress warning about AuthorizationExecuteWithPriviledges
// being deprecated since OS X 10.7
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
int ProcessUtils::runElevatedMac(const std::string& executable,
const std::list<std::string>& args)
{
@ -315,6 +320,7 @@ int ProcessUtils::runElevatedMac(const std::string& executable,
return RunElevatedFailed;
}
}
#pragma clang diagnostic pop
#endif
// convert a list of arguments in a space-separated string.