Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Make.config
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ endif

SIMULATOR_SDK=$(XCODE_DEVELOPER_ROOT)/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator$(IOS_SDK_VERSION).sdk

OBJC_CFLAGS=-ObjC++ -std=c++0x -fno-exceptions -stdlib=libc++
OBJC_CFLAGS=-ObjC++ -std=c++14 -fno-exceptions -stdlib=libc++

COMMON_SIMULATOR_CFLAGS=-mios-simulator-version-min=$(MIN_IOS_SDK_VERSION) -isysroot $(SIMULATOR_SDK) $(CFLAGS) -g $(IOS_COMMON_DEFINES)
SIMULATOR86_CFLAGS=$(COMMON_SIMULATOR_CFLAGS) -arch i386
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
namespace Xamarin.iOS.Tasks {
[TestFixture ("iPhone")]
[TestFixture ("iPhoneSimulator")]
[Ignore ("The PhotoUI framework is broken in Xcode 11 beta 1 and the generated registrar code doesn't compile.")]
public class PhotoEditingTests : ExtensionTestBase {
public PhotoEditingTests (string platform) : base (platform)
{
Expand Down
2 changes: 1 addition & 1 deletion runtime/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ MAC64_CLANG = DEVELOPER_DIR=$(XCODE_DEVELOPER_ROOT) $(MAC_CC) -mmacosx-version-m

MAC_SHIPPED_HEADERS = xamarin/launch.h

MAC_OBJC_CFLAGS=-ObjC++ -std=c++0x -fno-exceptions -DMIN_XM_MONO_VERSION=\"$(MIN_XM_MONO_VERSION)\"
MAC_OBJC_CFLAGS=-ObjC++ -std=c++14 -fno-exceptions -DMIN_XM_MONO_VERSION=\"$(MIN_XM_MONO_VERSION)\"
MAC_CFLAGS = -mmacosx-version-min=$(MIN_OSX_SDK_VERSION) -Wall -DMONOMAC -g -DMIN_XM_MONO_VERSION=\"$(MIN_XM_MONO_VERSION)\"
MAC_LDFLAGS = -mmacosx-version-min=$(MIN_OSX_SDK_VERSION) -framework AppKit

Expand Down
3 changes: 0 additions & 3 deletions tests/monotouch-test/Photos/LivePhotoEditingContextTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,6 @@ public void Setup ()
#if !MONOMAC
// on macOS `initWithLivePhotoEditingInput:` returns `nil` and we throw
[Test]
#endif
#if !DEBUG || OPTIMIZEALL
[Ignore ("Photos.framework headers are broken in Xcode 11 beta 1 (and optimizations fails)")]
#endif
public void Linker ()
{
Expand Down
2 changes: 1 addition & 1 deletion tools/common/Driver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ public static int RunCommand (string path, string args, string[] env = null, Act
// also write to the Console, confusing the output.
if (output == null)
output = new StringBuilder ();
output.Insert (0, $"Process exited with code {p.ExitCode}, command:\n{path}\n");
output.Insert (0, $"Process exited with code {p.ExitCode}, command:\n{path} {args}\n");
Console.Error.WriteLine (output);
}
return p.ExitCode;
Expand Down
4 changes: 0 additions & 4 deletions tools/common/StaticRegistrar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2679,10 +2679,6 @@ void Specialize (AutoIndentStringBuilder sb)
#endif


// Photos headers are broken in Xcode 11 beta 1
if (IsTypeCore (@class, "Photos") || IsTypeCore (@class, "PhotosUI"))
continue;

// Xcode 11 removed WatchKit for iOS!
if (IsTypeCore (@class, "WatchKit") && App.Platform == Xamarin.Utils.ApplePlatform.iOS) {
exceptions.Add (ErrorHelper.CreateWarning (4178, $"The class '{@class.Type.FullName}' will not be registered because the WatchKit framework has been removed from the iOS SDK."));
Expand Down
2 changes: 1 addition & 1 deletion tools/mmp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Xamarin.Mac.registrar.full.x86_64.m: $(TOP)/src/build/mac/full-64/Xamarin.Mac.
$(Q) touch Xamarin.Mac.registrar.full.x86_64.m Xamarin.Mac.registrar.full.x86_64.h

Xamarin.Mac.registrar.%.x86_64.a: Xamarin.Mac.registrar.%.x86_64.m
$(Q_CC) xcrun -sdk macosx clang -DDEBUG -g -gdwarf-2 -x objective-c++ -stdlib=libc++ -o $@ -c -arch x86_64 $< -Wall -Wno-unguarded-availability-new -I$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/include -mmacosx-version-min=$(MIN_OSX_SDK_VERSION) -fobjc-runtime=macosx
$(Q_CC) xcrun -sdk macosx clang -DDEBUG -g -gdwarf-2 -x objective-c++ -stdlib=libc++ -std=c++14 -o $@ -c -arch x86_64 $< -Wall -Wno-unguarded-availability-new -I$(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/include -mmacosx-version-min=$(MIN_OSX_SDK_VERSION) -fobjc-runtime=macosx

Xamarin.Mac.registrar.%.a: Xamarin.Mac.registrar.%.x86_64.a
$(Q_LIPO) $(DEVICE_BIN_PATH)/lipo -create -output $@ $^
Expand Down
11 changes: 9 additions & 2 deletions tools/mmp/driver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1184,7 +1184,11 @@ static int Compile ()
if (XcodeVersion >= new Version (9, 0))
args.Append ("-Wno-unguarded-availability-new ");

if (XcodeVersion.Major >= 11)
args.Append ("-std=c++14 ");

bool appendedObjc = false;
var sourceFiles = new List<string> ();
foreach (var assembly in BuildTarget.Assemblies) {
if (assembly.LinkWith != null) {
foreach (var linkWith in assembly.LinkWith) {
Expand Down Expand Up @@ -1257,7 +1261,7 @@ static int Compile ()
string reference_m = Path.Combine (App.Cache.Location, "reference.m");
reference_m = BuildTarget.GenerateReferencingSource (reference_m, requiredSymbols);
if (!string.IsNullOrEmpty (reference_m))
args.Append (StringUtils.Quote (reference_m)).Append (' ');
sourceFiles.Add (reference_m);
break;
case SymbolMode.Linker:
case SymbolMode.Default:
Expand Down Expand Up @@ -1341,7 +1345,10 @@ static int Compile ()

var main = Path.Combine (App.Cache.Location, "main.m");
File.WriteAllText (main, mainSource);
args.Append (StringUtils.Quote (main));
sourceFiles.Add (main);

foreach (var src in sourceFiles)
args.Append (StringUtils.Quote (src)).Append (' ');;

ret = XcodeRun ("clang", args.ToString (), null);
} catch (Win32Exception e) {
Expand Down
7 changes: 4 additions & 3 deletions tools/mtouch/BuildTasks.mtouch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -451,10 +451,11 @@ public static void GetCompilerFlags (Application app, CompilerFlags flags, bool
flags.AddOtherFlag ("-gdwarf-2");

if (!is_assembler) {
if (string.IsNullOrEmpty (language) || !language.Contains ("++")) {
// error: invalid argument '-std=c99' not allowed with 'C++/ObjC++'
flags.AddOtherFlag ("-std=c99");
if (language != "objective-c") {
// error: invalid argument '-std=c++14' not allowed with 'Objective-C'
flags.AddOtherFlag ("-std=c++14");
}

flags.AddOtherFlag ($"-I{StringUtils.Quote (Path.Combine (Driver.GetProductSdkDirectory (app), "usr", "include"))}");
}
flags.AddOtherFlag ($"-isysroot {StringUtils.Quote (Driver.GetFrameworkDirectory (app))}");
Expand Down
4 changes: 1 addition & 3 deletions tools/mtouch/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,7 @@ $(MTOUCH_DIR)/mtouch.exe: $(mtouch_dependencies)
%.registrar.ios.a: %.registrar.ios.i386.a %.registrar.ios.x86_64.a
$(Q_LIPO) $(DEVICE_BIN_PATH)/lipo -create -output $@ $^

# In Xcode 10 beta 1 simd/vector.h won't compile as Objective-C++ (can't find 'cmath'), so include a directory that contains the cmath file.
# This is filed as rdar://40824697
REGISTRAR_CFLAGS=-stdlib=libc++
REGISTRAR_CFLAGS=-stdlib=libc++ -std=c++14

%.registrar.ios.i386.a: %.registrar.ios.i386.m %.registrar.ios.i386.h
$(Q_CC) $(IOS_CC) -DDEBUG -g -gdwarf-2 $(SIMULATOR86_CFLAGS) $(REGISTRAR_CFLAGS) -x objective-c++ -o $@ -c $< -Wall -Wno-unguarded-availability-new -I$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/SDKs/MonoTouch.iphonesimulator.sdk/usr/include
Expand Down