From 1bf0b7222dfad97bcb4ce373a2da5defaf49fce3 Mon Sep 17 00:00:00 2001 From: James Turner Date: Wed, 11 Feb 2015 15:46:01 +0000 Subject: [PATCH] Explicitly force libc++ on clang --- CMakeLists.txt | 3 +++ simgear/misc/CocoaHelpers.mm | 11 ++++++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c9eb7294..01bdc4f7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -313,6 +313,9 @@ endif(CMAKE_COMPILER_IS_GNUCXX) if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") set(WARNING_FLAGS_CXX "-Wall -Wno-overloaded-virtual") set(WARNING_FLAGS_C "-Wall") + set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") + set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++") endif() if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") diff --git a/simgear/misc/CocoaHelpers.mm b/simgear/misc/CocoaHelpers.mm index 028ccfb7..4b151307 100644 --- a/simgear/misc/CocoaHelpers.mm +++ b/simgear/misc/CocoaHelpers.mm @@ -28,11 +28,12 @@ SGPath appleSpecialFolder(int dirType, int domainMask, const SGPath& def) { CocoaAutoreleasePool ap; NSFileManager* fm = [NSFileManager defaultManager]; - NSURL* pathUrl = [fm URLForDirectory:dirType - inDomain:domainMask - appropriateForURL:Nil - create:YES - error:nil]; + NSSearchPathDirectory d = static_cast(dirType); + NSURL* pathUrl = [fm URLForDirectory:d + inDomain:domainMask + appropriateForURL:Nil + create:YES + error:nil]; if (!pathUrl) { return def;; } -- 2.39.5