diff --git a/Make.config b/Make.config index cd3261c9696..0794dc48f84 100644 --- a/Make.config +++ b/Make.config @@ -269,7 +269,6 @@ IOS_SDK_VERSION=$(word 1, $(subst ., ,$(IOS_NUGET_VERSION))).$(word 2, $(subst . MACOS_SDK_VERSION=$(word 1, $(subst ., ,$(MACOS_NUGET_VERSION))).$(word 2, $(subst ., ,$(MACOS_NUGET_VERSION))) TVOS_SDK_VERSION=$(word 1, $(subst ., ,$(TVOS_NUGET_VERSION))).$(word 2, $(subst ., ,$(TVOS_NUGET_VERSION))) MACCATALYST_SDK_VERSION=$(word 1, $(subst ., ,$(MACCATALYST_NUGET_VERSION))).$(word 2, $(subst ., ,$(MACCATALYST_NUGET_VERSION))) -MACCATALYST_MAC_SDK_VERSION=$(MACOS_SDK_VERSION) MAX_IOS_DEPLOYMENT_TARGET=$(IOS_SDK_VERSION) MAX_TVOS_DEPLOYMENT_TARGET=$(TVOS_SDK_VERSION) @@ -305,196 +304,12 @@ INCLUDE_HOTRESTART=1 -include $(TOP)/Make.config.local -include $(TOP)/configure.inc -ifdef ENABLE_CCACHE -# Note the space at the end the line -CCACHE=ccache -endif - -XCODE_MAC_SDKROOT=$(XCODE_DEVELOPER_ROOT)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk - -# The MAC_* variables do not contain the -mmacosx-version-min flag on purpose: each usage must specify it separately. -MAC_CC=$(CCACHE)$(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -isysroot $(XCODE_MAC_SDKROOT) -MAC_CXX=$(CCACHE)$(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -isysroot $(XCODE_MAC_SDKROOT) - -MAC_INSTALL_VERSION ?= git -IOS_INSTALL_VERSION ?= git - -ifneq ($(TESTS_USE_SYSTEM),) -IOS_DESTDIR ?= / -else -IOS_DESTDIR ?= $(TOP)/_ios-build -endif -IOS_TARGETDIR ?= $(IOS_DESTDIR) - -USE_SOURCE_LINKS ?= 1 - -IOS_FRAMEWORK_DIR=/Library/Frameworks/Xamarin.iOS.framework -# Prefix used to install monotouch -ifndef MONOTOUCH_PREFIX - MONOTOUCH_PREFIX=$(IOS_FRAMEWORK_DIR)/Versions/$(IOS_INSTALL_VERSION) -endif - -XCODE_CC=$(CCACHE)$(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -XCODE_CXX=$(CCACHE)$(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ - -# make sure we have full paths. The patsubst function is to remove any trailing slash (this may leave the variable empty) -override IOS_DESTDIR := $(patsubst %/,%,$(abspath $(IOS_DESTDIR))) -override IOS_TARGETDIR := $(patsubst %/,%,$(abspath $(IOS_TARGETDIR))) -MONOTOUCH_PREFIX := $(abspath $(MONOTOUCH_PREFIX)) - -MONOTOUCH_MONO_PATH?=$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/mono/Xamarin.iOS -MONOTOUCH_TV_MONO_PATH?=$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/mono/Xamarin.TVOS -MONOTOUCH_MACCATALYST_MONO_PATH?=$(IOS_DESTDIR)$(MONOTOUCH_PREFIX)/lib/mono/Xamarin.MacCatalyst - -IOS_PACKAGE_FILENAME=$(IOS_PACKAGE_NAME_LOWER)-$(IOS_PACKAGE_VERSION).pkg -IOS_PACKAGE_UTI=com.xamarin.$(IOS_PACKAGE_NAME_LOWER).pkg - -IOS_COMMON_DEFINES=-DMONOTOUCH - +# misc Xcode tool +CLANG=$(CCACHE)$(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang SWIFTC=$(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc - -IOS_CC=$(XCODE_CC) -IOS_CXX=$(XCODE_CXX) -SIMULATOR_BIN_PATH=$(XCODE_DEVELOPER_ROOT)/Platforms/iPhoneSimulator.platform/Developer/usr/bin -SIMULATOR_CC=$(IOS_CC) - -CFLAGS= -Wall -fms-extensions -Werror -Wconversion -Wdeprecated -Wuninitialized -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security - -SIMULATOR_SDK=$(XCODE_DEVELOPER_ROOT)/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator$(IOS_SDK_VERSION).sdk - -# Clang will by default emit objc_msgSend stubs in Xcode 14, which ld from earlier Xcodes doesn't understand. -# We disable this by passing -fno-objc-msgsend-selector-stubs to clang. -# We can probably remove this flag once we require developers to use Xcode 14. -# Ref: https://github.com/xamarin/xamarin-macios/issues/16223 -OBJC_CFLAGS=-ObjC++ -std=c++14 -fno-exceptions -fno-objc-msgsend-selector-stubs - -COMMON_SIMULATOR_CFLAGS=-mios-simulator-version-min=$(MIN_IOS_SDK_VERSION) -isysroot $(SIMULATOR_SDK) $(CFLAGS) -g $(IOS_COMMON_DEFINES) \ - -L$(SIMULATOR_SDK)/usr/lib/swift \ - -L$(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator \ - -Wno-unused-command-line-argument -SIMULATOR86_CFLAGS=$(COMMON_SIMULATOR_CFLAGS) -arch i386 -SIMULATOR64_CFLAGS=$(COMMON_SIMULATOR_CFLAGS) -arch x86_64 -SIMULATOR_ARM64_CFLAGS=$(COMMON_SIMULATOR_CFLAGS) -arch arm64 -COMMON_SIMULATOR_OBJC_CFLAGS=-fobjc-abi-version=2 -fobjc-legacy-dispatch $(CFLAGS) $(OBJC_CFLAGS) -SIMULATOR86_OBJC_CFLAGS=$(COMMON_SIMULATOR_OBJC_CFLAGS) $(SIMULATOR86_CFLAGS) -SIMULATOR64_OBJC_CFLAGS=$(COMMON_SIMULATOR_OBJC_CFLAGS) $(SIMULATOR64_CFLAGS) -SIMULATOR_ARM64_OBJC_CFLAGS=$(COMMON_SIMULATOR_OBJC_CFLAGS) $(SIMULATOR_ARM64_CFLAGS) - -MACCATALYST_COMMON_CFLAGS=-target x86_64-apple-ios$(MIN_MACCATALYST_SDK_VERSION)-macabi -arch x86_64 -g $(IOS_COMMON_DEFINES) \ - -isysroot $(XCODE_DEVELOPER_ROOT)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$(MACOS_SDK_VERSION).sdk \ - -isystem $(XCODE_DEVELOPER_ROOT)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$(MACOS_SDK_VERSION).sdk/System/iOSSupport/usr/include \ - -iframework $(XCODE_DEVELOPER_ROOT)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$(MACOS_SDK_VERSION).sdk/System/iOSSupport/System/Library/Frameworks \ - -L$(SIMULATOR_SDK)/usr/lib/swift \ - -L$(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphonesimulator \ - -Wno-unused-command-line-argument -MACCATALYST_OBJC_CFLAGS=$(MACCATALYST_COMMON_CFLAGS) -fobjc-abi-version=2 -fobjc-legacy-dispatch $(OBJC_CFLAGS) -MACCATALYST_CFLAGS=$(MACCATALYST_COMMON_CFLAGS) - -MACCATALYST_COMMON_CFLAGS=$(CFLAGS) -g $(IOS_COMMON_DEFINES) \ - -isysroot $(XCODE_DEVELOPER_ROOT)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$(MACOS_SDK_VERSION).sdk \ - -isystem $(XCODE_DEVELOPER_ROOT)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$(MACOS_SDK_VERSION).sdk/System/iOSSupport/usr/include \ - -iframework $(XCODE_DEVELOPER_ROOT)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$(MACOS_SDK_VERSION).sdk/System/iOSSupport/System/Library/Frameworks \ - -L$(XCODE_DEVELOPER_ROOT)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$(MACOS_SDK_VERSION).sdk/usr/lib/swift \ - -L$(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx \ - -Wno-unused-command-line-argument -MACCATALYST_COMMON_OBJC_CFLAGS=$(MACCATALYST_COMMON_CFLAGS) -fobjc-abi-version=2 -fobjc-legacy-dispatch $(OBJC_CFLAGS) -MACCATALYST_X86_64_OBJC_CFLAGS=$(MACCATALYST_COMMON_OBJC_CFLAGS) -target x86_64-apple-ios$(MIN_MACCATALYST_SDK_VERSION)-macabi -arch x86_64 -MACCATALYST_X86_64_CFLAGS=$(MACCATALYST_COMMON_CFLAGS) -target x86_64-apple-ios$(MIN_MACCATALYST_SDK_VERSION)-macabi -arch x86_64 -MACCATALYST_ARM64_OBJC_CFLAGS=$(MACCATALYST_COMMON_OBJC_CFLAGS) -target arm64-apple-ios$(MIN_MACCATALYST_SDK_VERSION)-macabi -arch arm64 -MACCATALYST_ARM64_CFLAGS=$(MACCATALYST_COMMON_CFLAGS) -target arm64-apple-ios$(MIN_MACCATALYST_SDK_VERSION)-macabi -arch arm64 - -MONOTOUCH_SIMULATOR_SDK=$(MONOTOUCH_PREFIX)/SDKs/MonoTouch.iphonesimulator.sdk - -DEVICE_BIN_PATH=$(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin -DEVICE_CC=$(IOS_CC) -DEVICE_CXX=$(IOS_CXX) - -IOS_CSC=$(SYSTEM_CSC) -features:strict -nostdlib -noconfig -r:$(MONOTOUCH_MONO_PATH)/System.dll -r:$(MONOTOUCH_MONO_PATH)/System.Core.dll -r:$(MONOTOUCH_MONO_PATH)/System.Xml.dll -r:$(MONOTOUCH_MONO_PATH)/mscorlib.dll -r:$(MONOTOUCH_MONO_PATH)/System.Net.Http.dll -r:$(MONOTOUCH_MONO_PATH)/Facades/System.Drawing.Common.dll -deterministic -TV_CSC=$(SYSTEM_CSC) -features:strict -nostdlib -noconfig -r:$(MONOTOUCH_TV_MONO_PATH)/System.dll -r:$(MONOTOUCH_TV_MONO_PATH)/System.Core.dll -r:$(MONOTOUCH_TV_MONO_PATH)/System.Xml.dll -r:$(MONOTOUCH_TV_MONO_PATH)/mscorlib.dll -r:$(MONOTOUCH_TV_MONO_PATH)/System.Net.Http.dll -r:$(MONOTOUCH_TV_MONO_PATH)/Facades/System.Drawing.Common.dll -deterministic -MACCATALYST_CSC=$(SYSTEM_CSC) -features:strict -nostdlib -noconfig -r:$(MONOTOUCH_MACCATALYST_MONO_PATH)/System.dll -r:$(MONOTOUCH_MACCATALYST_MONO_PATH)/System.Core.dll -r:$(MONOTOUCH_MACCATALYST_MONO_PATH)/System.Xml.dll -r:$(MONOTOUCH_MACCATALYST_MONO_PATH)/mscorlib.dll -r:$(MONOTOUCH_MACCATALYST_MONO_PATH)/System.Net.Http.dll -r:$(MONOTOUCH_MACCATALYST_MONO_PATH)/Facades/System.Drawing.Common.dll -deterministic - -DEVICE_OBJC_CFLAGS=$(OBJC_CFLAGS) - -DEVICE_SDK=$(XCODE_DEVELOPER_ROOT)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS$(IOS_SDK_VERSION).sdk -DEVICE_SWIFT_CFLAGS=\ - -L$(DEVICE_SDK)/usr/lib/swift \ - -L$(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos \ - -Wno-unused-command-line-argument -DEVICE7_CFLAGS= -arch armv7 -mno-thumb -miphoneos-version-min=$(MIN_IOS_SDK_VERSION) -isysroot $(DEVICE_SDK) $(CFLAGS) $(IOS_COMMON_DEFINES) $(DEVICE_SWIFT_CFLAGS) -DEVICE7S_CFLAGS=-arch armv7s -mno-thumb -miphoneos-version-min=$(MIN_IOS_SDK_VERSION) -isysroot $(DEVICE_SDK) $(CFLAGS) $(IOS_COMMON_DEFINES) $(DEVICE_SWIFT_CFLAGS) -DEVICE64_CFLAGS=-arch arm64 -miphoneos-version-min=$(MIN_IOS_SDK_VERSION) -isysroot $(DEVICE_SDK) $(CFLAGS) $(IOS_COMMON_DEFINES) $(DEVICE_SWIFT_CFLAGS) -DEVICE7_OBJC_CFLAGS =$(DEVICE7_CFLAGS) $(DEVICE_OBJC_CFLAGS) -DEVICE7S_OBJC_CFLAGS=$(DEVICE7S_CFLAGS) $(DEVICE_OBJC_CFLAGS) -DEVICE64_OBJC_CFLAGS=$(DEVICE64_CFLAGS) $(DEVICE_OBJC_CFLAGS) -MONOTOUCH_DEVICE_SDK=$(MONOTOUCH_PREFIX)/SDKs/MonoTouch.iphoneos.sdk - -# iOS - -XAMARIN_IOSSIMULATOR_SDK = $(MONOTOUCH_SIMULATOR_SDK) -XAMARIN_IPHONEOS_SDK = $(MONOTOUCH_DEVICE_SDK) - -# MacCatalyst - -XAMARIN_MACCATALYST_SDK = $(MONOTOUCH_PREFIX)/SDKs/Xamarin.MacCatalyst.sdk - -# TVOS - -XAMARIN_TVSIMULATOR_SDK = $(MONOTOUCH_PREFIX)/SDKs/Xamarin.AppleTVSimulator.sdk -XAMARIN_TVOS_SDK = $(MONOTOUCH_PREFIX)/SDKs/Xamarin.AppleTVOS.sdk - -SIMULATORTV_SDK = $(XCODE_DEVELOPER_ROOT)/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator$(TVOS_SDK_VERSION).sdk -SIMULATORTV_CFLAGS = -arch x86_64 -mtvos-simulator-version-min=$(MIN_TVOS_SDK_VERSION) -isysroot $(SIMULATORTV_SDK) $(CFLAGS) -g $(IOS_COMMON_DEFINES) \ - -L$(SIMULATORTV_SDK)/usr/lib/swift \ - -L$(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/appletvsimulator \ - -Wno-unused-command-line-argument -SIMULATORTV_ARM64_CFLAGS = -arch arm64 -mtvos-simulator-version-min=$(MIN_TVOS_SDK_VERSION) -isysroot $(SIMULATORTV_SDK) $(CFLAGS) -g $(IOS_COMMON_DEFINES) \ - -L$(SIMULATORTV_SDK)/usr/lib/swift \ - -L$(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/appletvsimulator \ - -Wno-unused-command-line-argument -SIMULATORTV_OBJC_CFLAGS = $(SIMULATORTV_CFLAGS) $(COMMON_SIMULATOR_OBJC_CFLAGS) -SIMULATORTV_ARM64_OBJC_CFLAGS = $(SIMULATORTV_ARM64_CFLAGS) $(COMMON_SIMULATOR_OBJC_CFLAGS) - -DEVICETV_SDK = $(XCODE_DEVELOPER_ROOT)/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS$(TVOS_SDK_VERSION).sdk -DEVICETV_CFLAGS = -arch arm64 -mtvos-version-min=$(MIN_TVOS_SDK_VERSION) -isysroot $(DEVICETV_SDK) $(CFLAGS) $(IOS_COMMON_DEFINES)\ - -L$(DEVICETV_SDK)/usr/lib/swift \ - -L$(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/appletvos \ - -Wno-unused-command-line-argument -DEVICETV_OBJC_CFLAGS = $(DEVICETV_CFLAGS) $(DEVICE_OBJC_CFLAGS) - -# macOS - -XAMARIN_MACOS_SDK = $(MAC_FRAMEWORK_CURRENT_DIR)/SDKs/Xamarin.macOS.sdk - -MAC_OBJC_CFLAGS= -mmacosx-version-min=$(MIN_MACOS_SDK_VERSION) -DMONOMAC -DMIN_XM_MONO_VERSION=\"$(MIN_XM_MONO_VERSION)\" $(CFLAGS) $(OBJC_CFLAGS) -MAC_CFLAGS = -mmacosx-version-min=$(MIN_MACOS_SDK_VERSION) -DMONOMAC -g -DMIN_XM_MONO_VERSION=\"$(MIN_XM_MONO_VERSION)\" $(CFLAGS) \ - -L$(XCODE_DEVELOPER_ROOT)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$(MACOS_SDK_VERSION).sdk/usr/lib/swift \ - -L$(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx \ - -Wno-unused-command-line-argument -MAC_LDFLAGS = -mmacosx-version-min=$(MIN_MACOS_SDK_VERSION) -framework AppKit - -# Swift compiler flags - -COMMON_SWIFTFLAGS=-g -emit-library - -IOS_SIMULATOR_COMMON_SWIFTFLAGS=$(COMMON_SWIFTFLAGS) -sdk $(SIMULATOR_SDK) -IOS_SIMULATOR_ARM64_SWIFTFLAGS=$(IOS_SIMULATOR_COMMON_SWIFTFLAGS) -target arm64-apple-ios$(MIN_IOS_SDK_VERSION)-simulator -IOS_SIMULATOR_X64_SWIFTFLAGS=$(IOS_SIMULATOR_COMMON_SWIFTFLAGS) -target x86_64-apple-ios$(MIN_IOS_SDK_VERSION)-simulator -IOS_DEVICE_COMMON_SWIFTFLAGS=$(COMMON_SWIFTFLAGS) -sdk $(DEVICE_SDK) -IOS_DEVICE_ARM64_SWIFTFLAGS=$(IOS_DEVICE_COMMON_SWIFTFLAGS) -target arm64-apple-ios$(MIN_IOS_SDK_VERSION) - -TVOS_SIMULATOR_COMMON_SWIFTFLAGS=$(COMMON_SWIFTFLAGS) -sdk $(SIMULATORTV_SDK) -TVOS_SIMULATOR_ARM64_SWIFTFLAGS=$(TVOS_SIMULATOR_COMMON_SWIFTFLAGS) -target arm64-apple-tvos$(MIN_TVOS_SDK_VERSION)-simulator -TVOS_SIMULATOR_X64_SWIFTFLAGS=$(TVOS_SIMULATOR_COMMON_SWIFTFLAGS) -target x86_64-apple-tvos$(MIN_TVOS_SDK_VERSION)-simulator -TVOS_DEVICE_COMMON_SWIFTFLAGS=$(COMMON_SWIFTFLAGS) -sdk $(DEVICETV_SDK) -TVOS_DEVICE_ARM64_SWIFTFLAGS=$(TVOS_DEVICE_COMMON_SWIFTFLAGS) -target arm64-apple-tvos$(MIN_TVOS_SDK_VERSION) - -MACCATALYST_COMMON_SWIFTFLAGS=$(COMMON_SWIFTFLAGS) -sdk $(XCODE_MAC_SDKROOT) -Fsystem $(XCODE_MAC_SDKROOT)/System/iOSSupport/System/Library/Frameworks -MACCATALYST_ARM64_SWIFTFLAGS=$(MACCATALYST_COMMON_SWIFTFLAGS) -target arm64-apple-ios$(MIN_MACCATALYST_SDK_VERSION)-macabi -MACCATALYST_X64_SWIFTFLAGS=$(MACCATALYST_COMMON_SWIFTFLAGS) -target x86_64-apple-ios$(MIN_MACCATALYST_SDK_VERSION)-macabi - -MACOS_COMMON_SWIFTFLAGS=$(COMMON_SWIFTFLAGS) -sdk $(XCODE_MAC_SDKROOT) -MACOS_ARM64_SWIFTFLAGS=$(MACOS_COMMON_SWIFTFLAGS) -target arm64-apple-macos$(MIN_MACOS_SDK_VERSION) -MACOS_X64_SWIFTFLAGS=$(MACOS_COMMON_SWIFTFLAGS) -target x86_64-apple-macos$(MIN_MACOS_SDK_VERSION) +LIPO=$(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo +AR=$(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar +RANLIB=$(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/ranlib # paths to the modules we depend on, as variables, so people can put # things in other places if they absolutely must. @@ -507,14 +322,8 @@ MACCORE_PATH=$(TOP)/../maccore ADR_PATH=$(TOP)/../macios-adr MONO_PREFIX ?= /Library/Frameworks/Mono.framework/Versions/Current -SYSTEM_MCS=$(MONO_PREFIX)/bin/mcs -SYSTEM_CSC=$(MONO_PREFIX)/bin/csc -SYSTEM_SN=$(MONO_PREFIX)/bin/sn SYSTEM_MONO=$(MONO_PREFIX)/bin/mono -SYSTEM_MONO32=$(MONO_PREFIX)/bin/mono32 -SYSTEM_XBUILD=$(MONO_PREFIX)/bin/msbuild /p:Features=strict /m SYSTEM_MSBUILD=unset MSBuildExtensionsPath && $(MONO_PREFIX)/bin/msbuild /p:Features=strict /m -SYSTEM_RESGEN=$(MONO_PREFIX)/bin/resgen PKG_CONFIG=$(MONO_PREFIX)/bin/pkg-config @@ -538,32 +347,10 @@ MACOS_NUGET_VERSION_PATCH=$(word 3, $(subst ., ,$(MACOS_NUGET_VERSION))) MACOS_NUGET_VERSION_NO_METADATA=$(MACOS_NUGET_VERSION)$(NUGET_PRERELEASE_IDENTIFIER) MACOS_NUGET_VERSION_FULL=$(MACOS_NUGET_VERSION_NO_METADATA)$(NUGET_BUILD_METADATA) -ifneq ($(TESTS_USE_SYSTEM),) -MAC_DESTDIR ?= / -else -MAC_DESTDIR ?= $(TOP)/_mac-build -endif -MAC_TARGETDIR ?= $(MAC_DESTDIR) - -# make sure we have full paths. The patsubst function is to remove any trailing slash (this may leave the variable empty) -override MAC_DESTDIR := $(patsubst %/,%,$(abspath $(MAC_DESTDIR))) -override MAC_TARGETDIR := $(patsubst %/,%,$(abspath $(MAC_TARGETDIR))) - -MAC_FRAMEWORK_DIR = /Library/Frameworks/Xamarin.Mac.framework -MAC_FRAMEWORK_VERSIONED_DIR = $(MAC_FRAMEWORK_DIR)/Versions/$(MAC_PACKAGE_VERSION) -MAC_FRAMEWORK_CURRENT_DIR = $(MAC_FRAMEWORK_DIR)/Versions/$(MAC_INSTALL_VERSION) - -MOBILE_BCL_DIR = $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/mono/Xamarin.Mac -MAC_mobile_CSC = $(SYSTEM_CSC) -features:strict -nostdlib -noconfig -r:$(MOBILE_BCL_DIR)/System.dll -r:$(MOBILE_BCL_DIR)/System.Core.dll -r:$(MOBILE_BCL_DIR)/System.Xml.dll -r:$(MOBILE_BCL_DIR)/mscorlib.dll -r:$(MOBILE_BCL_DIR)/System.Net.Http.dll -r:$(MOBILE_BCL_DIR)/Facades/System.Drawing.Common.dll -deterministic - -FULL_BCL_DIR = $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR)/lib/mono/4.5 -MAC_full_CSC = $(SYSTEM_CSC) -features:strict -nostdlib -noconfig -r:$(FULL_BCL_DIR)/System.dll -r:$(FULL_BCL_DIR)/System.Core.dll -r:$(FULL_BCL_DIR)/System.Xml.dll -r:$(FULL_BCL_DIR)/mscorlib.dll -r:$(FULL_BCL_DIR)/System.Net.Http.dll -r:$(FULL_BCL_DIR)/Facades/System.Drawing.Common.dll -deterministic - MAC_PACKAGE_FILENAME=$(MAC_PACKAGE_NAME_LOWER)-$(MAC_PACKAGE_VERSION).pkg MAC_PACKAGE_DMG_FILENAME=$(MAC_PACKAGE_NAME_LOWER)-$(MAC_PACKAGE_VERSION).dmg MAC_PACKAGE_DMG_DIRNAME="$(MAC_PACKAGE_TITLE)" MAC_PACKAGE_UTI=com.$(MAC_PACKAGE_NAME_LOWER).pkg -MAC_PACKAGE_INSTALL_LOCATION=$(MAC_FRAMEWORK_VERSIONED_DIR) TT = $(DOTNET) tool restore && $(DOTNET) t4 @@ -571,19 +358,6 @@ PRODUCT_KEY_PATH?=$(TOP)/product.snk include $(TOP)/mk/quiet.mk -IOS_SOURCE=$(TOP)/src -IOS_BUILD_SOURCE=$(IOS_SOURCE)/build/ios/native -IOS_COMMON_BUILD_SOURCE=$(IOS_SOURCE)/build/common -MAC_SOURCE=$(TOP)/src -MAC_FULL_BUILD_SOURCE=$(MAC_SOURCE)/build/mac/full -MAC_MODERN_BUILD_SOURCE=$(MAC_SOURCE)/build/mac/mobile -MAC_COMMON_BUILD_SOURCE=$(MAC_SOURCE)/build/common - -ifneq ($(BUILD_REVISION),) -IOS_CSC_FLAGS_XI=-pathmap:"$(abspath $(IOS_COMMON_BUILD_SOURCE))/=$(IOS_FRAMEWORK_DIR)/Versions/$(IOS_PACKAGE_VERSION)/src/Xamarin.iOS/" -pathmap:"$(abspath $(IOS_BUILD_SOURCE))/=$(IOS_FRAMEWORK_DIR)/Versions/$(IOS_PACKAGE_VERSION)/src/Xamarin.iOS/" -pathmap:"$(abspath $(IOS_SOURCE))/=$(IOS_FRAMEWORK_DIR)/Versions/$(IOS_PACKAGE_VERSION)/src/Xamarin.iOS/" -MAC_CSC_FLAGS_XM=-pathmap:"$(abspath $(MAC_COMMON_BUILD_SOURCE))/=$(MAC_FRAMEWORK_DIR)/Versions/$(MAC_PACKAGE_VERSION)/src/Xamarin.Mac/" -pathmap:"$(abspath $(MAC_FULL_BUILD_SOURCE))/=$(MAC_FRAMEWORK_DIR)/Versions/$(MAC_PACKAGE_VERSION)/src/Xamarin.Mac/" -pathmap:"$(abspath $(MAC_MODERN_BUILD_SOURCE))/=$(MAC_FRAMEWORK_DIR)/Versions/$(MAC_PACKAGE_VERSION)/src/Xamarin.Mac/" -pathmap:"$(abspath $(MAC_SOURCE))/=$(MAC_FRAMEWORK_DIR)/Versions/$(MAC_PACKAGE_VERSION)/src/Xamarin.Mac/" -endif - ifdef ENABLE_XAMARIN -include $(MACCORE_PATH)/Make.config endif @@ -706,10 +480,14 @@ DOTNET_PLATFORMS+=iOS DOTNET_MONOVM_PLATFORMS+=iOS DOTNET_IOS_BITNESSES+=64 DOTNET_NATIVEAOT_PLATFORMS+=iOS +XCFRAMEWORK_PLATFORMS+=iossimulator +XCFRAMEWORK_iossimulator_RUNTIME_IDENTIFIERS=iossimulator-x64 iossimulator-arm64 # 64-bit architectures ifdef INCLUDE_DEVICE DOTNET_IOS_RUNTIME_IDENTIFIERS_64=ios-arm64 +XCFRAMEWORK_PLATFORMS+=ios +XCFRAMEWORK_ios_RUNTIME_IDENTIFIERS=ios-arm64 endif # INCLUDE_DEVICE DOTNET_IOS_RUNTIME_IDENTIFIERS_64+=iossimulator-x64 iossimulator-arm64 @@ -722,8 +500,13 @@ DOTNET_PLATFORMS+=tvOS DOTNET_MONOVM_PLATFORMS+=tvOS DOTNET_TVOS_BITNESSES+=64 DOTNET_NATIVEAOT_PLATFORMS+=tvOS +XCFRAMEWORK_PLATFORMS+=tvossimulator +XCFRAMEWORK_tvossimulator_RUNTIME_IDENTIFIERS=tvossimulator-x64 tvossimulator-arm64 + ifdef INCLUDE_DEVICE DOTNET_TVOS_RUNTIME_IDENTIFIERS=tvos-arm64 tvossimulator-x64 tvossimulator-arm64 +XCFRAMEWORK_PLATFORMS+=tvos +XCFRAMEWORK_tvos_RUNTIME_IDENTIFIERS=tvos-arm64 else DOTNET_TVOS_RUNTIME_IDENTIFIERS=tvossimulator-x64 tvossimulator-arm64 endif @@ -737,6 +520,9 @@ DOTNET_MACCATALYST_BITNESSES+=64 DOTNET_NATIVEAOT_PLATFORMS+=MacCatalyst DOTNET_MACCATALYST_RUNTIME_IDENTIFIERS=maccatalyst-x64 maccatalyst-arm64 DOTNET_MACCATALYST_RUNTIME_IDENTIFIERS_64+=$(DOTNET_MACCATALYST_RUNTIME_IDENTIFIERS) +XCFRAMEWORK_PLATFORMS+=maccatalyst +XCFRAMEWORK_DESKTOP_PLATFORMS+=maccatalyst +XCFRAMEWORK_maccatalyst_RUNTIME_IDENTIFIERS=$(DOTNET_MACCATALYST_RUNTIME_IDENTIFIERS) endif ifdef INCLUDE_MAC @@ -746,6 +532,9 @@ DOTNET_MACOS_BITNESSES+=64 DOTNET_NATIVEAOT_PLATFORMS+=macOS DOTNET_MACOS_RUNTIME_IDENTIFIERS=osx-x64 osx-arm64 DOTNET_MACOS_RUNTIME_IDENTIFIERS_64=$(DOTNET_MACOS_RUNTIME_IDENTIFIERS) +XCFRAMEWORK_PLATFORMS+=macos +XCFRAMEWORK_DESKTOP_PLATFORMS+=macos +XCFRAMEWORK_macos_RUNTIME_IDENTIFIERS=$(DOTNET_MACOS_RUNTIME_IDENTIFIERS) endif ifdef INCLUDE_IOS @@ -772,10 +561,11 @@ DOTNET_PLATFORMS_UPPERCASE:=$(shell echo $(DOTNET_PLATFORMS) | tr a-z A-Z) DOTNET_DESKTOP_PLATFORMS:=$(filter macOS MacCatalyst,$(DOTNET_PLATFORMS)) # a few lookup tables, because the data we have is not always in the format we need it + +# RUNTIMEIDENTIFIER -> architecture DOTNET_iossimulator-x64_ARCHITECTURES=x86_64 DOTNET_iossimulator-arm64_ARCHITECTURES=arm64 DOTNET_iossimulator-x86_ARCHITECTURES=x86 -DOTNET_ios-arm_ARCHITECTURES=armv7 armv7s DOTNET_ios-arm64_ARCHITECTURES=arm64 DOTNET_tvossimulator-x64_ARCHITECTURES=x86_64 DOTNET_tvossimulator-arm64_ARCHITECTURES=arm64 @@ -803,6 +593,39 @@ DOTNET_tvOS_SDK_PLATFORMS=tvsimulator tvos DOTNET_macOS_SDK_PLATFORMS=mac DOTNET_MacCatalyst_SDK_PLATFORMS=maccatalyst +# XCFRAMEWORK_PLATFORM -> PLATFORM +DOTNET_iossimulator_PLATFORM=ios +DOTNET_ios_PLATFORM=ios +DOTNET_tvossimulator_PLATFORM=tvos +DOTNET_tvos_PLATFORM=tvos +DOTNET_maccatalyst_PLATFORM=maccatalyst +DOTNET_macos_PLATFORM=macos + +# XCFRAMEWORK -> clang argument for min OS version +CLANG_iossimulator-x64_VERSION_MIN=-mios-simulator-version-min=$(MIN_IOS_SDK_VERSION) +CLANG_iossimulator-arm64_VERSION_MIN=-mios-simulator-version-min=$(MIN_IOS_SDK_VERSION) +CLANG_ios-arm64_VERSION_MIN=-miphoneos-version-min=$(MIN_IOS_SDK_VERSION) +CLANG_tvossimulator-x64_VERSION_MIN=-mtvos-simulator-version-min=$(MIN_TVOS_SDK_VERSION) +CLANG_tvossimulator-arm64_VERSION_MIN=-mtvos-simulator-version-min=$(MIN_TVOS_SDK_VERSION) +CLANG_tvos-arm64_VERSION_MIN=-mtvos-version-min=$(MIN_TVOS_SDK_VERSION) +CLANG_maccatalyst-x64_VERSION_MIN=-target x86_64-apple-ios$(MIN_MACCATALYST_SDK_VERSION)-macabi -arch x86_64 +CLANG_maccatalyst-arm64_VERSION_MIN=-target arm64-apple-ios$(MIN_MACCATALYST_SDK_VERSION)-macabi -arch arm64 +CLANG_osx-x64_VERSION_MIN=-mmacosx-version-min=$(MIN_MACOS_SDK_VERSION) +CLANG_osx-arm64_VERSION_MIN=-mmacosx-version-min=$(MIN_MACOS_SDK_VERSION) + +# RUNTIMEIDENTIFIER -> swiftc argument(s) for min OS version +SWIFTC_iossimulator-arm64_VERSION_MIN=-target arm64-apple-ios$(MIN_IOS_SDK_VERSION)-simulator +SWIFTC_iossimulator-x64_VERSION_MIN=-target x86_64-apple-ios$(MIN_IOS_SDK_VERSION)-simulator +SWIFTC_ios-arm64_VERSION_MIN=-target arm64-apple-ios$(MIN_IOS_SDK_VERSION) +SWIFTC_tvossimulator-x64_VERSION_MIN=-target x86_64-apple-tvos$(MIN_TVOS_SDK_VERSION)-simulator +SWIFTC_tvossimulator-arm64_VERSION_MIN=-target arm64-apple-tvos$(MIN_TVOS_SDK_VERSION)-simulator +SWIFTC_tvos-arm64_VERSION_MIN=-target arm64-apple-tvos$(MIN_TVOS_SDK_VERSION) +SWIFTC_maccatalyst-x64_VERSION_MIN=-target x86_64-apple-ios$(MIN_MACCATALYST_SDK_VERSION)-macabi +SWIFTC_maccatalyst-arm64_VERSION_MIN=-target arm64-apple-ios$(MIN_MACCATALYST_SDK_VERSION)-macabi +SWIFTC_osx-x64_VERSION_MIN=-target x86_64-apple-macos$(MIN_MACOS_SDK_VERSION) +SWIFTC_osx-arm64_VERSION_MIN=-target arm64-apple-macos$(MIN_MACOS_SDK_VERSION) + + # Misc other computed variables $(foreach platform,$(DOTNET_PLATFORMS),$(eval $(shell echo $(platform) | tr a-z A-Z)_NUGET_SDK_NAME=Microsoft.$(platform).Sdk.$(DOTNET_TFM)_$($(platform)_NUGET_OS_VERSION))) $(foreach platform,$(DOTNET_PLATFORMS),$(eval $(shell echo $(platform) | tr a-z A-Z)_NUGET_REF_NAME=Microsoft.$(platform).Ref.$(DOTNET_TFM)_$($(platform)_NUGET_OS_VERSION))) diff --git a/Makefile b/Makefile index 37022cb4f2e..93926911ee2 100644 --- a/Makefile +++ b/Makefile @@ -43,16 +43,6 @@ show-versions: @echo " The .NET NuGet(s):" @$(foreach platform,$(DOTNET_PLATFORMS),echo " Microsoft.$(platform) $($(shell echo $(platform) | tr 'a-z' 'A-Z')_NUGET_VERSION_FULL)";) -check-permissions: -ifdef INCLUDE_MAC - @UNREADABLE=`find $(MAC_DESTDIR) ! -perm -0644`; if ! test -z "$$UNREADABLE"; then echo "There are files with invalid permissions (all installed files at least be readable by everybody, and writable by owner: 0644): "; find $(MAC_DESTDIR) ! -perm -0644 | xargs ls -la; exit 1; fi - @echo Validated file permissions for Xamarin.Mac. -endif -ifdef INCLUDE_IOS - @UNREADABLE=`find $(IOS_DESTDIR) ! -perm -0644`; if ! test -z "$$UNREADABLE"; then echo "There are files with invalid permissions (all installed files at least be readable by everybody, and writable by owner: 0644): "; find $(IOS_DESTDIR) ! -perm -0644 | xargs ls -la; exit 1; fi - @echo Validated file permissions for Xamarin.iOS. -endif - all-local:: global.json # This tells NuGet to use the exact same dotnet version we've configured in Make.config @@ -71,34 +61,6 @@ install-hook:: fi install-hook:: - @$(MAKE) check-permissions -ifdef INCLUDE_IOS -ifneq ($(findstring $(IOS_DESTDIR)$(MONOTOUCH_PREFIX),$(shell ls -l /Library/Frameworks/Xamarin.iOS.framework/Versions/Current 2>&1)),) - @echo - @echo " This build of Xamarin.iOS is the now default version on your system. " - @echo -else - @echo - @echo " Xamarin.iOS has not been installed into your system by 'make install'" - @echo " In order to set the currently built Xamarin.iOS as your system version," - @echo " execute 'make install-system'". - @echo -endif -endif -ifdef INCLUDE_MAC -ifndef INCLUDE_IOS - @echo -endif -ifneq ($(findstring $(abspath $(MAC_DESTDIR)$(MAC_FRAMEWORK_DIR)/Versions),$(shell ls -l $(MAC_FRAMEWORK_DIR)/Versions/Current 2>&1)),) - @echo " This build of Xamarin.Mac is the now default version on your system. " - @echo -else - @echo " Xamarin.Mac has not been installed into your system by 'make install'" - @echo " In order to set the currently built Xamarin.Mac as your system version," - @echo " execute 'make install-system'". - @echo -endif -endif $(Q) $(MAKE) -C dotnet shutdown-build-server .PHONY: package release @@ -117,41 +79,6 @@ package release: dotnet-install-system: $(Q) $(MAKE) -C dotnet install-system -install-system: install-system-ios install-system-mac - @# Clean up some old files - $(Q) rm -Rf /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/iOS - $(Q) rm -Rf /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Xamarin.ObjcBinding.CSharp.targets - $(Q) rm -Rf /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Xamarin.Common.CSharp.targets - $(Q) rm -Rf /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Xamarin.ObjcBinding.Tasks.dll - $(Q) rm -Rf /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Mac - $(Q) $(MAKE) install-symlinks MAC_DESTDIR=/ MAC_INSTALL_VERSION=Current IOS_DESTDIR=/ IOS_INSTALL_VERSION=Current -C msbuild V=$(V) - -install-system-ios: -ifdef INCLUDE_IOS - @if ! test -s "$(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/buildinfo"; then echo "The Xamarin.iOS build seems incomplete. Did you run \"make install\"?"; exit 1; fi - $(Q) rm -f /Library/Frameworks/Xamarin.iOS.framework/Versions/Current - $(Q) mkdir -p /Library/Frameworks/Xamarin.iOS.framework/Versions - $(Q) ln -s $(IOS_DESTDIR)$(MONOTOUCH_PREFIX) /Library/Frameworks/Xamarin.iOS.framework/Versions/Current - $(Q) echo Installed Xamarin.iOS into /Library/Frameworks/Xamarin.iOS.framework/Versions/Current -endif - -install-system-mac: -ifdef INCLUDE_MAC - @if ! test -s "$(MAC_DESTDIR)/$(MAC_FRAMEWORK_CURRENT_DIR)/buildinfo" ; then echo "The Xamarin.Mac build seems incomplete. Did you run \"make install\"?"; exit 1; fi - $(Q) rm -f $(MAC_FRAMEWORK_DIR)/Versions/Current - $(Q) mkdir -p $(MAC_FRAMEWORK_DIR)/Versions - $(Q) ln -s $(MAC_DESTDIR)$(MAC_FRAMEWORK_CURRENT_DIR) $(MAC_FRAMEWORK_DIR)/Versions/Current - $(Q) echo Installed Xamarin.Mac into $(MAC_FRAMEWORK_DIR)/Versions/Current -endif - -fix-install-permissions: - sudo mkdir -p /Library/Frameworks/Mono.framework/External/ - sudo mkdir -p /Library/Frameworks/Xamarin.iOS.framework - sudo mkdir -p /Library/Frameworks/Xamarin.Mac.framework - sudo chown -R $(USER) /Library/Frameworks/Mono.framework/External/ - sudo chown -R $(USER) /Library/Frameworks/Xamarin.iOS.framework - sudo chown -R $(USER) /Library/Frameworks/Xamarin.Mac.framework - fix-xcode-select: sudo xcode-select -s $(XCODE_DEVELOPER_ROOT) diff --git a/mk/quiet.mk b/mk/quiet.mk index 52062f906ed..182225b159d 100644 --- a/mk/quiet.mk +++ b/mk/quiet.mk @@ -46,23 +46,6 @@ Q_PROF_SN = $(if $(V),,@echo "SN [$(1)] $(@F)";) Q_1 = $(if $(V),,@echo "$(1) $(@F)";) Q_2 = $(if $(V),,@echo "$(1) $(2) $(@F)";) -ASCOMPILE = $(Q_AS) $(AS) -CSCOMPILE = $(Q_MCS) $(MCS) -CCOMPILE = $(Q_CC) $(CC) -CXXCOMPILE = $(Q_CC) $(CXX) -OBJCCOMPILE = $(Q_OBJC) $(CC) - -DEVICE_OBJCCOMPILE = $(Q_OBJC) $(DEVICE_CC) -DEVICE_OBJCTCOMPILE = $(QT_OBJC) $(DEVICE_CC) -DEVICE_CCOMPILE = $(Q_CC) $(DEVICE_CC) -DEVICE_CTCOMPILE = $(QT_CC) $(DEVICE_CC) - -SIMULATOR_OBJCCOMPILE = $(Q_OBJC) $(SIMULATOR_CC) -SIMULATOR_OBJCTCOMPILE = $(QT_OBJC) $(SIMULATOR_CC) -SIMULATOR_CCOMPILE = $(Q_CC) $(SIMULATOR_CC) -SIMULATOR_CTCOMPILE = $(QT_CC) $(SIMULATOR_CC) -SIMULATOR_ASCOMPILE = $(Q_AS) $(SIMULATOR_CC) - ifeq ($(V),) ifeq ($(BUILD_REVISION)$(JENKINS_HOME),) # non-verbose local build diff --git a/mk/rules.mk b/mk/rules.mk index 0dbb9a5c207..92a74c839ab 100644 --- a/mk/rules.mk +++ b/mk/rules.mk @@ -1,327 +1,134 @@ # helpful rules to compile things for the various architectures -COMMON_I:= -I. -SIM32_I := $(COMMON_I) -SIM64_I := $(COMMON_I) -SIM_ARM64_I := $(COMMON_I) -DEV7_I := $(COMMON_I) -DEV7s_I := $(COMMON_I) -DEV64_I := $(COMMON_I) - -SIMW_I := $(COMMON_I) -SIMW64_I := $(COMMON_I) -DEVW_I := $(COMMON_I) -DEVW64_32_I := $(COMMON_I) - -SIM_TV_I:= $(COMMON_I) -SIM_ARM64_TV_I := $(COMMON_I) -DEV_TV_I:= $(COMMON_I) - -define NativeCompilationTemplate - -## ios simulator - -### X86 - -.libs/iphonesimulator/%$(1).x86.o: %.m $(EXTRA_DEPENDENCIES) | .libs/iphonesimulator - $$(call Q_2,OBJC, [iphonesimulator]) $(SIMULATOR_CC) $(SIMULATOR86_OBJC_CFLAGS) $$(EXTRA_DEFINES) $(SIM32_I) -g $(2) -c $$< -o $$@ - -.libs/iphonesimulator/%$(1).x86.o: %.c $(EXTRA_DEPENDENCIES) | .libs/iphonesimulator - $$(call Q_2,CC, [iphonesimulator]) $(SIMULATOR_CC) $(SIMULATOR86_CFLAGS) $$(EXTRA_DEFINES) $(SIM32_I) -g $(2) -c $$< -o $$@ - -.libs/iphonesimulator/%$(1).x86.o: %.s $(EXTRA_DEPENDENCIES) | .libs/iphonesimulator - $$(call Q_2,ASM, [iphonesimulator]) $(SIMULATOR_CC) $(SIMULATOR86_CFLAGS) $$(EXTRA_DEFINES) $(SIM32_I) -g $(2) -c $$< -o $$@ - -.libs/iphonesimulator/%$(1).x86.dylib: | .libs/iphonesimulator - $$(call Q_2,LD, [iphonesimulator]) $(SIMULATOR_CC) $(SIMULATOR86_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -L$(IOS_DESTDIR)$(XAMARIN_IOSSIMULATOR_SDK)/lib -fapplication-extension - -.libs/iphonesimulator/%$(1).x86.framework: | .libs/iphonesimulator - $$(call Q_2,LD, [iphonesimulator]) $(SIMULATOR_CC) $(SIMULATOR86_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -F$(IOS_DESTDIR)$(XAMARIN_IOSSIMULATOR_SDK)/Frameworks -fapplication-extension - -### X64 - -.libs/iphonesimulator/%$(1).x86_64.o: %.m $(EXTRA_DEPENDENCIES) | .libs/iphonesimulator - $$(call Q_2,OBJC, [iphonesimulator]) $(SIMULATOR_CC) $(SIMULATOR64_OBJC_CFLAGS) $$(EXTRA_DEFINES) $(SIM64_I) -g $(2) -c $$< -o $$@ - -.libs/iphonesimulator/%$(1).x86_64.o: %.c $(EXTRA_DEPENDENCIES) | .libs/iphonesimulator - $$(call Q_2,CC, [iphonesimulator]) $(SIMULATOR_CC) $(SIMULATOR64_CFLAGS) $$(EXTRA_DEFINES) $(SIM64_I) -g $(2) -c $$< -o $$@ - -.libs/iphonesimulator/%$(1).x86_64.o: %.s $(EXTRA_DEPENDENCIES) | .libs/iphonesimulator - $$(call Q_2,ASM, [iphonesimulator]) $(SIMULATOR_CC) $(SIMULATOR64_CFLAGS) $(SIM64_I) -g $(2) -c $$< -o $$@ - -.libs/iphonesimulator/%$(1).x86_64.dylib: %.swift | .libs/iphonesimulator - $$(call Q_2,SWIFT, [iphonesimulator]) $(SWIFTC) $(IOS_SIMULATOR_X64_SWIFTFLAGS) $$< -o $$@ - -.libs/iphonesimulator/%$(1).x86_64.o: %.swift | .libs/iphonesimulator - $$(call Q_2,SWIFT, [iphonesimulator]) $(SWIFTC) $(IOS_SIMULATOR_X64_SWIFTFLAGS) $$< -o $$@ -emit-object - -.libs/iphonesimulator/%$(1).x86_64.dylib: | .libs/iphonesimulator - $$(call Q_2,LD, [iphonesimulator]) $(SIMULATOR_CC) $(SIMULATOR64_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -L$(IOS_DESTDIR)$(XAMARIN_IOSSIMULATOR_SDK)/lib -fapplication-extension - -.libs/iphonesimulator/%$(1).x86_64.framework: | .libs/iphonesimulator - $$(call Q_2,LD, [iphonesimulator]) $(SIMULATOR_CC) $(SIMULATOR64_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -F$(IOS_DESTDIR)$(XAMARIN_IOSSIMULATOR_SDK)/Frameworks -fapplication-extension - -### ARM64 - -.libs/iphonesimulator/%$(1).arm64.o: %.m $(EXTRA_DEPENDENCIES) | .libs/iphonesimulator - $$(call Q_2,OBJC, [iphonesimulator]) $(SIMULATOR_CC) $(SIMULATOR_ARM64_OBJC_CFLAGS) $$(EXTRA_DEFINES) $(SIM_ARM64_I) -g $(2) -c $$< -o $$@ - -.libs/iphonesimulator/%$(1).arm64.o: %.c $(EXTRA_DEPENDENCIES) | .libs/iphonesimulator - $$(call Q_2,CC, [iphonesimulator]) $(SIMULATOR_CC) $(SIMULATOR_ARM64_CFLAGS) $$(EXTRA_DEFINES) $(SIM_ARM64_I) -g $(2) -c $$< -o $$@ - -.libs/iphonesimulator/%$(1).arm64.o: %.s $(EXTRA_DEPENDENCIES) | .libs/iphonesimulator - $$(call Q_2,ASM, [iphonesimulator]) $(SIMULATOR_CC) $(SIMULATOR_ARM64_CFLAGS) $(SIM64_I) -g $(2) -c $$< -o $$@ - -.libs/iphonesimulator/%$(1).arm64.dylib: %.swift | .libs/iphonesimulator - $$(call Q_2,SWIFT, [iphonesimulator]) $(SWIFTC) $(IOS_SIMULATOR_ARM64_SWIFTFLAGS) $$< -o $$@ - -.libs/iphonesimulator/%$(1).arm64.o: %.swift | .libs/iphonesimulator - $$(call Q_2,SWIFT, [iphonesimulator]) $(SWIFTC) $(IOS_SIMULATOR_ARM64_SWIFTFLAGS) $$< -o $$@ -emit-object - -.libs/iphonesimulator/%$(1).arm64.dylib: | .libs/iphonesimulator - $$(call Q_2,LD, [iphonesimulator]) $(SIMULATOR_CC) $(SIMULATOR_ARM64_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -L$(IOS_DESTDIR)$(XAMARIN_IOSSIMULATOR_SDK)/lib -fapplication-extension - -.libs/iphonesimulator/%$(1).arm64.framework: | .libs/iphonesimulator - $$(call Q_2,LD, [iphonesimulator]) $(SIMULATOR_CC) $(SIMULATOR_ARM64_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -F$(IOS_DESTDIR)$(XAMARIN_IOSSIMULATOR_SDK)/Frameworks -fapplication-extension - - -## ios device - -.libs/iphoneos/%$(1).armv7.o: %.m $(EXTRA_DEPENDENCIES) | .libs/iphoneos - $$(call Q_2,OBJC, [iphoneos]) $(DEVICE_CC) $(DEVICE7_OBJC_CFLAGS) $$(EXTRA_DEFINES) $(DEV7_I) -g $(2) -c $$< -o $$@ - -.libs/iphoneos/%$(1).armv7.o: %.c $(EXTRA_DEPENDENCIES) | .libs/iphoneos - $$(call Q_2,CC, [iphoneos]) $(DEVICE_CC) $(DEVICE7_CFLAGS) $$(EXTRA_DEFINES) $(DEV7_I) -g $(2) -c $$< -o $$@ - -.libs/iphoneos/%$(1).armv7.dylib: | .libs/iphoneos - $$(call Q_2,LD, [iphoneos]) $(DEVICE_CC) $(DEVICE7_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -L$(IOS_DESTDIR)$(XAMARIN_IPHONEOS_SDK)/lib -fapplication-extension - -.libs/iphoneos/%$(1).armv7.framework: | .libs/iphoneos - $$(call Q_2,LD, [iphoneos]) $(DEVICE_CC) $(DEVICE7_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -F$(IOS_DESTDIR)$(XAMARIN_IPHONEOS_SDK)/Frameworks -fapplication-extension - -.libs/iphoneos/%$(1).armv7s.o: %.m $(EXTRA_DEPENDENCIES) | .libs/iphoneos - $$(call Q_2,OBJC, [iphoneos]) $(DEVICE_CC) $(DEVICE7S_OBJC_CFLAGS) $$(EXTRA_DEFINES) $(DEV7s_I) -g $(2) -c $$< -o $$@ - -.libs/iphoneos/%$(1).armv7s.o: %.c $(EXTRA_DEPENDENCIES) | .libs/iphoneos - $$(call Q_2,CC, [iphoneos]) $(DEVICE_CC) $(DEVICE7S_CFLAGS) $$(EXTRA_DEFINES) $(DEV7s_I) -g $(2) -c $$< -o $$@ - -.libs/iphoneos/%$(1).armv7s.dylib: | .libs/iphoneos - $$(call Q_2,LD, [iphoneos]) $(DEVICE_CC) $(DEVICE7S_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -L$(IOS_DESTDIR)$(XAMARIN_IPHONEOS_SDK)/lib -fapplication-extension - -.libs/iphoneos/%$(1).armv7s.framework: | .libs/iphoneos - $$(call Q_2,LD, [iphoneos]) $(DEVICE_CC) $(DEVICE7S_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -F$(IOS_DESTDIR)$(XAMARIN_IPHONEOS_SDK)/Frameworks -fapplication-extension - -.libs/iphoneos/%$(1).arm64.o: %.m $(EXTRA_DEPENDENCIES) | .libs/iphoneos - $$(call Q_2,OBJC, [iphoneos]) $(DEVICE_CC) $(DEVICE64_OBJC_CFLAGS) $$(EXTRA_DEFINES) $(DEV64_I) -g $(2) -c $$< -o $$@ - -.libs/iphoneos/%$(1).arm64.o: %.c $(EXTRA_DEPENDENCIES) | .libs/iphoneos - $$(call Q_2,CC, [iphoneos]) $(DEVICE_CC) $(DEVICE64_CFLAGS) $$(EXTRA_DEFINES) $(DEV64_I) -g $(2) -c $$< -o $$@ - -.libs/iphoneos/%$(1).arm64.o: %.s $(EXTRA_DEPENDENCIES) | .libs/iphoneos - $$(call Q_2,ASM, [iphoneos]) $(DEVICE_CC) $(DEVICE64_CFLAGS) $$(EXTRA_DEFINES) $(DEV64_I) -g $(2) -c $$< -o $$@ - -.libs/iphoneos/%$(1).arm64.dylib: %.swift | .libs/iphoneos - $$(call Q_2,SWIFT, [iphoneos]) $(SWIFTC) $(IOS_DEVICE_ARM64_SWIFTFLAGS) $$< -o $$@ - -.libs/iphoneos/%$(1).arm64.o: %.swift | .libs/iphoneos - $$(call Q_2,SWIFT, [iphoneos]) $(SWIFTC) $(IOS_DEVICE_ARM64_SWIFTFLAGS) $$< -o $$@ -emit-object - -.libs/iphoneos/%$(1).arm64.dylib: | .libs/iphoneos - $$(call Q_2,LD, [iphoneos]) $(DEVICE_CC) $(DEVICE64_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -L$(IOS_DESTDIR)$(XAMARIN_IPHONEOS_SDK)/lib -fapplication-extension - -.libs/iphoneos/%$(1).arm64.framework: | .libs/iphoneos - $$(call Q_2,LD, [iphoneos]) $(DEVICE_CC) $(DEVICE64_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -F$(IOS_DESTDIR)$(XAMARIN_IPHONEOS_SDK)/Frameworks -fapplication-extension -miphoneos-version-min=$(MIN_IOS_SDK_VERSION) - -## maccatalyst (ios on macOS / Catalyst) - -.libs/maccatalyst/%$(1).x86_64.o: %.m $(EXTRA_DEPENDENCIES) | .libs/maccatalyst - $$(call Q_2,OBJC, [maccatalyst]) $(XCODE_CC) $(MACCATALYST_X86_64_OBJC_CFLAGS) $$(EXTRA_DEFINES) $(COMMON_I) -g $(2) -c $$< -o $$@ - -.libs/maccatalyst/%$(1).x86_64.o: %.c $(EXTRA_DEPENDENCIES) | .libs/maccatalyst - $$(call Q_2,CC, [maccatalyst]) $(XCODE_CC) $(MACCATALYST_X86_64_CFLAGS) $$(EXTRA_DEFINES) $(COMMON_I) -g $(2) -c $$< -o $$@ - -.libs/maccatalyst/%$(1).x86_64.o: %.s $(EXTRA_DEPENDENCIES) | .libs/maccatalyst - $$(call Q_2,ASM, [maccatalyst]) $(XCODE_CC) $(MACCATALYST_X86_64_CFLAGS) $(COMMON_I) -g $(2) -c $$< -o $$@ - -.libs/maccatalyst/%$(1).x86_64.dylib: %.swift | .libs/maccatalyst - $$(call Q_2,SWIFT, [maccatalyst]) $(SWIFTC) $(MACCATALYST_X64_SWIFTFLAGS) $$< -o $$@ - -.libs/maccatalyst/%$(1).x86_64.o: %.swift | .libs/maccatalyst - $$(call Q_2,SWIFT, [maccatalyst]) $(SWIFTC) $(MACCATALYST_X64_SWIFTFLAGS) $$< -o $$@ -emit-object - -.libs/maccatalyst/%$(1).x86_64.dylib: | .libs/maccatalyst - $$(call Q_2,LD, [maccatalyst]) $(XCODE_CC) $(MACCATALYST_X86_64_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -L$(IOS_DESTDIR)$(XAMARIN_MACCATALYST_SDK)/lib -fapplication-extension - -.libs/maccatalyst/%$(1).x86_64.framework: | .libs/maccatalyst - $$(call Q_2,LD, [maccatalyst]) $(XCODE_CC) $(MACCATALYST_X86_64_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -F$(IOS_DESTDIR)$(XAMARIN_MACCATALYST_SDK)/Frameworks -fapplication-extension - -.libs/maccatalyst/%$(1).arm64.o: %.m $(EXTRA_DEPENDENCIES) | .libs/maccatalyst - $$(call Q_2,OBJC, [maccatalyst]) $(XCODE_CC) $(MACCATALYST_ARM64_OBJC_CFLAGS) $$(EXTRA_DEFINES) $(COMMON_I) -g $(2) -c $$< -o $$@ - -.libs/maccatalyst/%$(1).arm64.o: %.c $(EXTRA_DEPENDENCIES) | .libs/maccatalyst - $$(call Q_2,CC, [maccatalyst]) $(XCODE_CC) $(MACCATALYST_ARM64_CFLAGS) $$(EXTRA_DEFINES) $(COMMON_I) -g $(2) -c $$< -o $$@ - -.libs/maccatalyst/%$(1).arm64.o: %.s $(EXTRA_DEPENDENCIES) | .libs/maccatalyst - $$(call Q_2,ASM, [maccatalyst]) $(XCODE_CC) $(MACCATALYST_ARM64_CFLAGS) $(COMMON_I) -g $(2) -c $$< -o $$@ - -.libs/maccatalyst/%$(1).arm64.dylib: %.swift | .libs/maccatalyst - $$(call Q_2,SWIFT, [maccatalyst]) $(SWIFTC) $(MACCATALYST_ARM64_SWIFTFLAGS) $$< -o $$@ - -.libs/maccatalyst/%$(1).arm64.o: %.swift | .libs/maccatalyst - $$(call Q_2,SWIFT, [maccatalyst]) $(SWIFTC) $(MACCATALYST_ARM64_SWIFTFLAGS) $$< -o $$@ -emit-object - -.libs/maccatalyst/%$(1).arm64.dylib: | .libs/maccatalyst - $$(call Q_2,LD, [maccatalyst]) $(XCODE_CC) $(MACCATALYST_ARM64_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -L$(IOS_DESTDIR)$(XAMARIN_MACCATALYST_SDK)/lib -fapplication-extension - -.libs/maccatalyst/%$(1).arm64.framework: | .libs/maccatalyst - $$(call Q_2,LD, [maccatalyst]) $(XCODE_CC) $(MACCATALYST_ARM64_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -F$(IOS_DESTDIR)$(XAMARIN_MACCATALYST_SDK)/Frameworks -fapplication-extension - -## tv simulator - -### X64 - -.libs/tvsimulator/%$(1).x86_64.o: %.m $(EXTRA_DEPENDENCIES) | .libs/tvsimulator - $$(call Q_2,OBJC, [tvsimulator]) $(SIMULATOR_CC) $(SIMULATORTV_OBJC_CFLAGS) $$(EXTRA_DEFINES) $(SIM_TV_I) -g $(2) -c $$< -o $$@ - -.libs/tvsimulator/%$(1).x86_64.o: %.c $(EXTRA_DEPENDENCIES) | .libs/tvsimulator - $$(call Q_2,CC, [tvsimulator]) $(SIMULATOR_CC) $(SIMULATORTV_CFLAGS) $$(EXTRA_DEFINES) $(SIM_TV_I) -g $(2) -c $$< -o $$@ - -.libs/tvsimulator/%$(1).x86_64.o: %.s $(EXTRA_DEPENDENCIES) | .libs/tvsimulator - $$(call Q_2,ASM, [tvsimulator]) $(SIMULATOR_CC) $(SIMULATORTV_CFLAGS) $$(EXTRA_DEFINES) $(SIM_TV_I) -g $(2) -c $$< -o $$@ - -.libs/tvsimulator/%$(1).x86_64.dylib: %.swift | .libs/tvsimulator - $$(call Q_2,SWIFT, [tvsimulator]) $(SWIFTC) $(TVOS_SIMULATOR_X64_SWIFTFLAGS) $$< -o $$@ - -.libs/tvsimulator/%$(1).x86_64.o: %.swift | .libs/tvsimulator - $$(call Q_2,SWIFT, [tvsimulator]) $(SWIFTC) $(TVOS_SIMULATOR_X64_SWIFTFLAGS) $$< -o $$@ -emit-object - -.libs/tvsimulator/%$(1).x86_64.dylib: | .libs/tvsimulator - $$(call Q_2,LD, [tvsimulator]) $(SIMULATOR_CC) $(SIMULATORTV_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -L$(IOS_DESTDIR)$(XAMARIN_TVSIMULATOR_SDK)/lib -fapplication-extension - -.libs/tvsimulator/%$(1).x86_64.framework: | .libs/tvsimulator - $$(call Q_2,LD, [tvsimulator]) $(SIMULATOR_CC) $(SIMULATORTV_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -F$(IOS_DESTDIR)$(XAMARIN_TVSIMULATOR_SDK)/Frameworks -fapplication-extension - -### ARM64 - -.libs/tvsimulator/%$(1).arm64.o: %.m $(EXTRA_DEPENDENCIES) | .libs/tvsimulator - $$(call Q_2,OBJC, [tvsimulator]) $(SIMULATOR_CC) $(SIMULATORTV_ARM64_OBJC_CFLAGS) $$(EXTRA_DEFINES) $(SIM_ARM64_TV_I) -g $(2) -c $$< -o $$@ - -.libs/tvsimulator/%$(1).arm64.o: %.c $(EXTRA_DEPENDENCIES) | .libs/tvsimulator - $$(call Q_2,CC, [tvsimulator]) $(SIMULATOR_CC) $(SIMULATORTV_ARM64_CFLAGS) $$(EXTRA_DEFINES) $(SIM_ARM64_TV_I) -g $(2) -c $$< -o $$@ - -.libs/tvsimulator/%$(1).arm64.o: %.s $(EXTRA_DEPENDENCIES) | .libs/tvsimulator - $$(call Q_2,ASM, [tvsimulator]) $(SIMULATOR_CC) $(SIMULATORTV_ARM64_CFLAGS) $$(EXTRA_DEFINES) $(SIM_ARM64_TV_I) -g $(2) -c $$< -o $$@ - -.libs/tvsimulator/%$(1).arm64.dylib: %.swift | .libs/tvsimulator - $$(call Q_2,SWIFT, [tvsimulator]) $(SWIFTC) $(TVOS_SIMULATOR_ARM64_SWIFTFLAGS) $$< -o $$@ - -.libs/tvsimulator/%$(1).arm64.o: %.swift | .libs/tvsimulator - $$(call Q_2,SWIFT, [tvsimulator]) $(SWIFTC) $(TVOS_SIMULATOR_ARM64_SWIFTFLAGS) $$< -o $$@ -emit-object - -.libs/tvsimulator/%$(1).arm64.dylib: | .libs/tvsimulator - $$(call Q_2,LD, [tvsimulator]) $(SIMULATOR_CC) $(SIMULATORTV_ARM64_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -L$(IOS_DESTDIR)$(XAMARIN_TVSIMULATOR_SDK)/lib -fapplication-extension - -.libs/tvsimulator/%$(1).arm64.framework: | .libs/tvsimulator - $$(call Q_2,LD, [tvsimulator]) $(SIMULATOR_CC) $(SIMULATORTV_ARM64_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -F$(IOS_DESTDIR)$(XAMARIN_TVSIMULATOR_SDK)/Frameworks -fapplication-extension - -## tv device - -.libs/tvos/%$(1).arm64.o: %.m $(EXTRA_DEPENDENCIES) | .libs/tvos - $$(call Q_2,OBJC, [tvos]) $(DEVICE_CC) $(DEVICETV_OBJC_CFLAGS) $$(EXTRA_DEFINES) $(DEV_TV_I) -g $(2) -c $$< -o $$@ - -.libs/tvos/%$(1).arm64.o: %.c $(EXTRA_DEPENDENCIES) | .libs/tvos - $$(call Q_2,CC, [tvos]) $(DEVICE_CC) $(DEVICETV_CFLAGS) $$(EXTRA_DEFINES) $(DEV_TV_I) -g $(2) -c $$< -o $$@ - -.libs/tvos/%$(1).arm64.o: %.s $(EXTRA_DEPENDENCIES) | .libs/tvos - $$(call Q_2,ASM, [tvos]) $(DEVICE_CC) $(DEVICETV_CFLAGS) $$(EXTRA_DEFINES) $(DEV_TV_I) -g $(2) -c $$< -o $$@ - -.libs/tvos/%$(1).arm64.dylib: %.swift | .libs/tvos - $$(call Q_2,SWIFT, [tvos]) $(SWIFTC) $(TVOS_DEVICE_ARM64_SWIFTFLAGS) $$< -o $$@ - -.libs/tvos/%$(1).arm64.o: %.swift | .libs/tvos - $$(call Q_2,SWIFT, [tvos]) $(SWIFTC) $(TVOS_DEVICE_ARM64_SWIFTFLAGS) $$< -o $$@ -emit-object - -.libs/tvos/%$(1).arm64.dylib: | .libs/tvos - $$(call Q_2,LD, [tvos]) $(DEVICE_CC) $(DEVICETV_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -L$(IOS_DESTDIR)$(XAMARIN_TVOS_SDK)/lib -fapplication-extension - -.libs/tvos/%$(1).arm64.framework: | .libs/tvos - $$(call Q_2,LD, [tvos]) $(DEVICE_CC) $(DEVICETV_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -F$(IOS_DESTDIR)$(XAMARIN_TVOS_SDK)/Frameworks -fapplication-extension - -## macOS - -.libs/mac/%$(1).x86_64.o: %.m $(EXTRA_DEPENDENCIES) | .libs/mac - $$(call Q_2,OBJC, [mac]) $(MAC_CC) $(MAC_OBJC_CFLAGS) $$(EXTRA_DEFINES) -arch x86_64 $(COMMON_I) -g $(2) -c $$< -o $$@ - -.libs/mac/%$(1).x86_64.o: %.c $(EXTRA_DEPENDENCIES) | .libs/mac - $$(call Q_2,CC, [mac]) $(MAC_CC) $(MAC_CFLAGS) $$(EXTRA_DEFINES) -arch x86_64 $(COMMON_I) -g $(2) -c $$< -o $$@ - -.libs/mac/%$(1).x86_64.o: %.s $(EXTRA_DEPENDENCIES) | .libs/mac - $$(call Q_2,ASM, [mac]) $(MAC_CC) $(MAC_CFLAGS) -arch x86_64 $(COMMON_I) -g $(2) -c $$< -o $$@ - -.libs/mac/%$(1).x86_64.dylib: %.swift | .libs/mac - $$(call Q_2,SWIFT, [mac]) $(SWIFTC) $(MACOS_X64_SWIFTFLAGS) $$< -o $$@ - -.libs/mac/%$(1).x86_64.o: %.swift | .libs/mac - $$(call Q_2,SWIFT, [mac]) $(SWIFTC) $(MACOS_X64_SWIFTFLAGS) $$< -o $$@ -emit-object - -.libs/macos/%$(1).x86_64.dylib: %.swift | .libs/mac - $$(call Q_2,SWIFT, [macos]) $(SWIFTC) $(MACOS_X64_SWIFTFLAGS) $$< -o $$@ - -.libs/macos/%$(1).x86_64.o: %.swift | .libs/mac - $$(call Q_2,SWIFT, [mac]) $(SWIFTC) $(MACOS_X64_SWIFTFLAGS) $$< -o $$@ -emit-object - -.libs/macos/%$(1).x86_64.dylib: %.swift | .libs/mac - $$(call Q_2,SWIFT, [macos]) $(SWIFTC) $(MACOS_X64_SWIFTFLAGS) $$< -o $$@ - -.libs/mac/%$(1).x86_64.dylib: | .libs/mac - $$(call Q_2,LD, [mac]) $(MAC_CC) $(MAC_CFLAGS) $$(EXTRA_FLAGS) -arch x86_64 -dynamiclib -o $$@ $$^ -L$(MAC_DESTDIR)$(XAMARIN_MACOS_SDK)/lib -fapplication-extension - -.libs/mac/%$(1).x86_64.framework: | .libs/mac - $$(call Q_2,LD, [mac]) $(MAC_CC) $(MAC_CFLAGS) $$(EXTRA_FLAGS) -arch x86_64 -dynamiclib -o $$@ $$^ -F$(MAC_DESTDIR)$(XAMARIN_MACOS_SDK)/Frameworks -fapplication-extension - -.libs/mac/%$(1).arm64.o: %.m $(EXTRA_DEPENDENCIES) | .libs/mac - $$(call Q_2,OBJC, [mac]) $(MAC_CC) $(MAC_OBJC_CFLAGS) $$(EXTRA_DEFINES) -arch arm64 $(COMMON_I) -g $(2) -c $$< -o $$@ - -.libs/mac/%$(1).arm64.o: %.c $(EXTRA_DEPENDENCIES) | .libs/mac - $$(call Q_2,CC, [mac]) $(MAC_CC) $(MAC_CFLAGS) $$(EXTRA_DEFINES) -arch arm64 $(COMMON_I) -g $(2) -c $$< -o $$@ - -.libs/mac/%$(1).arm64.o: %.s $(EXTRA_DEPENDENCIES) | .libs/mac - $$(call Q_2,ASM, [mac]) $(MAC_CC) $(MAC_CFLAGS) -arch arm64 $(COMMON_I) -g $(2) -c $$< -o $$@ - -.libs/mac/%$(1).arm64.dylib: %.swift | .libs/mac - $$(call Q_2,SWIFT, [mac]) $(SWIFTC) $(MACOS_ARM64_SWIFTFLAGS) $$< -o $$@ - -.libs/mac/%$(1).arm64.o: %.swift | .libs/mac - $$(call Q_2,SWIFT, [mac]) $(SWIFTC) $(MACOS_ARM64_SWIFTFLAGS) $$< -o $$@ -emit-object - -.libs/macos/%$(1).arm64.dylib: %.swift | .libs/mac - $$(call Q_2,SWIFT, [macos]) $(SWIFTC) $(MACOS_ARM64_SWIFTFLAGS) $$< -o $$@ - -.libs/macos/%$(1).arm64.o: %.swift | .libs/mac - $$(call Q_2,SWIFT, [macos]) $(SWIFTC) $(MACOS_ARM64_SWIFTFLAGS) $$< -o $$@ -emit-object - -.libs/mac/%$(1).arm64.dylib: | .libs/mac - $$(call Q_2,LD, [mac]) $(MAC_CC) $(MAC_CFLAGS) $$(EXTRA_FLAGS) -arch arm64 -dynamiclib -o $$@ $$^ -L$(MAC_DESTDIR)$(XAMARIN_MACOS_SDK)/lib -fapplication-extension - -.libs/mac/%$(1).arm64.framework: | .libs/mac - $$(call Q_2,LD, [mac]) $(MAC_CC) $(MAC_CFLAGS) $$(EXTRA_FLAGS) -arch arm64 -dynamiclib -o $$@ $$^ -F$(MAC_DESTDIR)$(XAMARIN_MACOS_SDK)/Frameworks -fapplication-extension - +ifdef ENABLE_CCACHE +# Note the space at the end the line +CCACHE=ccache +endif + +iossimulator_SDK=$(XCODE_DEVELOPER_ROOT)/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator$(IOS_SDK_VERSION).sdk +ios_SDK=$(XCODE_DEVELOPER_ROOT)/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS$(IOS_SDK_VERSION).sdk +tvossimulator_SDK=$(XCODE_DEVELOPER_ROOT)/Platforms/AppleTVSimulator.platform/Developer/SDKs/AppleTVSimulator$(TVOS_SDK_VERSION).sdk +tvos_SDK=$(XCODE_DEVELOPER_ROOT)/Platforms/AppleTVOS.platform/Developer/SDKs/AppleTVOS$(TVOS_SDK_VERSION).sdk +maccatalyst_SDK=$(XCODE_DEVELOPER_ROOT)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$(MACOS_SDK_VERSION).sdk +macos_SDK=$(XCODE_DEVELOPER_ROOT)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$(MACOS_SDK_VERSION).sdk + +ios_DEFINES=-DMONOTOUCH +tvos_DEFINES=-DMONOTOUCH +maccatalyst_DEFINES=-DMONOTOUCH +macos_DEFINES=-DMONOMAC + + +# Clang will by default emit objc_msgSend stubs in Xcode 14, which ld from earlier Xcodes doesn't understand. +# We disable this by passing -fno-objc-msgsend-selector-stubs to clang. +# We can probably remove this flag once we require developers to use Xcode 14. +# Ref: https://github.com/xamarin/xamarin-macios/issues/16223 +OBJC_CFLAGS=-ObjC++ -std=c++14 -fno-exceptions -fno-objc-msgsend-selector-stubs -fobjc-abi-version=2 -fobjc-legacy-dispatch +CFLAGS= -Wall -fms-extensions -Werror -Wconversion -Wdeprecated -Wuninitialized -fstack-protector-strong -Wformat -Wformat-security -Werror=format-security -g -I. +SWIFTFLAGS=-g -emit-library + +SWIFT_TOOLCHAIN_iossimulator=iphonesimulator +SWIFT_TOOLCHAIN_ios=iphoneos +SWIFT_TOOLCHAIN_maccatalyst=macosx +SWIFT_TOOLCHAIN_tvossimulator=appletvsimulator +SWIFT_TOOLCHAIN_tvos=appletvos +SWIFT_TOOLCHAIN_macos=macosx + +# iOS + +# macOS + +# tvOS + +# Mac Catalyst + +## Mac Catalyst is special :/ + +maccatalyst_CFLAGS += \ + -isystem $(macos_SDK)/System/iOSSupport/usr/include \ + -iframework $(macos_SDK)/System/iOSSupport/System/Library/Frameworks \ + +maccatalyst_SWIFTFLAGS += -Fsystem $(macos_SDK)/System/iOSSupport/System/Library/Frameworks + +# Common + +# 1: xcframework platform +# 2: platform +# 3: PLATFORM (platform uppercased) +define FlagsTemplate1 +$(1)_CFLAGS += \ + -isysroot $($(1)_SDK) \ + $(CFLAGS) \ + $($(2)_DEFINES) \ + -L$($(1)_SDK)/usr/lib/swift \ + -L$(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/$(SWIFT_TOOLCHAIN_$(1)) \ + -Wno-unused-command-line-argument + +$(1)_SWIFTFLAGS += $(SWIFTFLAGS) -sdk $($(1)_SDK) +endef +$(foreach xcframeworkPlatform,$(XCFRAMEWORK_PLATFORMS),$(eval $(call FlagsTemplate1,$(xcframeworkPlatform),$(DOTNET_$(xcframeworkPlatform)_PLATFORM),$(shell echo $(DOTNET_$(xcframeworkPlatform)_PLATFORM) | tr 'a-z' 'A-Z')))) + +# 1: xcframework platform +# 2: platform +# 3: PLATFORM (platform uppercased) +# 4: runtime identifier +define FlagsTemplate2 +$(4)_CFLAGS += $$($(1)_CFLAGS) -arch $(DOTNET_$(4)_ARCHITECTURES) $(CLANG_$(4)_VERSION_MIN) +$(4)_OBJC_FLAGS += $$($(4)_CFLAGS) $(OBJC_CFLAGS) +$(4)_SWIFTFLAGS += $$($(1)_SWIFTFLAGS) $(SWIFTC_$(4)_VERSION_MIN) endef +$(foreach xcframeworkPlatform,$(XCFRAMEWORK_PLATFORMS),$(foreach rid,$(XCFRAMEWORK_$(xcframeworkPlatform)_RUNTIME_IDENTIFIERS),$(eval $(call FlagsTemplate2,$(xcframeworkPlatform),$(DOTNET_$(xcframeworkPlatform)_PLATFORM),$(shell echo $(DOTNET_$(xcframeworkPlatform)_PLATFORM) | tr 'a-z' 'A-Z'),$(rid))))) DEBUG_FLAGS=-DDEBUG -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG RELEASE_FLAGS=-O2 -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_FAST -$(eval $(call NativeCompilationTemplate,,-O2)) -$(eval $(call NativeCompilationTemplate,-debug,$(DEBUG_FLAGS))) -$(eval $(call NativeCompilationTemplate,-dotnet,$(RELEASE_FLAGS) -DDOTNET)) -$(eval $(call NativeCompilationTemplate,-dotnet-debug,$(DEBUG_FLAGS) -DDOTNET)) -$(eval $(call NativeCompilationTemplate,-dotnet-coreclr,$(RELEASE_FLAGS) -DCORECLR_RUNTIME -DDOTNET)) -$(eval $(call NativeCompilationTemplate,-dotnet-coreclr-debug,$(DEBUG_FLAGS) -DCORECLR_RUNTIME -DDOTNET)) -$(eval $(call NativeCompilationTemplate,-dotnet-nativeaot,$(RELEASE_FLAGS) -DCORECLR_RUNTIME -DDOTNET -DNATIVEAOT)) -$(eval $(call NativeCompilationTemplate,-dotnet-nativeaot-debug,$(DEBUG_FLAGS) -DCORECLR_RUNTIME -DDOTNET -DNATIVEAOT)) - -.libs/iphoneos .libs/iphonesimulator .libs/tvos .libs/tvsimulator .libs/maccatalyst .libs/mac: - $(Q) mkdir -p $@ +# 1: xcframework platform +# 2: platform +# 3: PLATFORM (platform uppercased) +# 1: runtime identifier +# 2: suffix +# 3: additional compiler flags +define NativeCompilationTemplate +# Compile Objective-C source (.m) into object file (.o) +.libs/$(1)/%$(2).o: %.m $(EXTRA_DEPENDENCIES) | .libs/$(1) + $$(call Q_2,OBJC, [$(1)]) $(CLANG) $$($(1)_OBJC_FLAGS) $$(EXTRA_DEFINES) $(3) -c $$< -o $$@ + +# Compile C source (.c) into object file (.o) +.libs/$(1)/%$(2).o: %.c $(EXTRA_DEPENDENCIES) | .libs/$(1) + $$(call Q_2,CC, [$(1)]) $(CLANG) $$($(1)_CFLAGS) $$(EXTRA_DEFINES) $(3) -c $$< -o $$@ + +# Compile Assembly source (.s) into object file (.o) +.libs/$(1)/%$(2).o: %.s $(EXTRA_DEPENDENCIES) | .libs/$(1) + $$(call Q_2,ASM, [$(1)]) $(CLANG) $$($(1)_CFLAGS) $(3) -c $$< -o $$@ + +# Compile Swift source (.swift) into dynamic library (.dylib) +.libs/$(1)/%$(2).dylib: %.swift | .libs/$(1) + $$(call Q_2,SWIFT, [$(1)]) $(SWIFTC) $$($(1)_SWIFTFLAGS) $(EXTRA_SWIFTFLAGS) $$(EXTRA_$$*_FLAGS) $$< -o $$@ -emit-module -L$$(dir $$@) -I$$(dir $$@) -module-name $$* + +# Compile Swift source (.swift) into object file (.o) +.libs/$(1)/%$(2).o: %.swift | .libs/$(1) + $$(call Q_2,SWIFT, [$(1)]) $(SWIFTC) $$($(1)_SWIFTFLAGS) $(EXTRA_SWIFTFLAGS) $$(EXTRA_$$*_FLAGS) $$< -o $$@ -emit-object + +# Compile anything into dynamic library (.dylib) using clang. +# Set the dependencies for this target to add source code to be compiled or other libraries or object files to be linked into the resulting dylib. +.libs/$(1)/%$(2).dylib: | .libs/$(1) + $$(call Q_2,LD, [$(1)]) $(CLANG) $$($(1)_CFLAGS) $$(EXTRA_FLAGS) -dynamiclib -o $$@ $$^ -fapplication-extension -framework Foundation +endef +$(foreach rid,$(DOTNET_RUNTIME_IDENTIFIERS),$(eval $(call NativeCompilationTemplate,$(rid),,-O2))) +$(foreach rid,$(DOTNET_RUNTIME_IDENTIFIERS),$(eval $(call NativeCompilationTemplate,$(rid),-debug,$(DEBUG_FLAGS)))) +$(foreach rid,$(DOTNET_RUNTIME_IDENTIFIERS),$(eval $(call NativeCompilationTemplate,$(rid),-dotnet,$(RELEASE_FLAGS) -DDOTNET))) +$(foreach rid,$(DOTNET_RUNTIME_IDENTIFIERS),$(eval $(call NativeCompilationTemplate,$(rid),-dotnet-debug,$(DEBUG_FLAGS) -DDOTNET))) +$(foreach rid,$(DOTNET_RUNTIME_IDENTIFIERS),$(eval $(call NativeCompilationTemplate,$(rid),-dotnet-coreclr,$(RELEASE_FLAGS) -DCORECLR_RUNTIME -DDOTNET))) +$(foreach rid,$(DOTNET_RUNTIME_IDENTIFIERS),$(eval $(call NativeCompilationTemplate,$(rid),-dotnet-coreclr-debug,$(DEBUG_FLAGS) -DCORECLR_RUNTIME -DDOTNET))) +$(foreach rid,$(DOTNET_RUNTIME_IDENTIFIERS),$(eval $(call NativeCompilationTemplate,$(rid),-dotnet-nativeaot,$(RELEASE_FLAGS) -DCORECLR_RUNTIME -DDOTNET -DNATIVEAOT))) +$(foreach rid,$(DOTNET_RUNTIME_IDENTIFIERS),$(eval $(call NativeCompilationTemplate,$(rid),-dotnet-nativeaot-debug,$(DEBUG_FLAGS) -DCORECLR_RUNTIME -DDOTNET -DNATIVEAOT))) %.csproj.inc: %.csproj $(TOP)/Make.config $(TOP)/mk/mono.mk $(TOP)/tools/common/create-makefile-fragment.sh $(Q) $(TOP)/tools/common/create-makefile-fragment.sh $(abspath $<) $(abspath $@) + +DIRS = \ + $(foreach xcframeworkPlatform,$(XCFRAMEWORK_PLATFORMS),.libs/$(xcframeworkPlatform)) \ + $(foreach platform,$(DOTNET_PLATFORMS),$(foreach xcplatform,$(DOTNET_$(platform)_SDK_PLATFORMS),.libs/$(xcplatform))) \ + $(foreach rid,$(DOTNET_RUNTIME_IDENTIFIERS),.libs/$(rid)) \ + +$(sort $(DIRS)): + $(Q) mkdir -p $@ diff --git a/msbuild/Makefile b/msbuild/Makefile index c9c13719326..65176adf1bd 100644 --- a/msbuild/Makefile +++ b/msbuild/Makefile @@ -146,7 +146,7 @@ $(foreach dll,$(MSBUILD_TASK_ASSEMBLIES),$(dll)/bin/$(CONFIG)/$(TARGETFRAMEWORK) $(foreach dll,$(TRANSLATED_ASSEMBLIES),Xamarin.Localization.MSBuild/bin/$(CONFIG)/$(TARGETFRAMEWORK)/$(dll).resources.dll): .build-stamp # this is a directory-creating target. -# we sort to remove duplicates, which can happen if MAC_DESTDIR and IOS_DESTDIR are the same (both create a '/Library/Frameworks/Mono.framework/External/xbuild/Xamarin' target) +# we sort to remove duplicates $(sort $(MSBUILD_DIRECTORIES)): $(Q) mkdir -p $@ diff --git a/runtime/COOP.md b/runtime/COOP.md index 9c272c0b8ce..55e4630f0c2 100644 --- a/runtime/COOP.md +++ b/runtime/COOP.md @@ -37,7 +37,6 @@ Review * bindings-generated.m [DONE] * bindings.m [DONE] * extension-main.m [DONE] -* launcher.m [MAC ONLY; NOT DONE] * mono-runtime.m [PASS-THROUGH ONLY] * monotouch-debug.m [DONE] * monotouch-main.m [COMPLETE-ISH] diff --git a/runtime/Makefile b/runtime/Makefile index 02adcd54732..352f7cacddc 100644 --- a/runtime/Makefile +++ b/runtime/Makefile @@ -23,11 +23,11 @@ SHIPPED_HEADERS += \ xamarin/coreclr-bridge.h \ SHARED_SOURCES += mono-runtime.m bindings.m bindings-generated.m shared.m runtime.m trampolines.m trampolines-invoke.m xamarin-support.m nsstring-localization.m trampolines-varargs.m monovm-bridge.m coreclr-bridge.m nativeaot-bridge.m swift-functions.swift -SHARED_X86_64_SOURCES += trampolines-x86_64.m trampolines-x86_64-asm.s trampolines-x86_64-objc_msgSend.s trampolines-x86_64-objc_msgSendSuper.s trampolines-x86_64-objc_msgSend_stret.s trampolines-x86_64-objc_msgSendSuper_stret.s +SHARED_X64_SOURCES += trampolines-x86_64.m trampolines-x86_64-asm.s trampolines-x86_64-objc_msgSend.s trampolines-x86_64-objc_msgSendSuper.s trampolines-x86_64-objc_msgSend_stret.s trampolines-x86_64-objc_msgSendSuper_stret.s SHARED_ARM64_SOURCES += trampolines-arm64.m trampolines-arm64-asm.s trampolines-arm64-objc_msgSend.s trampolines-arm64-objc_msgSendSuper.s SHARED_HEADERS += shared.h product.h delegates.h runtime-internal.h $(SHARED_INC) $(SHIPPED_HEADERS) trampolines-internal.h slinked-list.h -SHARED_FILES = $(SHARED_SOURCES) $(SHARED_HEADERS) $(SHARED_X86_64_SOURCES) $(SHARED_ARM64_SOURCES) +SHARED_FILES = $(SHARED_SOURCES) $(SHARED_HEADERS) $(SHARED_X64_SOURCES) $(SHARED_ARM64_SOURCES) EXTRA_DEPENDENCIES = $(SHARED_HEADERS) $(TOP)/Make.config $(TOP)/mk/mono.mk @@ -82,7 +82,7 @@ MONOTOUCH_HEADERS = \ monotouch-debug.h \ MONOTOUCH_SOURCE_STEMS = $(patsubst %.swift,%,$(patsubst %.s,%,$(patsubst %.m,%,$(SHARED_SOURCES) $(MONOTOUCH_SOURCES)))) -MONOTOUCH_X86_64_SOURCE_STEMS = $(patsubst %.s,%,$(patsubst %.m,%,$(SHARED_X86_64_SOURCES))) +MONOTOUCH_X64_SOURCE_STEMS = $(patsubst %.s,%,$(patsubst %.m,%,$(SHARED_X64_SOURCES))) MONOTOUCH_ARM64_SOURCE_STEMS = $(patsubst %.s,%,$(patsubst %.m,%,$(SHARED_ARM64_SOURCES))) # @@ -153,48 +153,32 @@ DOTNET_mac_DYLIB_FLAGS=-lcoreclr # define DotNetInstallLibTemplate -$(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native/libxamarin-%.dylib: $$(foreach arch,$(3),.libs/$(4)/libxamarin-%.$$(arch).dylib) | $(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native -ifeq (1,$$(words $(3))) - $(Q) $(CP) $$^ $$@ -else - $$(call Q_2,LIPO, [$1]) $(DEVICE_BIN_PATH)/lipo $$^ -create -output $$@ -endif - $(Q) install_name_tool -id @rpath/libxamarin-$$*.dylib $$@ - -$(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native/libxamarin-%.a: $$(foreach arch,$(3),.libs/$(4)/libxamarin-%.$$(arch).a) | $(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native -ifeq (1,$$(words $(3))) - $(Q) $(CP) $$^ $$@ -else - $$(call Q_2,LIPO, [$1]) $(DEVICE_BIN_PATH)/lipo $$^ -create -output $$@ -endif - -$(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native/libapp-%.a: $$(foreach arch,$(3),.libs/$(4)/libapp-%.$$(arch).a) | $(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native -ifeq (1,$$(words $(3))) - $(Q) $(CP) $$^ $$@ -else - $$(call Q_2,LIPO, [$1]) $(DEVICE_BIN_PATH)/lipo $$^ -create -output $$@ -endif - -$(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native/libextension-%.a: $$(foreach arch,$(3),.libs/$(4)/libextension-%.$$(arch).a) | $(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native -ifeq (1,$$(words $(3))) - $(Q) $(CP) $$^ $$@ -else - $$(call Q_2,LIPO, [$1]) $(DEVICE_BIN_PATH)/lipo $$^ -create -output $$@ -endif - -$(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native/libtvextension-%.a: $$(foreach arch,$(3),.libs/$(4)/libtvextension-%.$$(arch).a) | $(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native -ifeq (1,$$(words $(3))) - $(Q) $(CP) $$^ $$@ -else - $$(call Q_2,LIPO, [$1]) $(DEVICE_BIN_PATH)/lipo $$^ -create -output $$@ -endif +$(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native/libxamarin-%.dylib: .libs/$(2)/libxamarin-%.dylib | $(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native + $$(Q) $(CP) $$^ $$@ + $$(Q) install_name_tool -id @rpath/libxamarin-$$*.dylib $$@ + +$(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native/libxamarin-%.a: .libs/$(2)/libxamarin-%.a | $(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native + $$(Q) $(CP) $$^ $$@ + $$(call Q_2,LIPO, [$1]) $(LIPO) $$^ -create -output $$@ + +$(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native/libapp-%.a: .libs/$(2)/libapp-%.a | $(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native + $$(Q) $(CP) $$^ $$@ + $$(call Q_2,LIPO, [$1]) $(LIPO) $$^ -create -output $$@ + +$(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native/libextension-%.a: .libs/$(2)/libextension-%.a | $(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native + $$(Q) $(CP) $$^ $$@ + $$(call Q_2,LIPO, [$1]) $(LIPO) $$^ -create -output $$@ + +$(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native/libtvextension-%.a: .libs/$(2)/libtvextension-%.a | $(DOTNET_DESTDIR)/$($(2)_NUGET_RUNTIME_NAME)/runtimes/$(2)/native + $$(Q) $(CP) $$^ $$@ + $$(call Q_2,LIPO, [$1]) $(LIPO) $$^ -create -output $$@ endef # foreach (var platform in DOTNET_PLATFORMS) # foreach (var rid in DOTNET__RUNTIME_IDENTIFIERS) -# call DotNetInstallLibTemplate (platform, rid, architectures_for_rid, sdk_platform_for_rid) -$(foreach platform,$(DOTNET_PLATFORMS),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(eval $(call DotNetInstallLibTemplate,$(platform),$(rid),$(DOTNET_$(rid)_ARCHITECTURES),$(DOTNET_$(rid)_SDK_PLATFORM))))) +# call DotNetInstallLibTemplate (platform, rid) +$(foreach platform,$(DOTNET_PLATFORMS),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(eval $(call DotNetInstallLibTemplate,$(platform),$(rid))))) # # LibXamarinTemplate builds libxamarin.a @@ -205,61 +189,60 @@ define DotNetLibXamarinTemplate DOTNET$(6)_$(2)_LIBDIR ?= $$(TOP)/packages/microsoft.netcore.app.runtime$(7).$(2)/$(BUNDLED_NETCORE_PLATFORMS_PACKAGE_VERSION)/runtimes/$(2)/native DOTNET$(6)_$(2)_DYLIB_FLAGS = $(DOTNET_$(1)_DYLIB_FLAGS) -Wl,-install_name,libxamarin$(5).dylib -framework Foundation -framework CFNetwork -lz -L$(abspath $(DOTNET$(6)_$(2)_LIBDIR)) -DOTNET_$(2)_$(3)$(4)_OBJECTS = $$(patsubst %,.libs/$(1)/%$(5).$(3).o, $(MONOTOUCH_SOURCE_STEMS)) $$(patsubst %,.libs/$(1)/%$(5).$(3).o, $(MONOTOUCH_$(shell echo $(3) | tr a-z A-Z)_SOURCE_STEMS)) +DOTNET_$(2)_$(4)_OBJECTS = $$(patsubst %,.libs/$(2)/%$(5).o, $(MONOTOUCH_SOURCE_STEMS)) $$(patsubst %,.libs/$(2)/%$(5).o, $(MONOTOUCH_$(shell echo $(2) | sed 's/.*-//' | tr a-z A-Z)_SOURCE_STEMS)) + -.libs/$(1)/libxamarin$(5).$(3).a: $$(DOTNET_$(2)_$(3)$(4)_OBJECTS) +.libs/$(2)/libxamarin$(5).a: $$(DOTNET_$(2)_$(4)_OBJECTS) $$(Q) rm -f $$@ - $$(call Q_2,AR, [$1]) $(DEVICE_BIN_PATH)/ar Scru $$@ $$^ - $$(call Q_2,RANLIB,[$1]) $(DEVICE_BIN_PATH)/ranlib -no_warning_for_no_symbols -q $$@ + $$(call Q_2,AR, [$1]) $(AR) Scru $$@ $$^ + $$(call Q_2,RANLIB,[$1]) $(RANLIB) -no_warning_for_no_symbols -q $$@ -.libs/$(1)/libxamarin$(5).$(3).dylib: EXTRA_FLAGS=$$(DOTNET$(6)_$(2)_DYLIB_FLAGS) -.libs/$(1)/libxamarin$(5).$(3).dylib: $$(DOTNET_$(2)_$(3)$(4)_OBJECTS) +.libs/$(2)/libxamarin$(5).dylib: EXTRA_FLAGS=$$(DOTNET$(6)_$(2)_DYLIB_FLAGS) +.libs/$(2)/libxamarin$(5).dylib: $$(DOTNET_$(2)_$(4)_OBJECTS) endef # foreach (var platform in DOTNET_PLATFORMS) # foreach (var rid in DOTNET__RUNTIME_IDENTIFIERS)) -# foreach (var arch in DOTNET__ARCHITECTURES) # 1 2 3 4 5 6 7 -# call DotNetLibXamarinTemplate (platform, rid, arch, , "-dotnet", ,.mono) -# call DotNetLibXamarinTemplate (platform, rid, arch, _DEBUG, "-dotnet-debug", ,.mono) -# call DotNetLibXamarinTemplate (platform, rid, arch, _CORECLR, "-dotnet-coreclr", _CORECLR,) -# call DotNetLibXamarinTemplate (platform, rid, arch, _CORECLR_DEBUG, "-dotnet-coreclr-debug", _CORECLR,) - -$(foreach platform,$(DOTNET_PLATFORMS),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(foreach arch,$(DOTNET_$(rid)_ARCHITECTURES),$(eval $(call DotNetLibXamarinTemplate,$(DOTNET_$(rid)_SDK_PLATFORM),$(rid),$(arch),,-dotnet,,.mono))))) -$(foreach platform,$(DOTNET_PLATFORMS),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(foreach arch,$(DOTNET_$(rid)_ARCHITECTURES),$(eval $(call DotNetLibXamarinTemplate,$(DOTNET_$(rid)_SDK_PLATFORM),$(rid),$(arch),_DEBUG,-dotnet-debug,,.mono))))) -$(foreach platform,$(DOTNET_PLATFORMS),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(foreach arch,$(DOTNET_$(rid)_ARCHITECTURES),$(eval $(call DotNetLibXamarinTemplate,$(DOTNET_$(rid)_SDK_PLATFORM),$(rid),$(arch),_CORECLR,-dotnet-coreclr,_CORECLR))))) -$(foreach platform,$(DOTNET_PLATFORMS),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(foreach arch,$(DOTNET_$(rid)_ARCHITECTURES),$(eval $(call DotNetLibXamarinTemplate,$(DOTNET_$(rid)_SDK_PLATFORM),$(rid),$(arch),_CORECLR_DEBUG,-dotnet-coreclr-debug,_CORECLR))))) -$(foreach platform,$(DOTNET_PLATFORMS),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(foreach arch,$(DOTNET_$(rid)_ARCHITECTURES),$(eval $(call DotNetLibXamarinTemplate,$(DOTNET_$(rid)_SDK_PLATFORM),$(rid),$(arch),_NATIVEAOT,-dotnet-nativeaot,_NATIVEAOT,.mono))))) -$(foreach platform,$(DOTNET_PLATFORMS),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(foreach arch,$(DOTNET_$(rid)_ARCHITECTURES),$(eval $(call DotNetLibXamarinTemplate,$(DOTNET_$(rid)_SDK_PLATFORM),$(rid),$(arch),_NATIVEAOT_DEBUG,-dotnet-nativeaot-debug,_NATIVEAOT,.mono))))) +# call DotNetLibXamarinTemplate (platform, rid, , , "-dotnet", ,.mono) +# call DotNetLibXamarinTemplate (platform, rid, , _DEBUG, "-dotnet-debug", ,.mono) +# call DotNetLibXamarinTemplate (platform, rid, , _CORECLR, "-dotnet-coreclr", _CORECLR,) +# call DotNetLibXamarinTemplate (platform, rid, , _CORECLR_DEBUG, "-dotnet-coreclr-debug", _CORECLR,) + +$(foreach platform,$(DOTNET_PLATFORMS),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(eval $(call DotNetLibXamarinTemplate,$(DOTNET_$(rid)_SDK_PLATFORM),$(rid),,,-dotnet,,.mono)))) +$(foreach platform,$(DOTNET_PLATFORMS),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(eval $(call DotNetLibXamarinTemplate,$(DOTNET_$(rid)_SDK_PLATFORM),$(rid),,_DEBUG,-dotnet-debug,,.mono)))) +$(foreach platform,$(DOTNET_PLATFORMS),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(eval $(call DotNetLibXamarinTemplate,$(DOTNET_$(rid)_SDK_PLATFORM),$(rid),,_CORECLR,-dotnet-coreclr,_CORECLR)))) +$(foreach platform,$(DOTNET_PLATFORMS),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(eval $(call DotNetLibXamarinTemplate,$(DOTNET_$(rid)_SDK_PLATFORM),$(rid),,_CORECLR_DEBUG,-dotnet-coreclr-debug,_CORECLR)))) +$(foreach platform,$(DOTNET_PLATFORMS),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(eval $(call DotNetLibXamarinTemplate,$(DOTNET_$(rid)_SDK_PLATFORM),$(rid),,_NATIVEAOT,-dotnet-nativeaot,_NATIVEAOT,.mono)))) +$(foreach platform,$(DOTNET_PLATFORMS),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(eval $(call DotNetLibXamarinTemplate,$(DOTNET_$(rid)_SDK_PLATFORM),$(rid),,_NATIVEAOT_DEBUG,-dotnet-nativeaot-debug,_NATIVEAOT,.mono)))) # # DotNetLibExtensionTemplate builds lib[tv]extension.a # define DotNetLibExtensionTemplate -.libs/$(1)/extension-main$(5).$(3).o: EXTRA_DEFINES=-DEXTENSION -.libs/$(1)/tvextension-main$(5).$(3).o: EXTRA_DEFINES=-DTV_EXTENSION +.libs/$(2)/extension-main$(5).o: EXTRA_DEFINES=-DEXTENSION +.libs/$(2)/tvextension-main$(5).o: EXTRA_DEFINES=-DTV_EXTENSION -.libs/$(1)/libextension$(5).$(3).a: .libs/$(1)/extension-main$(5).$(3).o +.libs/$(2)/libextension$(5).a: .libs/$(2)/extension-main$(5).o $(Q) rm -f $$@ - $$(call Q_2,LIPO, [$1]) $(DEVICE_BIN_PATH)/lipo $$^ -create -output $$@ + $$(call Q_2,LIPO, [$1]) $(LIPO) $$^ -create -output $$@ -.libs/$(1)/libtvextension$(5).$(3).a: .libs/$(1)/tvextension-main$(5).$(3).o +.libs/$(2)/libtvextension$(5).a: .libs/$(2)/tvextension-main$(5).o $(Q) rm -f $$@ - $$(call Q_2,LIPO, [$1]) $(DEVICE_BIN_PATH)/lipo $$^ -create -output $$@ + $$(call Q_2,LIPO, [$1]) $(LIPO) $$^ -create -output $$@ endef # foreach (var platform in DOTNET_PLATFORMS) # foreach (var rid in DOTNET__RUNTIME_IDENTIFIERS)) -# foreach (var arch in DOTNET__ARCHITECTURES) # 1 2 3 4 5 6 -# call DotNetLibExtensionTemplate (platform, rid, arch, , "-dotnet", ) -# call DotNetLibExtensionTemplate (platform, rid, arch, _CORECLR, "-dotnet-coreclr", _CORECLR) +# call DotNetLibExtensionTemplate (platform, rid, , , "-dotnet", ) +# call DotNetLibExtensionTemplate (platform, rid, , _CORECLR, "-dotnet-coreclr", _CORECLR) -$(foreach platform,$(DOTNET_PLATFORMS),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(foreach arch,$(DOTNET_$(rid)_ARCHITECTURES),$(eval $(call DotNetLibExtensionTemplate,$(DOTNET_$(rid)_SDK_PLATFORM),$(rid),$(arch),,-dotnet,,))))) -$(foreach platform,$(DOTNET_PLATFORMS),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(foreach arch,$(DOTNET_$(rid)_ARCHITECTURES),$(eval $(call DotNetLibExtensionTemplate,$(DOTNET_$(rid)_SDK_PLATFORM),$(rid),$(arch),_CORECLR,-dotnet-coreclr,_CORECLR))))) -$(foreach platform,$(DOTNET_PLATFORMS),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(foreach arch,$(DOTNET_$(rid)_ARCHITECTURES),$(eval $(call DotNetLibExtensionTemplate,$(DOTNET_$(rid)_SDK_PLATFORM),$(rid),$(arch),_NATOVEAOT,-dotnet-nativeaot,_NATOVEAOT))))) +$(foreach platform,$(DOTNET_PLATFORMS),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(eval $(call DotNetLibExtensionTemplate,$(DOTNET_$(rid)_SDK_PLATFORM),$(rid),,,-dotnet,,)))) +$(foreach platform,$(DOTNET_PLATFORMS),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(eval $(call DotNetLibExtensionTemplate,$(DOTNET_$(rid)_SDK_PLATFORM),$(rid),,_CORECLR,-dotnet-coreclr,_CORECLR)))) +$(foreach platform,$(DOTNET_PLATFORMS),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(eval $(call DotNetLibExtensionTemplate,$(DOTNET_$(rid)_SDK_PLATFORM),$(rid),,_NATOVEAOT,-dotnet-nativeaot,_NATOVEAOT)))) dotnet: $(DOTNET_TARGETS) diff --git a/runtime/launcher.m b/runtime/launcher.m deleted file mode 100644 index b753a6a1055..00000000000 --- a/runtime/launcher.m +++ /dev/null @@ -1,683 +0,0 @@ -// vim: set filetype=objc : - -#include // dlsym - -#import - -#include "shared.h" -#include "product.h" -#include "xamarin/xamarin.h" -#include "xamarin/launch.h" -#include "launcher.h" -#include "runtime-internal.h" -#include "main-internal.h" - -#ifdef DYNAMIC_MONO_RUNTIME - #define DEFAULT_MONO_RUNTIME "/Library/Frameworks/Mono.framework/Versions/Current" - static const char *mono_runtime_prefix = NULL; - bool xamarin_enable_debug = 0; -#endif - -static char original_working_directory_path [MAXPATHLEN]; - -extern "C" const char * const -xamarin_get_original_working_directory_path () -{ - return original_working_directory_path; -} - -static int -redirect_io (int from_fd, const char *to_path) -{ - int err; - int fd; - - if ((fd = open (to_path, O_CREAT | O_TRUNC | O_WRONLY, 0644)) == -1) - return -1; - - if (dup2 (fd, from_fd) == -1) { - err = errno; - close (fd); - errno = err; - return -1; - } - - return fd; -} - -static void -init_logdir (void) -{ - // If redirected we will not be closing the returned file descriptors anywhere. - // That's "by design" so they will keep logging as long as the app is alive. - static int redirected_stdout = -1; - static int redirected_stderr = -1; - const char *env; - - if ((env = getenv ("MONOMAC_LOGDIR")) != NULL && *env) { - NSString *logdir = [NSString stringWithUTF8String: env]; - // Redirect stdout/err to log files... - NSError *error = nil; - if (![[NSFileManager defaultManager] - createDirectoryAtPath: logdir - withIntermediateDirectories: YES - attributes: @{ NSFilePosixPermissions: [NSNumber numberWithInt: 0755] } - error: &error]) { - fprintf (stderr, PRODUCT ": Could not create log directory: %s\n", [[error description] UTF8String]); - return; - } - - NSString *out = [logdir stringByAppendingPathComponent: @"stdout.log"]; - redirected_stdout = redirect_io (STDOUT_FILENO, [out UTF8String]); - if (redirected_stdout == -1) - fprintf (stderr, PRODUCT ": Could not redirect %s to `%s': %s\n", "stdout", [out UTF8String], strerror (errno)); - - NSString *err = [logdir stringByAppendingPathComponent: @"stderr.log"]; - redirected_stderr = redirect_io (STDERR_FILENO, [err UTF8String]); - if (redirected_stderr == -1) - fprintf (stderr, PRODUCT ": Could not redirect %s to `%s': %s\n", "stderr", [err UTF8String], strerror (errno)); - } -} - -static char * -decode_qstring (unsigned char **in, unsigned char qchar) -{ - unsigned char *inptr = *in; - unsigned char *start = *in; - char *value, *v; - size_t len = 0; - - while (*inptr) { - if (*inptr == qchar) - break; - - if (*inptr == '\\') { - if (inptr[1] == '\0') - break; - - inptr++; - } - - inptr++; - len++; - } - - v = value = (char *) calloc (1, len + 1); - while (start < inptr) { - if (*start == '\\') - start++; - - *v++ = (char) *start++; - } - - *v = '\0'; - - if (*inptr) - inptr++; - - *in = inptr; - - return value; -} - -typedef struct _ListNode { - struct _ListNode *next; - char *value; -} ListNode; - -static char ** -get_mono_env_options (int *count) -{ - const char *env = getenv ("MONO_ENV_OPTIONS"); - ListNode *list = NULL, *node, *tail = NULL; - unsigned char *start, *inptr; - char *value, **argv; - int i, n = 0; - - if (env == NULL) { - *count = 0; - return NULL; - } - - inptr = (unsigned char *) env; - - while (*inptr) { - while (isblank ((int) *inptr & 0xff)) - inptr++; - - if (*inptr == '\0') - break; - - start = inptr++; - switch (*start) { - case '\'': - case '"': - value = decode_qstring (&inptr, *start); - break; - default: - while (*inptr && !isblank ((int) *inptr & 0xff)) - inptr++; - - value = strndup ((char *) start, (size_t) (inptr - start)); - break; - } - - node = (ListNode *) calloc (1, sizeof (ListNode)); - node->value = value; - node->next = NULL; - n++; - - if (tail != NULL) - tail->next = node; - else - list = node; - - tail = node; - } - - // Note: we do not want child processes to inherit this environment variable, - // so now that we've parsed it (and each value is strdup'd), we can safely - // unset it. - unsetenv ("MONO_ENV_OPTIONS"); - - *count = n; - - if (n == 0) - return NULL; - - argv = (char **) calloc (sizeof (char *), (unsigned long) n + 1); - i = 0; - - while (list != NULL) { - node = list->next; - argv[i++] = list->value; - free (list); - list = node; - } - - argv[i] = NULL; - - return argv; -} - -static void -exit_with_message (const char *reason, const char *argv0, bool request_mono) -{ - NSString *appName = nil; - NSDictionary *plist = [[NSBundle mainBundle] infoDictionary]; - if (plist) { - appName = (NSString *) [plist objectForKey:(NSString *)kCFBundleNameKey]; - } - if (!appName) { - appName = [[NSString stringWithUTF8String: argv0] lastPathComponent]; - } - - NSAlert *alert = [[NSAlert alloc] init]; - [alert setMessageText:[NSString stringWithFormat:@"Could not launch %@", appName]]; - NSString *fmt = request_mono ? @"%s\n\nPlease download and install the latest version of Mono." : @"%s\n"; - NSString *msg = [NSString stringWithFormat:fmt, reason]; - [alert setInformativeText:msg]; - NSLog (@"%@", msg); - - if (request_mono) { - [alert addButtonWithTitle:@"Download Mono Framework"]; - [alert addButtonWithTitle:@"Cancel"]; - } else { - [alert addButtonWithTitle:@"OK"]; - } - NSInteger answer = [alert runModal]; - objc_release (alert); - - if (request_mono && answer == NSAlertFirstButtonReturn) { - NSString *mono_download_url = @"https://www.mono-project.com/download/stable/"; - CFURLRef url = CFURLCreateWithString (NULL, (CFStringRef) mono_download_url, NULL); - LSOpenCFURLRef (url, NULL); - CFRelease (url); - } - exit (1); -} - -#ifdef DYNAMIC_MONO_RUNTIME -static int -check_mono_version (const char *version, const char *req_version) -{ - char *req_end, *end; - long req_val, val; - - while (*req_version) { - req_val = strtol (req_version, &req_end, 10); - if (req_version == req_end || (*req_end && *req_end != '.')) { - fprintf (stderr, "Bad version requirement string '%s'\n", req_end); - return FALSE; - } - - req_version = req_end; - if (*req_version) - req_version++; - - val = strtol (version, &end, 10); - if (version == end || val < req_val) - return FALSE; - - if (val > req_val) - return TRUE; - - if (*req_version == '.' && *end != '.') - return FALSE; - - version = end + 1; - } - - return TRUE; -} - -static int -push_env (const char *variable, NSString *str_value) -{ - const char *current; - - if ((current = getenv (variable)) && *current) - str_value = [str_value stringByAppendingFormat: @":%s", current]; - - return setenv (variable, [str_value UTF8String], 1); -} -#endif - -static void -update_environment (xamarin_initialize_data *data) -{ - if (xamarin_get_is_mkbundle ()) - return; - - // 3) Ensure the following environment variables are set: [...] - NSString *res_dir; - NSString *monobundle_dir; - - if (data->launch_mode == XamarinLaunchModeEmbedded) { - monobundle_dir = [data->app_dir stringByAppendingPathComponent: @"Versions/Current"]; - res_dir = [data->app_dir stringByAppendingPathComponent: @"Versions/Current/Resources"]; - } else { - monobundle_dir = [data->app_dir stringByAppendingPathComponent: @"Contents"]; - res_dir = [data->app_dir stringByAppendingPathComponent: @"Contents/Resources"]; - } - monobundle_dir = [monobundle_dir stringByAppendingPathComponent: xamarin_custom_bundle_name]; - -#ifdef DYNAMIC_MONO_RUNTIME - NSString *bin_dir = [data->app_dir stringByAppendingPathComponent: @"Contents/MacOS"]; - - push_env ("DYLD_FALLBACK_LIBRARY_PATH", [NSString stringWithFormat: @"%s/lib:/usr/local/lib:/lib:/usr/lib", getenv ("HOME")]); - push_env ("DYLD_FALLBACK_LIBRARY_PATH", [res_dir stringByAppendingPathComponent: @"/lib"]); - push_env ("DYLD_FALLBACK_LIBRARY_PATH", [[NSString stringWithUTF8String: mono_runtime_prefix] stringByAppendingPathComponent: @"/lib"]); - - /* Mono "External" directory */ - push_env ("PKG_CONFIG_PATH", @"/Library/Frameworks/Mono.framework/External/pkgconfig"); - /* Enable the use of stuff bundled into the app bundle */ - push_env ("PKG_CONFIG_PATH", [res_dir stringByAppendingPathComponent: @"/lib/pkgconfig"]); - push_env ("PKG_CONFIG_PATH", [res_dir stringByAppendingPathComponent: @"/share/pkgconfig"]); - - push_env ("MONO_GAC_PREFIX", res_dir); - push_env ("PATH", bin_dir); - - push_env ("MONO_PATH", monobundle_dir); - - data->requires_relaunch = true; -#else - // disable /dev/shm since Apple refuse applications that uses it in the Mac App Store - setenv ("MONO_DISABLE_SHARED_AREA", "", 1); - unsetenv ("MONO_PATH"); - mono_set_assemblies_path (xamarin_get_bundle_path ()); - - // 3b) (If embedding Mono) Change the current directory to $appdir/Contents/Resources - chdir ([res_dir UTF8String]); - - // Set up environment variables that need to point to ~/Library/Application Support (registry path) - NSFileManager *mgr = [NSFileManager defaultManager]; - NSArray *appSupportDirectories = [mgr URLsForDirectory:NSApplicationSupportDirectory inDomains:NSSystemDomainMask]; - - if ([appSupportDirectories count] > 0) { - NSString *appBundleID = [[NSBundle mainBundle] bundleIdentifier]; - NSURL *appSupport = [appSupportDirectories objectAtIndex: 0]; - if (appSupport != nil && appBundleID != nil) { - NSURL *appDirectory = [appSupport URLByAppendingPathComponent:appBundleID isDirectory: YES]; - setenv ("MONO_REGISTRY_PATH", [[appDirectory path] UTF8String], 1); - } - } -#endif - const char *mono_debug = NULL; - // Unfortunately the only place to set debug_options.no_gdb_backtrace is in mini_parse_debug_option - // So route through MONO_DEBUG - if (xamarin_disable_lldb_attach && xamarin_disable_omit_fp) { - mono_debug = "no-gdb-backtrace,disable-omit-fp"; - } else if (xamarin_disable_lldb_attach) { - mono_debug = "no-gdb-backtrace"; - } else if (xamarin_disable_omit_fp) { - mono_debug = "disable_omit_fp"; - } - if (mono_debug != NULL) - setenv ("MONO_DEBUG", mono_debug, 0); - -#ifndef DYNAMIC_MONO_RUNTIME - setenv ("MONO_CFG_DIR", [monobundle_dir UTF8String], 0); -#endif -} - -static void -app_initialize (xamarin_initialize_data *data) -{ - // The launch code here is publicly documented in xamarin/launch.h - // The numbers in the comments refer to numbers in xamarin/launch.h. - - xamarin_launch_mode = data->launch_mode; - -#ifndef SYSTEM_LAUNCHER - if (xammac_setup ()) { - data->exit_code = -1; - return; - } -#endif - - bool mkbundle = xamarin_get_is_mkbundle (); - - NSBundle *bundle; - - if (data->launch_mode == XamarinLaunchModeEmbedded) { - bundle = [NSBundle bundleForClass: [XamarinAssociatedObject class]]; - } else { - bundle = [NSBundle mainBundle]; - } - data->app_dir = [bundle bundlePath]; // this is good until the autorelease pool releases the bundlePath string. - - // 1) If found, call the custom initialization function (xamarin_custom_initialize) - xamarin_custom_initialize_func init = (xamarin_custom_initialize_func) dlsym (RTLD_MAIN_ONLY, "xamarin_app_initialize"); - if (init != NULL) - init (data); - -#ifdef DYNAMIC_MONO_RUNTIME - // 2) (If not embedding Mono) Search for the system Mono in the following directories: - if (!(mono_runtime_prefix = getenv ("MONO_RUNTIME"))) - mono_runtime_prefix = DEFAULT_MONO_RUNTIME; -#endif - - // 3) Ensure the following environment variables are set: [...] - if (!data->is_relaunch) { - update_environment (data); - - if (data->requires_relaunch) - return; - } - - data->app_dir = NULL; // Make sure nobody ends up using this. - - // 4) Ensure that the maximum number of open files is least 1024. - struct rlimit limit; - if (getrlimit (RLIMIT_NOFILE, &limit) == 0 && limit.rlim_cur < 1024) { - limit.rlim_cur = MIN (limit.rlim_max, 1024); - setrlimit (RLIMIT_NOFILE, &limit); - } - - NSDictionary *plist = [[NSBundle mainBundle] infoDictionary]; -#ifdef DYNAMIC_MONO_RUNTIME - // 5) Verify the minimum Mono version. The minimum mono version is specified in: [...] - NSString *minVersion = NULL; - if (plist != NULL) { - minVersion = (NSString *) [plist objectForKey:@"MonoMinimumVersion"]; - if (minVersion == NULL) - minVersion = (NSString *) [plist objectForKey:@"MonoMinVersion"]; - } else { - fprintf (stderr, PRODUCT ": Could not load Info.plist from the bundle."); - } - - if (!minVersion) { - // This must be kept in sync with mmp's minimum mono version (in driver.cs) - minVersion = @MIN_XM_MONO_VERSION; - } - - char *mono_version; - const char *err = xamarin_initialize_dynamic_runtime (mono_runtime_prefix); - if (err) { - mono_version = xamarin_get_mono_runtime_build_info (); - if (mono_version && !check_mono_version (mono_version, [minVersion UTF8String])) { - exit_with_message ([[NSString stringWithFormat:@"This application requires the Mono framework version %@ or newer.", minVersion] UTF8String], data->basename, true); - } else { - exit_with_message (err, data->basename, true); - } - } - - mono_version = mono_get_runtime_build_info (); - if (!check_mono_version (mono_version, [minVersion UTF8String])) - exit_with_message ([[NSString stringWithFormat:@"This application requires the Mono framework version %@ or newer.", minVersion] UTF8String], data->basename, true); -#endif - - // 6) Find the executable. The name is: [...] - if (data->launch_mode == XamarinLaunchModeApp) { - NSString *exeName = NULL; - NSString *exePath; - - if (xamarin_executable_name != NULL) { - exeName = [NSString stringWithUTF8String: xamarin_executable_name]; - } - - if (exeName == NULL) { - if (plist != NULL) - exeName = (NSString *) [plist objectForKey:@"MonoBundleExecutable"]; - else - fprintf (stderr, PRODUCT ": Could not find Info.plist in the bundle.\n"); - } - - if (exeName == NULL) - exeName = [[NSString stringWithUTF8String: data->basename] stringByAppendingString: @".exe"]; - - if (mkbundle) { - exePath = exeName; - } else { - exePath = [[[NSString stringWithUTF8String: xamarin_get_bundle_path ()] stringByAppendingString: @"/"] stringByAppendingString: exeName]; - - if (!xamarin_file_exists ([exePath UTF8String])) - exit_with_message ([[NSString stringWithFormat:@"Could not find the executable '%@'\n\nFull path: %@", exeName, exePath] UTF8String], data->basename, false); - } - xamarin_entry_assembly_path = strdup ([exePath UTF8String]); - } else { - NSString *dllName = [[NSString stringWithUTF8String: data->basename] stringByAppendingString: @".dll"]; - NSString *dllPath = [[[NSString stringWithUTF8String: xamarin_get_bundle_path ()] stringByAppendingString: @"/"] stringByAppendingString: dllName]; - if (!xamarin_file_exists ([dllPath UTF8String])) - exit_with_message ([[NSString stringWithFormat:@"Could not find the extension library '%@'\n\nFull path: %@", dllName, dllPath] UTF8String], data->basename, false); - - xamarin_entry_assembly_path = strdup ([dllPath UTF8String]); - } - - // 7a) [If not embedding] Don't parse any config files, leave it to the Mono runtime to load the defaults. - // 7b) [If embedding] Parse $appdir/Contents/MonoBundle/machine.config and $appdir/Contents/MonoBundle/config - if (!mkbundle) { - NSString *config_path = nil; - NSString *machine_config_path = nil; - NSError *error = nil; - -#ifndef DYNAMIC_MONO_RUNTIME - config_path = [[NSString stringWithUTF8String: xamarin_get_bundle_path ()] stringByAppendingPathComponent: @"config"]; - machine_config_path = [[NSString stringWithUTF8String: xamarin_get_bundle_path ()] stringByAppendingPathComponent: @"machine.config"]; - mono_set_dirs (xamarin_get_bundle_path (), xamarin_get_bundle_path ()); -#else - mono_set_dirs (NULL, NULL); -#endif - - if (machine_config_path != nil) { - NSString *config = [NSString stringWithContentsOfFile: machine_config_path encoding: NSUTF8StringEncoding error: &error]; - if (config != nil) { - mono_register_machine_config (strdup ([config UTF8String])); - } else { - // fprintf (stderr, PRODUCT ": Could not load machine.config: %s\n", [machine_config_path UTF8String]); - } - } - - if (config_path != nil) { - NSString *config = [NSString stringWithContentsOfFile: config_path encoding: NSUTF8StringEncoding error: &error]; - if (config != nil) { - mono_config_parse_memory ((char *) [config UTF8String]); - } else { - // fprintf (stderr, PRODUCT ": Could not load config: %s\n", [config_path UTF8String]); - } - } - } - - /* other non-documented stuff... */ - - xamarin_initialize_cocoa_threads (NULL); - init_logdir (); - mono_set_signal_chaining (TRUE); - mono_set_crash_chaining (TRUE); -} - -#define __XAMARIN_MAC_RELAUNCH_APP__ "__XAMARIN_MAC_RELAUNCH_APP__" - -static void -run_application_init (xamarin_initialize_data *data) -{ - if (!xamarin_file_exists (xamarin_entry_assembly_path)) - exit_with_message ([[NSString stringWithFormat:@"Could not find the assembly '%s'", xamarin_entry_assembly_path] UTF8String], data->basename, false); - - // Make sure any output from mono isn't lost when launching extensions, - // etc, by installing the log callbacks early (xamarin_initialize will - // also do this, but if something goes wrong before we reach - // xamarin_initialize when running as an extension, the output will be - // lost). - xamarin_install_log_callbacks (); - - mono_jit_init (xamarin_entry_assembly_path); - - MonoAssembly *assembly = xamarin_open_assembly ("Xamarin.Mac.dll"); - if (!assembly) - xamarin_assertion_message ("Failed to load %s.", "Xamarin.Mac.dll"); - - MonoImage *image = mono_assembly_get_image (assembly); - - xamarin_mono_object_release (&assembly); - - MonoClass *app_class = mono_class_from_name (image, "AppKit", "NSApplication"); - if (!app_class) - xamarin_assertion_message ("Fatal error: failed to load the NSApplication class"); - - MonoMethod *initialize = mono_class_get_method_from_name (app_class, "Init", 0); - if (!initialize) - xamarin_assertion_message ("Fatal error: failed to load the %s.%s method", "NSApplication", "Init"); - - mono_runtime_invoke (initialize, NULL, NULL, NULL); -} - -int xamarin_main (int argc, char **argv, enum XamarinLaunchMode launch_mode) -{ - xamarin_initialize_data data = { 0 }; - - if (getcwd (original_working_directory_path, sizeof (original_working_directory_path)) == NULL) - original_working_directory_path [0] = '\0'; - - @autoreleasepool { - data.size = sizeof (data); - data.argc = argc; - data.argv = argv; - data.launch_mode = launch_mode; - // basename = Path.GetFileName (argv [0]) - if (!(data.basename = strrchr (argv [0], '/'))) { - data.basename = argv [0]; - } else { - data.basename++; - } - - data.is_relaunch = getenv (__XAMARIN_MAC_RELAUNCH_APP__) != NULL; - if (data.is_relaunch) - unsetenv (__XAMARIN_MAC_RELAUNCH_APP__); - - app_initialize (&data); - - if (data.exit) - return data.exit_code; - - if (data.requires_relaunch) { - setenv (__XAMARIN_MAC_RELAUNCH_APP__, "1", 1); - return execv (argv [0], argv); - } - } - - int rv = 0; - - @autoreleasepool { - int env_argc = 0; - char **env_argv = get_mono_env_options (&env_argc); - int new_argc = env_argc + 2 /* --debug executable */ + argc ; - if (xamarin_mac_hybrid_aot) - new_argc += 1; - if (xamarin_mac_modern) - new_argc += 1; - - char **new_argv = (char **) calloc (sizeof (char *), (unsigned long) new_argc + 1 /* null terminated */); - const char **ptr = (const char **) new_argv; - // binary - *ptr++ = argv [0]; - // inject MONO_ENV_OPTIONS - for (int i = 0; i < env_argc; i++) - *ptr++ = env_argv [i]; - - if (xamarin_debug_mode) { - *ptr++ = "--debug"; - } else { - new_argc--; - } - - if (xamarin_mac_hybrid_aot) - *ptr++ = "--hybrid-aot"; - if (xamarin_mac_modern) - *ptr++ = "--runtime=mobile"; - - // executable assembly - *ptr++ = xamarin_entry_assembly_path; - - // the rest - for (int i = 1; i < argc; i++) - *ptr++ = argv [i]; - *ptr = NULL; - - switch (launch_mode) { - case XamarinLaunchModeExtension: { - run_application_init (&data); - - void * libExtensionHandle = dlopen ("/usr/lib/libextension.dylib", RTLD_LAZY); - if (libExtensionHandle == nil) - exit_with_message ("Unable to load libextension.dylib", data.basename, false); - - typedef int (*extension_main)(int argc, char * argv[]); - - extension_main extensionMain = (extension_main) dlsym (libExtensionHandle, "NSExtensionMain"); - - if (extensionMain == nil) - exit_with_message ("Unable to load NSExtensionMain", data.basename, false); - - rv = (*extensionMain) (new_argc, new_argv); - dlclose (libExtensionHandle); - break; - } - case XamarinLaunchModeApp: - rv = mono_main (new_argc, new_argv); - break; - case XamarinLaunchModeEmbedded: - run_application_init (&data); - break; - default: - xamarin_assertion_message ("Invalid launch mode: %i.", launch_mode); - break; - } - - free (new_argv); - free (env_argv); - } - - return rv; -} - -int main (int argc, char **argv) -{ - return xamarin_main (argc, argv, XamarinLaunchModeApp); -} - -int xamarin_mac_extension_main (int argc, char **argv) -{ - return xamarin_main (argc, argv, XamarinLaunchModeExtension); -} diff --git a/runtime/libmonotouch.csproj b/runtime/libmonotouch.csproj deleted file mode 100644 index 2c970f4f5a5..00000000000 --- a/runtime/libmonotouch.csproj +++ /dev/null @@ -1,104 +0,0 @@ - - - - Debug - AnyCPU - 8.0.30703 - 2.0 - {8A5B637C-E4FF-4145-B887-9347020100F4} - {6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Library - monotouch - monotouch - True - - - true - full - false - bin\Debug - IPHONE;MINIMAL - prompt - 4 - false - true - True - 3021,3014,3003 - SdkOnly - HttpClientHandler - - - none - false - bin\Release - prompt - 4 - false - true - SdkOnly - HttpClientHandler - - - - $(MSBuildProjectDirectory)\..\src\custom-make.sh - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/runtime/libxammac.csproj b/runtime/libxammac.csproj deleted file mode 100644 index 5ac15c1b8b6..00000000000 --- a/runtime/libxammac.csproj +++ /dev/null @@ -1,84 +0,0 @@ - - - - Debug - AnyCPU - {8A5B637C-E4FF-4145-B887-9347020100F4} - {6BC8ED88-2882-458C-8E55-DFD12B67127B};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - Library - monotouch - monotouch - True - 8.0 - - - true - full - false - bin\Debug - IPHONE;MINIMAL - prompt - 4 - false - true - True - 3021,3014,3003 - - - none - false - bin\Release - prompt - 4 - false - true - - - $(MSBuildProjectDirectory)\..\src\custom-make.sh - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/bgen/bgen b/src/bgen/bgen deleted file mode 100755 index 67c162d7536..00000000000 --- a/src/bgen/bgen +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -e - -pushd "$(dirname "$0")/.." > /dev/null -MONOTOUCH_PREFIX=$(pwd -P) -popd > /dev/null - -exec /Library/Frameworks/Mono.framework/Commands/mono64 --debug "$MONOTOUCH_PREFIX/lib/bgen/bgen.exe" "$@" diff --git a/tests/Makefile b/tests/Makefile index 3041ee6cfaf..9e238bd5a1c 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -6,8 +6,6 @@ SUBDIRS=test-libraries dotnet include $(TOP)/Make.config include $(TOP)/mk/rules.mk -MTOUCH=$(IOS_DESTDIR)/$(MONOTOUCH_PREFIX)/bin/mtouch - XHARNESS_EXECUTABLE=xharness/bin/Debug/xharness.dll ifneq ($(RELEASE),) @@ -45,9 +43,6 @@ package-tests: test.config: Makefile $(TOP)/Make.config $(TOP)/mk/mono.mk $(TOP)/eng/Version.Details.xml @rm -f $@ - @echo "MONOTOUCH_PREFIX=$(abspath $(MONOTOUCH_PREFIX))" >> $@ - @echo "IOS_DESTDIR=$(abspath $(IOS_DESTDIR))" >> $@ - @echo "MAC_DESTDIR=$(abspath $(MAC_DESTDIR))" >> $@ @echo "JENKINS_RESULTS_DIRECTORY=$(abspath $(JENKINS_RESULTS_DIRECTORY))" >> $@ @echo "INCLUDE_DEVICE=$(INCLUDE_DEVICE)" >> $@ @echo "XCODE_DEVELOPER_ROOT=$(XCODE_DEVELOPER_ROOT)" >> $@ @@ -77,9 +72,6 @@ test.config: Makefile $(TOP)/Make.config $(TOP)/mk/mono.mk $(TOP)/eng/Version.De test-system.config: Makefile $(TOP)/Make.config $(TOP)/mk/mono.mk $(TOP)/eng/Version.Details.xml @rm -f $@ - @echo "MONOTOUCH_PREFIX=$(IOS_FRAMEWORK_DIR)/Versions/Current" >> $@ - @echo "IOS_DESTDIR=/" >> $@ - @echo "MAC_DESTDIR=/" >> $@ @echo "JENKINS_RESULTS_DIRECTORY=$(abspath $(JENKINS_RESULTS_DIRECTORY))" >> $@ @echo "INCLUDE_DEVICE=$(INCLUDE_DEVICE)" >> $@ @echo "DOTNET=$(DOTNET)" >> $@ @@ -166,9 +158,6 @@ check-result: exit 1; \ fi -logdev: - $(MTOUCH) --logdev - build-test-libraries: @$(MAKE) -C $(TOP)/tests/test-libraries diff --git a/tests/common/Configuration.cs b/tests/common/Configuration.cs index 3ec4991dafa..ced1564c820 100644 --- a/tests/common/Configuration.cs +++ b/tests/common/Configuration.cs @@ -16,9 +16,6 @@ static partial class Configuration { public const string XI_ProductName = "MonoTouch"; public const string XM_ProductName = "Xamarin.Mac"; - static string mt_root; - static string ios_destdir; - static string mac_destdir; public static string DotNetBclDir; public static string DotNetCscCommand; public static string DotNetExecutable; @@ -85,14 +82,6 @@ public static string XcodeLocation { } } - public static string IOS_DESTDIR { - get { return ios_destdir; } - } - - public static string MAC_DESTDIR { - get { return mac_destdir; } - } - // This is the location of an Xcode which is older than the recommended one. public static string GetOldXcodeRoot (Version min_version = null) { @@ -130,14 +119,6 @@ public static string GetOldXcodeRoot (Version min_version = null) return with_versions [0].Item2; // return the most recent Xcode older than the recommended one. } - // This is /Library/Frameworks/Xamarin.iOS.framework/Versions/Current if running - // against a system XI, otherwise it's the /_ios-build/Library/Frameworks/Xamarin.iOS.framework/Versions/Current directory. - public static string MonoTouchRootDirectory { - get { - return mt_root; - } - } - static IEnumerable FindConfigFiles (string name) { var dir = TestAssemblyDirectory; @@ -280,9 +261,6 @@ static Configuration () { ParseConfigFiles (); - mt_root = GetVariable ("MONOTOUCH_PREFIX", "/Library/Frameworks/Xamarin.iOS.framework/Versions/Current"); - ios_destdir = GetVariable ("IOS_DESTDIR", null); - mac_destdir = GetVariable ("MAC_DESTDIR", null); sdk_version = GetVariable ("IOS_SDK_VERSION", "8.0"); watchos_sdk_version = GetVariable ("WATCH_SDK_VERSION", "2.0"); tvos_sdk_version = GetVariable ("TVOS_SDK_VERSION", "9.0"); @@ -308,13 +286,7 @@ static Configuration () mac_xcode_root = xcode_root; #endif - if (!string.IsNullOrEmpty (ios_destdir)) - mt_root = Path.Combine (ios_destdir, mt_root.Substring (1)); - Console.WriteLine ("Test configuration:"); - Console.WriteLine (" MONOTOUCH_PREFIX={0}", mt_root); - Console.WriteLine (" IOS_DESTDIR={0}", ios_destdir); - Console.WriteLine (" MAC_DESTDIR={0}", mac_destdir); Console.WriteLine (" SDK_VERSION={0}", sdk_version); Console.WriteLine (" XCODE_ROOT={0}", xcode_root); #if MONOMAC diff --git a/tests/common/shared-dotnet.csproj b/tests/common/shared-dotnet.csproj index 3758e3927ca..9dc7064d5c4 100644 --- a/tests/common/shared-dotnet.csproj +++ b/tests/common/shared-dotnet.csproj @@ -6,7 +6,7 @@ xamarinios10;$(AssetTargetFallback) - ios-fat + iossimulator $(MSBuildThisFileDirectory)\..\..\src\rsp\dotnet\ios-defines-dotnet.rsp @@ -18,7 +18,7 @@ xamarintvos10;$(AssetTargetFallback) - tvos-fat + tvossimulator $(MSBuildThisFileDirectory)\..\..\src\rsp\dotnet\tvos-defines-dotnet.rsp <_IsSimulatorBuild Condition="'$(RuntimeIdentifier)$(RuntimeIdentifiers)' == '' Or $(RuntimeIdentifier.Contains('simulator')) Or $(RuntimeIdentifiers.Contains('tvossimulator'))">true @@ -29,7 +29,7 @@ $(DefineConstants);MONOMAC - macos-fat + macos $(MSBuildThisFileDirectory)\..\..\src\rsp\dotnet\macos-defines-dotnet.rsp osx-x64;osx-arm64 osx-x64 @@ -38,7 +38,7 @@ xamarinios10;$(AssetTargetFallback) - maccatalyst-fat + maccatalyst $(MSBuildThisFileDirectory)\..\..\src\rsp\dotnet\maccatalyst-defines-dotnet.rsp maccatalyst-x64;maccatalyst-arm64 maccatalyst-x64 diff --git a/tests/dotnet/AppWithNativeDynamicLibrariesInPackageReference/AppDelegate.cs b/tests/dotnet/AppWithNativeDynamicLibrariesInPackageReference/AppDelegate.cs index 197d419d901..d03ef97daf2 100644 --- a/tests/dotnet/AppWithNativeDynamicLibrariesInPackageReference/AppDelegate.cs +++ b/tests/dotnet/AppWithNativeDynamicLibrariesInPackageReference/AppDelegate.cs @@ -5,7 +5,7 @@ namespace NativeDynamicLibraryReferencesApp { public class Program { - [DllImport ("libtest.dylib")] + [DllImport ("libframework.dylib")] static extern int theUltimateAnswer (); static int Main (string [] args) diff --git a/tests/dotnet/AppWithNativeDynamicLibrariesInPackageReference/MacCatalyst/AppWithNativeDynamicLibrariesInPackageReference.csproj b/tests/dotnet/AppWithNativeDynamicLibrariesInPackageReference/MacCatalyst/AppWithNativeDynamicLibrariesInPackageReference.csproj index f2961d0b3a4..74c01d72426 100644 --- a/tests/dotnet/AppWithNativeDynamicLibrariesInPackageReference/MacCatalyst/AppWithNativeDynamicLibrariesInPackageReference.csproj +++ b/tests/dotnet/AppWithNativeDynamicLibrariesInPackageReference/MacCatalyst/AppWithNativeDynamicLibrariesInPackageReference.csproj @@ -3,7 +3,6 @@ net$(BundledNETCoreAppTargetFrameworkVersion)-ios iossimulator-x64 - ios-fat diff --git a/tests/dotnet/AppWithNativeDynamicLibrariesInPackageReference/macOS/AppWithNativeDynamicLibrariesInPackageReference.csproj b/tests/dotnet/AppWithNativeDynamicLibrariesInPackageReference/macOS/AppWithNativeDynamicLibrariesInPackageReference.csproj index e77dd64694a..638b6f06573 100644 --- a/tests/dotnet/AppWithNativeDynamicLibrariesInPackageReference/macOS/AppWithNativeDynamicLibrariesInPackageReference.csproj +++ b/tests/dotnet/AppWithNativeDynamicLibrariesInPackageReference/macOS/AppWithNativeDynamicLibrariesInPackageReference.csproj @@ -3,7 +3,6 @@ net$(BundledNETCoreAppTargetFrameworkVersion)-macos osx-x64 - macos-fat diff --git a/tests/dotnet/AppWithWinExeOutputType/macOS/AppWithWinExeOutputType.csproj b/tests/dotnet/AppWithWinExeOutputType/macOS/AppWithWinExeOutputType.csproj index e77dd64694a..638b6f06573 100644 --- a/tests/dotnet/AppWithWinExeOutputType/macOS/AppWithWinExeOutputType.csproj +++ b/tests/dotnet/AppWithWinExeOutputType/macOS/AppWithWinExeOutputType.csproj @@ -3,7 +3,6 @@ net$(BundledNETCoreAppTargetFrameworkVersion)-macos osx-x64 - macos-fat diff --git a/tests/dotnet/NativeDynamicLibraryReferencesApp/AppDelegate.cs b/tests/dotnet/NativeDynamicLibraryReferencesApp/AppDelegate.cs index 197d419d901..d03ef97daf2 100644 --- a/tests/dotnet/NativeDynamicLibraryReferencesApp/AppDelegate.cs +++ b/tests/dotnet/NativeDynamicLibraryReferencesApp/AppDelegate.cs @@ -5,7 +5,7 @@ namespace NativeDynamicLibraryReferencesApp { public class Program { - [DllImport ("libtest.dylib")] + [DllImport ("libframework.dylib")] static extern int theUltimateAnswer (); static int Main (string [] args) diff --git a/tests/dotnet/NativeDynamicLibraryReferencesApp/iOS/NativeDynamicLibraryReferencesApp.csproj b/tests/dotnet/NativeDynamicLibraryReferencesApp/iOS/NativeDynamicLibraryReferencesApp.csproj index f2961d0b3a4..74c01d72426 100644 --- a/tests/dotnet/NativeDynamicLibraryReferencesApp/iOS/NativeDynamicLibraryReferencesApp.csproj +++ b/tests/dotnet/NativeDynamicLibraryReferencesApp/iOS/NativeDynamicLibraryReferencesApp.csproj @@ -3,7 +3,6 @@ net$(BundledNETCoreAppTargetFrameworkVersion)-ios iossimulator-x64 - ios-fat diff --git a/tests/dotnet/NativeDynamicLibraryReferencesApp/macOS/NativeDynamicLibraryReferencesApp.csproj b/tests/dotnet/NativeDynamicLibraryReferencesApp/macOS/NativeDynamicLibraryReferencesApp.csproj index e77dd64694a..638b6f06573 100644 --- a/tests/dotnet/NativeDynamicLibraryReferencesApp/macOS/NativeDynamicLibraryReferencesApp.csproj +++ b/tests/dotnet/NativeDynamicLibraryReferencesApp/macOS/NativeDynamicLibraryReferencesApp.csproj @@ -3,7 +3,6 @@ net$(BundledNETCoreAppTargetFrameworkVersion)-macos osx-x64 - macos-fat diff --git a/tests/dotnet/NativeDynamicLibraryReferencesApp/shared.csproj b/tests/dotnet/NativeDynamicLibraryReferencesApp/shared.csproj index e3bcc8d95cf..8460e655588 100644 --- a/tests/dotnet/NativeDynamicLibraryReferencesApp/shared.csproj +++ b/tests/dotnet/NativeDynamicLibraryReferencesApp/shared.csproj @@ -11,7 +11,7 @@ - + diff --git a/tests/dotnet/NativeFileReferencesApp/iOS/NativeFileReferencesApp.csproj b/tests/dotnet/NativeFileReferencesApp/iOS/NativeFileReferencesApp.csproj index f2961d0b3a4..74c01d72426 100644 --- a/tests/dotnet/NativeFileReferencesApp/iOS/NativeFileReferencesApp.csproj +++ b/tests/dotnet/NativeFileReferencesApp/iOS/NativeFileReferencesApp.csproj @@ -3,7 +3,6 @@ net$(BundledNETCoreAppTargetFrameworkVersion)-ios iossimulator-x64 - ios-fat diff --git a/tests/dotnet/NativeFileReferencesApp/macOS/NativeFileReferencesApp.csproj b/tests/dotnet/NativeFileReferencesApp/macOS/NativeFileReferencesApp.csproj index e77dd64694a..638b6f06573 100644 --- a/tests/dotnet/NativeFileReferencesApp/macOS/NativeFileReferencesApp.csproj +++ b/tests/dotnet/NativeFileReferencesApp/macOS/NativeFileReferencesApp.csproj @@ -3,7 +3,6 @@ net$(BundledNETCoreAppTargetFrameworkVersion)-macos osx-x64 - macos-fat diff --git a/tests/dotnet/NativeFileReferencesApp/shared.csproj b/tests/dotnet/NativeFileReferencesApp/shared.csproj index d24642b8593..cd59c173473 100644 --- a/tests/dotnet/NativeFileReferencesApp/shared.csproj +++ b/tests/dotnet/NativeFileReferencesApp/shared.csproj @@ -11,8 +11,8 @@ - - + + diff --git a/tests/dotnet/NativeFrameworkReferencesApp/iOS/NativeFrameworkReferencesApp.csproj b/tests/dotnet/NativeFrameworkReferencesApp/iOS/NativeFrameworkReferencesApp.csproj index f2961d0b3a4..74c01d72426 100644 --- a/tests/dotnet/NativeFrameworkReferencesApp/iOS/NativeFrameworkReferencesApp.csproj +++ b/tests/dotnet/NativeFrameworkReferencesApp/iOS/NativeFrameworkReferencesApp.csproj @@ -3,7 +3,6 @@ net$(BundledNETCoreAppTargetFrameworkVersion)-ios iossimulator-x64 - ios-fat diff --git a/tests/dotnet/NativeFrameworkReferencesApp/macOS/NativeFrameworkReferencesApp.csproj b/tests/dotnet/NativeFrameworkReferencesApp/macOS/NativeFrameworkReferencesApp.csproj index e77dd64694a..638b6f06573 100644 --- a/tests/dotnet/NativeFrameworkReferencesApp/macOS/NativeFrameworkReferencesApp.csproj +++ b/tests/dotnet/NativeFrameworkReferencesApp/macOS/NativeFrameworkReferencesApp.csproj @@ -3,7 +3,6 @@ net$(BundledNETCoreAppTargetFrameworkVersion)-macos osx-x64 - macos-fat diff --git a/tests/dotnet/NativeFrameworkReferencesApp/shared.csproj b/tests/dotnet/NativeFrameworkReferencesApp/shared.csproj index 4ffd8bcf19e..e868c1e6927 100644 --- a/tests/dotnet/NativeFrameworkReferencesApp/shared.csproj +++ b/tests/dotnet/NativeFrameworkReferencesApp/shared.csproj @@ -11,9 +11,9 @@ - - - + + + diff --git a/tests/dotnet/NativeXCFrameworkReferencesApp/iOS/NativeXCFrameworkReferencesApp.csproj b/tests/dotnet/NativeXCFrameworkReferencesApp/iOS/NativeXCFrameworkReferencesApp.csproj index f2961d0b3a4..74c01d72426 100644 --- a/tests/dotnet/NativeXCFrameworkReferencesApp/iOS/NativeXCFrameworkReferencesApp.csproj +++ b/tests/dotnet/NativeXCFrameworkReferencesApp/iOS/NativeXCFrameworkReferencesApp.csproj @@ -3,7 +3,6 @@ net$(BundledNETCoreAppTargetFrameworkVersion)-ios iossimulator-x64 - ios-fat diff --git a/tests/dotnet/NativeXCFrameworkReferencesApp/macOS/NativeXCFrameworkReferencesApp.csproj b/tests/dotnet/NativeXCFrameworkReferencesApp/macOS/NativeXCFrameworkReferencesApp.csproj index e77dd64694a..638b6f06573 100644 --- a/tests/dotnet/NativeXCFrameworkReferencesApp/macOS/NativeXCFrameworkReferencesApp.csproj +++ b/tests/dotnet/NativeXCFrameworkReferencesApp/macOS/NativeXCFrameworkReferencesApp.csproj @@ -3,7 +3,6 @@ net$(BundledNETCoreAppTargetFrameworkVersion)-macos osx-x64 - macos-fat diff --git a/tests/dotnet/UnitTests/ProjectTest.cs b/tests/dotnet/UnitTests/ProjectTest.cs index de29a83e538..021e957f8dc 100644 --- a/tests/dotnet/UnitTests/ProjectTest.cs +++ b/tests/dotnet/UnitTests/ProjectTest.cs @@ -1865,9 +1865,9 @@ public void BuildAndExecuteAppWithNativeDynamicLibrariesInPackageReference (Appl var appExecutable = Path.Combine (appPath, "Contents", "MacOS", Path.GetFileNameWithoutExtension (project_path)); Assert.That (appExecutable, Does.Exist, "There is an executable"); - AssertThatDylibExistsAndIsReidentified (appPath, "libtest.dylib"); - AssertThatDylibExistsAndIsReidentified (appPath, "/subdir/libtest.dylib"); - AssertThatDylibExistsAndIsReidentified (appPath, "/subdir/libtest.so"); + AssertThatDylibExistsAndIsReidentified (appPath, "libframework.dylib"); + AssertThatDylibExistsAndIsReidentified (appPath, "/subdir/libframework.dylib"); + AssertThatDylibExistsAndIsReidentified (appPath, "/subdir/libframework.so"); ExecuteWithMagicWordAndAssert (appExecutable); } diff --git a/tests/mmp-regression/Makefile b/tests/mmp-regression/Makefile index 18dfb9b18fa..6843c374c81 100644 --- a/tests/mmp-regression/Makefile +++ b/tests/mmp-regression/Makefile @@ -38,7 +38,7 @@ $(foreach test,$(ALL_TESTS),$(test)/bin): dylib/libTest.dylib $(QF_GEN) if ! $(SYSTEM_MSBUILD) -- $(@D)/$(@D).csproj /p:Configuration=$(CONFIG); then EC=$$?; rm -Rf $@; exit $$EC; fi dylib/libTest.dylib: dylib/src.c - $(QF_GEN) $(XCODE_CC) $< -o$@ -arch x86_64 -shared -L /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib + $(QF_GEN) $(CLANG) $< -o$@ -arch x86_64 -shared -L /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib build: $(foreach test,$(ALL_TESTS),$(test)/bin) diff --git a/tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/MergeAppBundleTaskTest.cs b/tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/MergeAppBundleTaskTest.cs index d99670d2472..89298ac3628 100644 --- a/tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/MergeAppBundleTaskTest.cs +++ b/tests/msbuild/Xamarin.MacDev.Tasks.Tests/TaskTests/MergeAppBundleTaskTest.cs @@ -93,9 +93,9 @@ string CreateAppBundle (string directory, params string [] files) public void TestLipoExecutable () { Configuration.IgnoreIfIgnoredPlatform (ApplePlatform.MacOSX); - var fileA = Path.Combine (Configuration.RootPath, "tests", "test-libraries", ".libs", "macos", "libtest.arm64.dylib"); - var fileB = Path.Combine (Configuration.RootPath, "tests", "test-libraries", ".libs", "macos", "libtest.x86_64.dylib"); - var bundles = CreateAppBundles (fileA, fileB, "libtest.dylib"); + var fileA = Path.Combine (Configuration.RootPath, "tests", "test-libraries", ".libs", "osx-arm64", "libframework.dylib"); + var fileB = Path.Combine (Configuration.RootPath, "tests", "test-libraries", ".libs", "osx-x64", "libframework.dylib"); + var bundles = CreateAppBundles (fileA, fileB, "libframework.dylib"); var outputBundle = Path.Combine (Cache.CreateTemporaryDirectory (), "Merged.app"); var task = CreateTask (outputBundle, bundles); @@ -105,7 +105,7 @@ public void TestLipoExecutable () Assert.AreEqual (1, Directory.GetFileSystemEntries (outputBundle).Length, "Files in bundle"); // The resulting dylib should contain 2 architectures. - var fatLibrary = Path.Combine (outputBundle, "libtest.dylib"); + var fatLibrary = Path.Combine (outputBundle, "libframework.dylib"); Assert.That (fatLibrary, Does.Exist, "Existence"); var machO = MachO.Read (fatLibrary).ToArray (); Assert.AreEqual (2, machO.Length, "Architecture Count"); @@ -258,7 +258,7 @@ public void TestDirectories () public void TestSingleInput () { Configuration.IgnoreIfIgnoredPlatform (ApplePlatform.MacOSX); - var fileA = Path.Combine (Configuration.RootPath, "tests", "test-libraries", ".libs", "macos", "libtest.arm64.dylib"); + var fileA = Path.Combine (Configuration.RootPath, "tests", "test-libraries", ".libs", "osx-arm64", "libframework.dylib"); var bundle = CreateAppBundle (Path.GetDirectoryName (fileA), Path.GetFileName (fileA)); var outputBundle = Path.Combine (Cache.CreateTemporaryDirectory (), "Merged.app"); var task = CreateTask (outputBundle, bundle); @@ -268,7 +268,7 @@ public void TestSingleInput () Assert.AreEqual (1, Directory.GetFileSystemEntries (outputBundle).Length, "Files in bundle"); // The resulting dylib should contain 1 architecture. - var nonFatBinary = Path.Combine (outputBundle, "libtest.arm64.dylib"); + var nonFatBinary = Path.Combine (outputBundle, "libframework.dylib"); Assert.That (nonFatBinary, Does.Exist, "Existence"); var machO = MachO.Read (nonFatBinary).ToArray (); Assert.AreEqual (1, machO.Length, "Architecture Count"); diff --git a/tests/msbuild/Xamarin.MacDev.Tests/MSBuild-Smoke.cs b/tests/msbuild/Xamarin.MacDev.Tests/MSBuild-Smoke.cs index 69e946a70c8..b4646b439ff 100644 --- a/tests/msbuild/Xamarin.MacDev.Tests/MSBuild-Smoke.cs +++ b/tests/msbuild/Xamarin.MacDev.Tests/MSBuild-Smoke.cs @@ -154,7 +154,7 @@ public void BuildUnifiedProject_WithJustNativeRefNoLinkWith_Builds () Configuration.AssertLegacyXamarinAvailable (); // Investigate whether this test should be ported to .NET RunMSBuildTest (tmpDir => { - var dylib = Path.GetFullPath (Path.Combine (TI.TestDirectory, "test-libraries", ".libs", "macos", "libtest.dylib")); + var dylib = Path.GetFullPath (Path.Combine (TI.TestDirectory, "test-libraries", ".libs", "macos", "libframework.dylib")); string itemGroup = $" FalseDynamic "; string projectPath = TI.GenerateEXEProject (new TI.UnifiedTestConfig (tmpDir) { ProjectName = "UnifiedExample.csproj", ItemGroup = itemGroup }); var testResults = TI.BuildProject (projectPath); @@ -191,7 +191,7 @@ public void BuildingSameBindingProject_TwoTimes_ShallNotInvokeMMPTwoTimes (strin Configuration.IgnoreIfIgnoredPlatform (ApplePlatform.MacOSX); Configuration.AssertLegacyXamarinAvailable (); // Investigate whether this test should be ported to .NET - var dylib = Path.GetFullPath (Path.Combine (TI.TestDirectory, "test-libraries", ".libs", "macos", "libtest.dylib")); + var dylib = Path.GetFullPath (Path.Combine (TI.TestDirectory, "test-libraries", ".libs", "macos", "libframework.dylib")); string nativeRefItemGroup = $"DynamicFalse"; RunMSBuildTest (tmpDir => { diff --git a/tests/msbuild/Xamarin.MacDev.Tests/ProjectsTests/NativeReferences.cs b/tests/msbuild/Xamarin.MacDev.Tests/ProjectsTests/NativeReferences.cs index 8652811778f..f0b2ef26073 100644 --- a/tests/msbuild/Xamarin.MacDev.Tests/ProjectsTests/NativeReferences.cs +++ b/tests/msbuild/Xamarin.MacDev.Tests/ProjectsTests/NativeReferences.cs @@ -27,7 +27,7 @@ public void BasicTest () Engine.ProjectCollection.SetGlobalProperty ("Platform", Platform); - var include = Path.Combine (Configuration.RootPath, "tests", "test-libraries", ".libs", "ios-fat", "XTest.framework"); + var include = Path.Combine (Configuration.RootPath, "tests", "test-libraries", ".libs", "iossimulator", "XTest.framework"); var metadata = new Dictionary { { "IsCxx", "False" }, { "Kind", "Framework" }, diff --git a/tests/msbuild/Xamarin.MacDev.Tests/ProjectsTests/NativeReferencesNoEmbedding.cs b/tests/msbuild/Xamarin.MacDev.Tests/ProjectsTests/NativeReferencesNoEmbedding.cs index 2f22ab304b0..9b187aa637d 100644 --- a/tests/msbuild/Xamarin.MacDev.Tests/ProjectsTests/NativeReferencesNoEmbedding.cs +++ b/tests/msbuild/Xamarin.MacDev.Tests/ProjectsTests/NativeReferencesNoEmbedding.cs @@ -101,7 +101,7 @@ public void ShouldNotUnnecessarilyRebuildBindingProject (bool framework) ClearMessages (); // Touching native library should - Touch (Path.Combine (Configuration.RootPath, "tests", "test-libraries", ".libs", "ios-fat", "XTest.framework/XTest")); + Touch (Path.Combine (Configuration.RootPath, "tests", "test-libraries", ".libs", "iossimulator", "XTest.framework", "XTest")); BuildProjectNoEmbedding (bindingLib, clean: false); Assert.True (GetMessages ().Contains (CreatePackageString), "Binding build did not create package?"); } diff --git a/tests/test-libraries/.gitignore b/tests/test-libraries/.gitignore index 7ceac101bd8..f45d5bc6a83 100644 --- a/tests/test-libraries/.gitignore +++ b/tests/test-libraries/.gitignore @@ -1,8 +1,6 @@ *.a *.o .libs -libtest-ar.m -libtest-object.m libtest.structs.h libtest.properties.h libtest.decompile.m diff --git a/tests/test-libraries/Makefile b/tests/test-libraries/Makefile index 1b1c188866d..1110aa4154c 100644 --- a/tests/test-libraries/Makefile +++ b/tests/test-libraries/Makefile @@ -13,6 +13,16 @@ else ZIP=zip --symlinks endif +TEST_FRAMEWORKS+=XTest +TEST_FRAMEWORKS+=XStaticArTest +TEST_FRAMEWORKS+=XStaticObjectTest +TEST_FRAMEWORKS+=SwiftTest + +DYNAMIC_TEST_FRAMEWORKS+=XTest +STATIC_AR_TEST_FRAMEWORKS+=XStaticArTest +STATIC_OBJECT_TEST_FRAMEWORKS+=XStaticObjectTest +DYNAMIC_TEST_FRAMEWORKS+=SwiftTest + GENERATED_FILES = \ libtest.structs.h \ libtest.decompile.m \ @@ -38,437 +48,305 @@ $(TESTGENERATOR): testgenerator.cs Makefile $(GENERATED_FILES_PATTERN): $(TESTGENERATOR) $(Q) $(DOTNET) exec $< -libtest-object.m libtest-ar.m: - $(Q) ln -fhs libtest.m $@ - -MACOS_INFO_PLIST_INFIX=/Versions/A/Resources -MACOS_BINARY_INFIX=/Versions/A -MACCATALYST_INFO_PLIST_INFIX=/Versions/A/Resources -MACCATALYST_BINARY_INFIX=/Versions/A - -define SymlinksTemplate - -$(1)_$(4)_TARGETS += \ - .libs/$(1)/$(3).framework/$(3) \ - .libs/$(1)/$(3).framework/Resources \ - .libs/$(1)/$(3).framework/Versions/Current \ - .libs/$(1)/$(3).framework/Versions/A/Resources/Info.plist \ - -.libs/$(1)/$(3).framework$($(2)_BINARY_INFIX) .libs/$(1)/$(3).framework$($(2)_INFO_PLIST_INFIX): - $$(Q) mkdir -p $$@ - -.libs/$(1)/$(3).framework/$(3): | .libs/$(1)/$(3).framework - $$(Q) ln -fs Versions/A/$(3) $$@ - -.libs/$(1)/$(3).framework/Resources: | .libs/$(1)/$(3).framework - $$(Q) ln -fs Versions/Current/Resources $$@ - -.libs/$(1)/$(3).framework/Versions/Current: | .libs/$(1)/$(3).framework/Versions - $$(Q) ln -fs A $$@ - -x:: - @echo $(1)_XTEST_TARGETS=$$($(1)_XTEST_TARGETS) - +define DefineInfixes +$(1)_INFO_PLIST_INFIX=/Versions/A/Resources +$(1)_BINARY_INFIX=/Versions/A endef -ifdef INCLUDE_MAC -$(eval $(call SymlinksTemplate,macos,MACOS,XTest,XTEST)) -$(eval $(call SymlinksTemplate,macos,MACOS,SwiftTest,SWIFTTEST)) -endif -ifdef INCLUDE_MACCATALYST -$(eval $(call SymlinksTemplate,maccatalyst,MACCATALYST,XTest,XTEST)) -$(eval $(call SymlinksTemplate,maccatalyst,MACCATALYST,SwiftTest,SWIFTTEST)) -endif - -define Template +$(foreach platform,$(DOTNET_DESKTOP_PLATFORMS),$(foreach rid,$(DOTNET_$(shell echo $(platform)| tr 'a-z' 'A-Z')_RUNTIME_IDENTIFIERS),$(eval $(call DefineInfixes,$(rid))))) +$(foreach platform,$(DOTNET_DESKTOP_PLATFORMS),$(eval $(call DefineInfixes,$(shell echo $(platform) | tr 'A-Z' 'a-z')))) +$(foreach platform,$(DOTNET_DESKTOP_PLATFORMS),$(eval $(call DefineInfixes,$(shell echo $(platform) | tr 'a-z' 'A-Z')))) -$(1)_XTEST_TARGETS += \ - .libs/$(1)/XTest.framework$($(2)_BINARY_INFIX)/XTest \ - .libs/$(1)/XTest.framework$($(2)_INFO_PLIST_INFIX)/Info.plist \ +# Create the binary for all the dynamic test frameworks +define TestDynamicFrameworkTemplate +TEST_FRAMEWORK_$(1)_$(2)_TARGETS += \ + .libs/$(1)/$(2).framework$($(1)_INFO_PLIST_INFIX)/Info.plist \ -$(1)_XSTATICARTEST_TARGETS += \ - .libs/$(1)/XStaticArTest.framework/XStaticArTest \ +.libs/$(1)/$(2).framework$($(1)_BINARY_INFIX)/$(2): .libs/$(1)/lib$(2).dylib | .libs/$(1)/$(2).framework$($(1)_BINARY_INFIX) + $$(Q) $(CP) $$^ $$@ + $$(Q) $(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool -id @rpath/$(2).framework/$(2) $$@ -$(1)_XSTATICOBJECTTEST_TARGETS += \ - .libs/$(1)/XStaticObjectTest.framework/XStaticObjectTest \ +.libs/$(1)/$(2).framework$($(1)_INFO_PLIST_INFIX)/Info.plist: plists/$(2)-Info-$(1).plist | .libs/$(1)/$(2).framework$($(1)_INFO_PLIST_INFIX) + $$(Q) $(CP) $$^ $$@ +endef +$(foreach testFramework,$(DYNAMIC_TEST_FRAMEWORKS),$(foreach rid,$(DOTNET_RUNTIME_IDENTIFIERS),$(eval $(call TestDynamicFrameworkTemplate,$(rid),$(testFramework))))) -$(1)_SWIFTTEST_TARGETS += \ - .libs/$(1)/SwiftTest.framework$($(2)_BINARY_INFIX)/SwiftTest \ - .libs/$(1)/SwiftTest.framework$($(2)_INFO_PLIST_INFIX)/Info.plist \ +# Create the binary for all the static (.a) test frameworks +define TestStaticArFrameworkTemplate +.libs/$(1)/$(2).framework/$(2): .libs/$(1)/lib$(2).a | .libs/$(1)/$(2).framework + $$(Q) $(CP) $$^ $$@ +endef +$(foreach testFramework,$(STATIC_AR_TEST_FRAMEWORKS),$(foreach rid,$(DOTNET_RUNTIME_IDENTIFIERS),$(eval $(call TestStaticArFrameworkTemplate,$(rid),$(testFramework))))) -$(2)_TARGETS = \ - $$($(1)_XTEST_TARGETS) \ - $$($(1)_SWIFTTEST_TARGETS) \ - .libs/$(1)/XStaticObjectTest.framework/XStaticObjectTest \ - .libs/$(1)/XStaticArTest.framework/XStaticArTest \ - .libs/$(1)/libtest.dylib \ - .libs/$(1)/libtest2.a \ - .libs/$(1)/libtest.a \ - .libs/$(1)/libtest-object.a \ - .libs/$(1)/libtest-ar.a \ - $$(foreach arch,$(3),.libs/$(1)/libtest.$$(arch).a) \ - $$(foreach arch,$(3),.libs/$(1)/libtest-object.$$(arch).a) \ - $$(foreach arch,$(3),.libs/$(1)/libtest-ar.$$(arch).a) \ - .libs/$(1)/XTest.framework \ - .libs/$(1)/XTest.framework.stamp \ - .libs/$(1)/XStaticArTest.framework.stamp \ - .libs/$(1)/XStaticObjectTest.framework.stamp \ - .libs/$(1)/SwiftTest.framework \ - .libs/$(1)/SwiftTest.framework.stamp \ - -all-local:: $$($(2)_TARGETS) $(GENERATED_FILES) - -.libs/$(1)/XTest.framework.stamp: $$($(1)_XTEST_TARGETS) - $$(Q) touch $$@ +# Create the binary for all the static (.o) test frameworks +define TestStaticObjectFrameworkTemplate +.libs/$(1)/$(2).framework/$(2): .libs/$(1)/lib$(2).o | .libs/$(1)/$(2).framework + $$(Q) $(CP) $$^ $$@ +endef +$(foreach testFramework,$(STATIC_OBJECT_TEST_FRAMEWORKS),$(foreach rid,$(DOTNET_RUNTIME_IDENTIFIERS),$(eval $(call TestStaticObjectFrameworkTemplate,$(rid),$(testFramework))))) -.libs/$(1)/XStaticArTest.framework.stamp: $$($(1)_XSTATICARTEST_TARGETS) - $$(Q) touch $$@ +# Create all the test frameworks +define TestDynamicFrameworkTemplate +TEST_DYNAMIC_FRAMEWORK_$(1)_$(2)_TARGETS += \ + .libs/$(1)/$(2).framework$($(1)_BINARY_INFIX)/$(2) \ -.libs/$(1)/XStaticObjectTest.framework.stamp: $$($(1)_XSTATICOBJECTTEST_TARGETS) - $$(Q) touch $$@ +TEST_DYNAMIC_FRAMEWORK_$(1)_TARGETS = \ + $$(TEST_DYNAMIC_FRAMEWORK_$(1)_$(2)_TARGETS) \ + .libs/$(1)/$(2).framework \ + .libs/$(1)/$(2).framework.stamp \ -.libs/$(1)/SwiftTest.framework.stamp: $$($(1)_SWIFTTEST_TARGETS) +.libs/$(1)/$(2).framework.stamp: $$(TEST_DYNAMIC_FRAMEWORK_$(1)_$(2)_TARGETS) $$(Q) touch $$@ -clean-$(1): - rm -Rf .libs/$(1) - -CLEAN_TARGETS += clean-$(1) -EXTRA_DEPENDENCIES = libtest.h $(GENERATED_FILES) rename.h - -.libs/$(1)/libtest-object.%.o: export EXTRA_DEFINES=-DPREFIX=1 -.libs/$(1)/libtest-ar.%.o: export EXTRA_DEFINES=-DPREFIX=2 +TEST_DYNAMIC_FRAMEWORK_$(1)_DIRECTORIES = \ + .libs/$(1)/$(2).framework/Versions \ + .libs/$(1)/$(2).framework \ -.libs/$(1)/libtest%.a: .libs/$(1)/libtest%.o libtest-object.m libtest-ar.m - $(Q) rm -f $$@ - $$(call Q_2,AR [$(1)]) $(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar cru $$@ $$< - -.libs/$(1)/libtest.a: $$(foreach arch,$(3),.libs/$(1)/libtest.$$(arch).a) - $(Q) rm -f $$@ - $$(call Q_2,LIPO [$(1)]) $(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo $$^ -create -output $$@ - -.libs/$(1)/libtest2.a: $$(foreach arch,$(3),.libs/$(1)/libtest2.$$(arch).a) - $(Q) rm -f $$@ - $$(call Q_2,LIPO [$(1)]) $(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo $$^ -create -output $$@ - -.libs/$(1)/libtest-object.a: $$(foreach arch,$(3),.libs/$(1)/libtest-object.$$(arch).a) - $(Q) rm -f $$@ - $$(call Q_2,LIPO [$(1)]) $(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo $$^ -create -output $$@ +$$(TEST_DYNAMIC_FRAMEWORK_$(1)_DIRECTORIES): + $$(Q) mkdir -p $$@ -.libs/$(1)/libtest-ar.a: $$(foreach arch,$(3),.libs/$(1)/libtest-ar.$$(arch).a) - $(Q) rm -f $$@ - $$(call Q_2,LIPO [$(1)]) $(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo $$^ -create -output $$@ +all-local:: $$(TEST_DYNAMIC_FRAMEWORK_$(1)_TARGETS) +endef +$(foreach testFramework,$(DYNAMIC_TEST_FRAMEWORKS),$(foreach rid,$(DOTNET_RUNTIME_IDENTIFIERS),$(eval $(call TestDynamicFrameworkTemplate,$(rid),$(testFramework))))) -COMMON_DYLIB_ARGS=-g -dynamiclib -gdwarf-2 -fms-extensions libframework.m -o $$@ -Wall -framework Foundation -lz -.libs/$(1)/libtest.x86.dylib: ARCH=i386 -.libs/$(1)/libtest.%.dylib: libframework.m | .libs/$(1) - $$(call Q_2,CC, [$(1)]) $$(XCODE_CC) $$(COMMON_DYLIB_ARGS) -arch $$(if $$(ARCH),$$(ARCH),$$*) $(5) $$($(2)_$$(shell echo $$* | tr a-z A-Z)_OBJC_CFLAGS) - $$(Q) $(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool -id @rpath/libtest.dylib $$@ +define TestStaticFrameworkTemplate +TEST_STATIC_FRAMEWORK_$(1)_$(2)_TARGETS += \ + .libs/$(1)/$(2).framework/$(2) \ -## The following arm64_32 rule is required for this to work with newer make versions, otherwise a rule in mk/rules.mk is chosen instead. -## The problem is that 'arm64_32' is longer than 'libtest', the former is a stem in the rule just above, while the latter is a rule in mk/rules.mk, -## and in newer make versions make will choose the rule that matches the shorter stem. -.libs/$(1)/libtest.arm64_32.dylib: libframework.m | .libs/$(1) - $$(call Q_2,CC, [$(1)]) $$(XCODE_CC) $$(COMMON_DYLIB_ARGS) -arch arm64_32 $(5) $$($(2)_$$(shell echo $$* | tr a-z A-Z)_OBJC_CFLAGS) - $$(Q) $(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool -id @rpath/libtest.dylib $$@ +TEST_STATIC_FRAMEWORK_$(1)_TARGETS = \ + $$(TEST_STATIC_FRAMEWORK_$(1)_$(2)_TARGETS) \ + .libs/$(1)/$(2).framework \ + .libs/$(1)/$(2).framework.stamp \ -.libs/$(1)/libtest.dylib: $$(foreach arch,$(3),.libs/$(1)/libtest.$$(arch).dylib) - $$(call Q_2,LIPO [$(1)]) $(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo $$^ -create -output $$@ +.libs/$(1)/$(2).framework.stamp: $$(TEST_STATIC_FRAMEWORK_$(1)_$(2)_TARGETS) + $$(Q) touch $$@ -.libs/$(1)/libSwiftTest.dylib: $$(foreach arch,$(3),.libs/$(1)/libSwiftTest.$$(arch).dylib) - $$(call Q_2,LIPO [$(1)]) $(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo $$^ -create -output $$@ +TEST_STATIC_FRAMEWORK_$(1)_DIRECTORIES = \ + .libs/$(1)/$(2).framework/Versions \ + .libs/$(1)/$(2).framework \ -# SwiftTest is a framework where the binary code is a (fat) dynamic library -.libs/$(1)/SwiftTest.framework$($(2)_BINARY_INFIX)/SwiftTest: .libs/$(1)/libSwiftTest.dylib | .libs/$(1)/SwiftTest.framework$($(2)_BINARY_INFIX) - $$(Q) $(CP) $$^ $$@ - $$(Q) $(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool -id @rpath/SwiftTest.framework/SwiftTest $$@ +$$(TEST_STATIC_FRAMEWORK_$(1)_DIRECTORIES): + $$(Q) mkdir -p $$@ -.libs/$(1)/SwiftTest.framework$($(2)_INFO_PLIST_INFIX)/Info.plist: SwiftTest-Info-$(1).plist | .libs/$(1)/SwiftTest.framework$($(2)_INFO_PLIST_INFIX) - $$(Q) $(CP) $$^ $$@ +all-local:: $$(TEST_STATIC_FRAMEWORK_$(1)_TARGETS) +endef +$(foreach testFramework,$(STATIC_AR_TEST_FRAMEWORKS),$(foreach rid,$(DOTNET_RUNTIME_IDENTIFIERS),$(eval $(call TestStaticFrameworkTemplate,$(rid),$(testFramework))))) +$(foreach testFramework,$(STATIC_OBJECT_TEST_FRAMEWORKS),$(foreach rid,$(DOTNET_RUNTIME_IDENTIFIERS),$(eval $(call TestStaticFrameworkTemplate,$(rid),$(testFramework))))) -# XTest is a framework where the binary code is a (fat) dynamic library -.libs/$(1)/XTest.framework$($(2)_BINARY_INFIX)/XTest: .libs/$(1)/libtest.dylib | .libs/$(1)/XTest.framework$($(2)_BINARY_INFIX) - $$(Q) $(CP) $$^ $$@ - $$(Q) $(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool -id @rpath/XTest.framework/XTest $$@ -.libs/$(1)/XTest.framework$($(2)_INFO_PLIST_INFIX)/Info.plist: XTest-Info-$(1).plist | .libs/$(1)/XTest.framework$($(2)_INFO_PLIST_INFIX) - $$(Q) $(CP) $$^ $$@ +# Create the symlinks for the test frameworks for desktop platforms +define TestFrameworkSymlinksTemplate +SYMLINK_$(1)_TARGETS += \ + .libs/$(1)/$(2).framework/$(2) \ + .libs/$(1)/$(2).framework/Resources \ + .libs/$(1)/$(2).framework/Versions/Current \ + .libs/$(1)/$(2).framework/Versions/A/Resources/Info.plist \ -# XStaticObjectTest is a framework where the binary code is a (fat) object file -.libs/$(1)/XStaticObjectTest.framework/XStaticObjectTest: $$(foreach arch,$(3),.libs/$(1)/libtest-object.$$(arch).o) | .libs/$(1)/XStaticObjectTest.framework - $(Q) rm -f $$@ - $$(call Q_2,LIPO [$(1)]) $(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo $$^ -create -output $$@ +.libs/$(1)/$(2).framework$($(1)_BINARY_INFIX) .libs/$(1)/$(2).framework$($(1)_INFO_PLIST_INFIX): + $$(Q) mkdir -p $$@ -# XStaticArTest is a framework where the binary code is a (fat) ar archive (of object files) -.libs/$(1)/XStaticArTest.framework/XStaticArTest: $$(foreach arch,$(3),.libs/$(1)/libtest-ar.$$(arch).a) | .libs/$(1)/XStaticArTest.framework - $(Q) rm -f $$@ - $$(call Q_2,LIPO [$(1)]) $(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo $$^ -create -output $$@ +.libs/$(1)/$(2).framework/$(2): | .libs/$(1)/$(2).framework + $$(Q) ln -fs Versions/A/$(2) $$@ -$(1)_DIRECTORIES = \ - .libs/$(1)/XTest.framework \ - .libs/$(1)/XTest.framework/Versions \ - .libs/$(1)/SwiftTest.framework/Versions \ - .libs/$(1)/XStaticObjectTest.framework \ - .libs/$(1)/XStaticArTest.framework \ - .libs/$(1)/SwiftTest.framework \ +.libs/$(1)/$(2).framework/Resources: | .libs/$(1)/$(2).framework + $$(Q) ln -fs Versions/Current/Resources $$@ -$$($(1)_DIRECTORIES): - $$(Q) mkdir -p $$@ +.libs/$(1)/$(2).framework/Versions/Current: | .libs/$(1)/$(2).framework/Versions + $$(Q) ln -fs A $$@ +all-locals:: $$(SYMLINK_$(1)_TARGETS) endef +$(foreach testFramework,$(DYNAMIC_TEST_FRAMEWORKS),$(foreach platform,$(DOTNET_DESKTOP_PLATFORMS),$(foreach rid,$(DOTNET_$(shell echo $(platform) | tr 'a-z' 'A-Z')_RUNTIME_IDENTIFIERS),$(eval $(call TestFrameworkSymlinksTemplate,$(rid),$(testFramework)))))) -IOS_SIMULATOR_ARCHITECTURES+=x86_64 arm64 -IOS_DEVICE_ARCHITECTURES+=arm64 - -# 1: platform infix -# 2: platform variable -# 3: architectures -# 4: platform name -# 5: min version -# 6: os -$(eval $(call Template,iphonesimulator,IOSSIMULATOR,$(IOS_SIMULATOR_ARCHITECTURES),iPhoneSimulator,-mios-simulator-version-min=$(MIN_IOS_SDK_VERSION) -isysroot $(SIMULATOR_SDK))) -$(eval $(call Template,iphoneos,IPHONEOS,$(IOS_DEVICE_ARCHITECTURES),iPhoneOS,-miphoneos-version-min=$(MIN_IOS_SDK_VERSION) -isysroot $(DEVICE_SDK))) -ifdef INCLUDE_TVOS -$(eval $(call Template,tvsimulator,TVSIMULATOR,x86_64 arm64,AppleTVSimulator,-mtvos-simulator-version-min=$(MIN_TVOS_SDK_VERSION) -isysroot $(SIMULATORTV_SDK))) -$(eval $(call Template,tvos,TVOS,arm64,AppleTVOS,-mtvos-version-min=$(MIN_TVOS_SDK_VERSION) -isysroot $(DEVICETV_SDK))) -endif -ifdef INCLUDE_MAC -$(eval $(call Template,macos,MACOS,x86_64 arm64,MacOSX,-mmacosx-version-min=$(MIN_OSX_VERSION_FOR_MAC) -isysroot $(XCODE_DEVELOPER_ROOT)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$(MACOS_SDK_VERSION).sdk)) -endif -ifdef INCLUDE_MACCATALYST -$(eval $(call Template,maccatalyst,MACCATALYST,x86_64 arm64,MacCatalyst,$(MACCATALYST_COMMON_CFLAGS))) -endif +# Create a framework for each platform, which would potentially be a fat framework. +# Here 'platform' is defined as a platform for xcframework - ios device is one platform, where ios simulator is another (which would be fat: iossimulator-x64,iossimulator-arm64). +define PlatformFrameworkTemplate +.libs/$(1)/$(2).framework$($(1)_BINARY_INFIX)/$(2): $$(foreach rid,$(3),.libs/$$(rid)/$(2).framework$($(1)_BINARY_INFIX)/$(2)) + $$(Q) mkdir -p $$(dir $$@) + $$(Q) lipo -create -output "$$@" $$^ -.libs/ios-fat .libs/tvos-fat .libs/maccatalyst-fat .libs/macos-fat: - $(Q) mkdir -p $@ +.libs/$(1)/$(2).framework.stamp: .libs/$(1)/$(2).framework$($(1)_BINARY_INFIX)/$(2) + $$(Q) touch $$@ -define LibTemplate -.libs/$(4)/libtest.$(1).a: $(2) $(3) | .libs/$(4) - @rm -f $$@ - $$(Q_LIPO) $(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo $$^ -create -output $$@ +PLATFORM_FRAMEWORK_TEMPLATE_$(1)_TARGETS += \ + .libs/$(1)/$(2).framework$($(1)_BINARY_INFIX)/$(2) \ -$(5)_TARGETS += .libs/$(4)/libtest.$(1).a -all-local:: $$($(5)_TARGETS) +all-local:: $$(PLATFORM_FRAMEWORK_TEMPLATE_$(1)_TARGETS) endef +$(foreach testFramework,$(DYNAMIC_TEST_FRAMEWORKS),$(foreach xcframeworkPlatform,$(XCFRAMEWORK_PLATFORMS),$(eval $(call PlatformFrameworkTemplate,$(xcframeworkPlatform),$(testFramework),$(XCFRAMEWORK_$(xcframeworkPlatform)_RUNTIME_IDENTIFIERS))))) + +# Create a framework for each platform, which would potentially be a fat framework. +# Here 'platform' is defined as a platform for xcframework - ios device is one platform, where ios simulator is another (which would be fat: iossimulator-x64,iossimulator-arm64). +define PlatformDynamicFrameworkTemplate +.libs/$(1)/$(2).framework$($(1)_INFO_PLIST_INFIX)/Info.plist: $$(foreach rid,$(3),.libs/$$(rid)/$(2).framework$($(1)_INFO_PLIST_INFIX)/Info.plist) + $$(Q) mkdir -p $$(dir $$@) + @# Check if the Info.plists are identical (if there are more than one) + $$(Q) test "$$(words $$^)" -eq 1 || diff $$^ + @# Copy one of them + $$(Q) $(CP) $$< $$@ -ifdef INCLUDE_TVOS -$(eval $(call LibTemplate,arm64+x86_64,.libs/tvos/libtest.arm64.o,.libs/tvsimulator/libtest.x86_64.o,tvos-fat,TVOS)) -endif - -ifdef INCLUDE_MACCATALYST -$(eval $(call LibTemplate,x86_64+arm64,.libs/maccatalyst/libtest.x86_64.o,.libs/maccatalyst/libtest.arm64.o,maccatalyst-fat,MACCATALYST)) -endif - -ifdef INCLUDE_MAC -$(eval $(call LibTemplate,x86_64+arm64,.libs/macos/libtest.x86_64.o,.libs/macos/libtest.arm64.o,macos-fat,MACOS)) -endif +.libs/$(1)/$(2).framework.stamp: .libs/$(1)/$(2).framework$($(1)_INFO_PLIST_INFIX)/Info.plist -define FatFrameworkTemplate -.libs/$(1)/XStaticObjectTest.framework/XStaticObjectTest: .libs/$(2)/XStaticObjectTest.framework/XStaticObjectTest .libs/$(3)/XStaticObjectTest.framework/XStaticObjectTest | .libs/$(1) - $(Q) mkdir -p $$(dir $$@) - $(Q) ./lipo-remove-sim-arm64.sh $$@ $$^ +all-local:: .libs/$(1)/$(2).framework$($(1)_INFO_PLIST_INFIX)/Info.plist +endef +$(foreach testFramework,$(DYNAMIC_TEST_FRAMEWORKS),$(foreach xcframeworkPlatform,$(XCFRAMEWORK_PLATFORMS),$(eval $(call PlatformDynamicFrameworkTemplate,$(xcframeworkPlatform),$(testFramework),$(XCFRAMEWORK_$(xcframeworkPlatform)_RUNTIME_IDENTIFIERS))))) -.libs/$(1)/XStaticArTest.framework/XStaticArTest: .libs/$(2)/XStaticArTest.framework/XStaticArTest .libs/$(3)/XStaticArTest.framework/XStaticArTest | .libs/$(1) - $(Q) mkdir -p $$(dir $$@) - $(Q) ./lipo-remove-sim-arm64.sh $$@ $$^ +# Create a framework for each platform, which would potentially be a fat framework. +# Here 'platform' is defined as a platform for xcframework - ios device is one platform, where ios simulator is another (which would be fat: iossimulator-x64,iossimulator-arm64). +define PlatformStaticFrameworkTemplate +.libs/$(1)/$(2).framework/$(2): $$(foreach rid,$(3),.libs/$$(rid)/$(2).framework/$(2)) + $$(Q) mkdir -p $$(dir $$@) + $$(Q) lipo -create -output "$$@" $$^ -.libs/$(1)/XTest.framework$($(4)_BINARY_INFIX)/XTest: .libs/$(2)/XTest.framework$($(4)_BINARY_INFIX)/XTest .libs/$(3)/XTest.framework$($(4)_BINARY_INFIX)/XTest | .libs/$(1) - $(Q) mkdir -p $$(dir $$@) - $(Q) ./lipo-remove-sim-arm64.sh $$@ $$^ +.libs/$(1)/$(2).framework.stamp: .libs/$(1)/$(2).framework/$(2) + $$(Q) touch $$@ -.libs/$(1)/XTest.framework$($(4)_INFO_PLIST_INFIX)/Info.plist: .libs/$(2)/XTest.framework$($(4)_INFO_PLIST_INFIX)/Info.plist .libs/$(3)/XTest.framework$($(4)_INFO_PLIST_INFIX)/Info.plist - $(Q) mkdir -p $$(dir $$@) -ifneq ($(2),$(3)) - @# Check if the Info.plists are identical - $(Q) diff $$^ -endif - @# Copy one of them - $(Q) $(CP) $$< $$@ +PLATFORM_STATIC_FRAMEWORK_TEMPLATE_$(1)_TARGETS += \ + .libs/$(1)/$(2).framework/$(2) \ -.libs/$(1)/libtest.a: .libs/$(2)/libtest.a .libs/$(3)/libtest.a | .libs/$(1) - $(Q) ./lipo-remove-sim-arm64.sh $$@ $$^ +all-local:: $$(PLATFORM_STATIC_FRAMEWORK_TEMPLATE_$(1)_TARGETS) +endef +$(foreach testFramework,$(STATIC_AR_TEST_FRAMEWORKS),$(foreach xcframeworkPlatform,$(XCFRAMEWORK_PLATFORMS),$(eval $(call PlatformStaticFrameworkTemplate,$(xcframeworkPlatform),$(testFramework),$(XCFRAMEWORK_$(xcframeworkPlatform)_RUNTIME_IDENTIFIERS))))) +$(foreach testFramework,$(STATIC_OBJECT_TEST_FRAMEWORKS),$(foreach xcframeworkPlatform,$(XCFRAMEWORK_PLATFORMS),$(eval $(call PlatformStaticFrameworkTemplate,$(xcframeworkPlatform),$(testFramework),$(XCFRAMEWORK_$(xcframeworkPlatform)_RUNTIME_IDENTIFIERS))))) -.libs/$(1)/libtest2.a: .libs/$(2)/libtest2.a .libs/$(3)/libtest2.a | .libs/$(1) - $(Q) ./lipo-remove-sim-arm64.sh $$@ $$^ +# Create a static library for each platform, which would potentially be a fat static library. +# Here 'platform' is defined as a platform for xcframework - ios device is one platform, where ios simulator is another (which would be fat: iossimulator-x64,iossimulator-arm64). +define PlatformStaticTemplate +.libs/$(1)/$(2).a: $$(foreach rid,$(3),.libs/$$(rid)/$(2).a) + $$(Q) mkdir -p $$(dir $$@) + $$(Q) lipo -create -output "$$@" $$^ -.libs/$(1)/libtest.dylib: .libs/$(2)/libtest.dylib .libs/$(3)/libtest.dylib | .libs/$(1) - $(Q) ./lipo-remove-sim-arm64.sh $$@ $$^ +all-local:: .libs/$(1)/$(2).a +endef +$(foreach testFramework,libtest libtest2,$(foreach xcframeworkPlatform,$(XCFRAMEWORK_PLATFORMS),$(eval $(call PlatformStaticTemplate,$(xcframeworkPlatform),$(testFramework),$(XCFRAMEWORK_$(xcframeworkPlatform)_RUNTIME_IDENTIFIERS))))) -$(4)_TARGETS += \ - .libs/$(1)/XTest.framework$($(4)_BINARY_INFIX)/XTest \ - .libs/$(1)/XTest.framework$($(4)_INFO_PLIST_INFIX)/Info.plist \ - .libs/$(1)/XStaticObjectTest.framework/XStaticObjectTest \ - .libs/$(1)/XStaticArTest.framework/XStaticArTest \ - .libs/$(1)/libtest.dylib \ - .libs/$(1)/libtest.a \ - .libs/$(1)/libtest2.a \ +# Create a dynamic library for each platform, which would potentially be a fat dynamic library. +# Here 'platform' is defined as a platform for xcframework - ios device is one platform, where ios simulator is another (which would be fat: iossimulator-x64,iossimulator-arm64). +define PlatformDynamicTemplate +.libs/$(1)/$(2).dylib: $$(foreach rid,$(3),.libs/$$(rid)/$(2).dylib) + $$(Q) mkdir -p $$(dir $$@) + $$(Q) lipo -create -output "$$@" $$^ -all-local:: $$($(4)_TARGETS) +all-local:: .libs/$(1)/$(2).dylib endef +$(foreach testFramework,libframework,$(foreach xcframeworkPlatform,$(XCFRAMEWORK_PLATFORMS),$(eval $(call PlatformDynamicTemplate,$(xcframeworkPlatform),$(testFramework),$(XCFRAMEWORK_$(xcframeworkPlatform)_RUNTIME_IDENTIFIERS))))) -$(eval $(call FatFrameworkTemplate,ios-fat,iphoneos,iphonesimulator,IPHONESIMULATOR)) -ifdef INCLUDE_TVOS -$(eval $(call FatFrameworkTemplate,tvos-fat,tvos,tvsimulator,TVSIMULATOR)) -endif -ifdef INCLUDE_MACCATALYST -$(eval $(call FatFrameworkTemplate,maccatalyst-fat,maccatalyst,maccatalyst,MACCATALYST)) -endif -ifdef INCLUDE_MAC -$(eval $(call FatFrameworkTemplate,macos-fat,macos,macos,MACOS)) -endif +# Create the symlinks for the per-platform frameworks (for desktop platforms) +# Here 'platform' is defined as a platform for xcframework (see above) +define PlatformFrameworkSymlinksTemplate +.libs/$(1)/$(2).framework/$(2): + $$(Q) mkdir -p $$(dir $$@) + $$(Q) ln -fs Versions/A/$(2) $$@ -define FatFrameworkSymlinksTemplate -.libs/$(1)/XTest.framework/XTest: | .libs/$(1) - $(Q) mkdir -p $$(dir $$@) - $(Q) ln -fs Versions/A/XTest $$@ +.libs/$(1)/$(2).framework/Resources: + $$(Q) mkdir -p $$(dir $$@) + $$(Q) ln -fs Versions/A/Resources $$@ -.libs/$(1)/XTest.framework/Resources: | .libs/$(1) - $(Q) mkdir -p $$(dir $$@) - $(Q) ln -fs Versions/A/Resources $$@ +.libs/$(1)/$(2).framework/Versions/Current: + $$(Q) mkdir -p $$(dir $$@) + $$(Q) ln -fs A $$@ -.libs/$(1)/XTest.framework/Versions/Current: | .libs/$(1) - $(Q) mkdir -p $$(dir $$@) - $(Q) ln -fs A $$@ +PLATFORM_FRAMEWORK_SYMLINKS_TEMPLATE_$(4)_TARGETS += \ + .libs/$(1)/$(2).framework/$(2) \ + .libs/$(1)/$(2).framework/Resources \ + .libs/$(1)/$(2).framework/Versions/Current \ -$(4)_TARGETS += \ - .libs/$(1)/XTest.framework/XTest \ - .libs/$(1)/XTest.framework/Resources \ - .libs/$(1)/XTest.framework/Versions/Current \ +.libs/$(1)/$(2).framework.stamp: | .libs/$(1)/$(2).framework/$(2) +.libs/$(1)/$(2).framework.stamp: | .libs/$(1)/$(2).framework/Versions/Current +.libs/$(1)/$(2).framework.stamp: | .libs/$(1)/$(2).framework/Resources -all-local:: $$($(4)_TARGETS) +all-local:: $$(PLATFORM_FRAMEWORK_SYMLINKS_TEMPLATE_$(4)_TARGETS) endef - -ifdef INCLUDE_MACCATALYST -$(eval $(call FatFrameworkSymlinksTemplate,maccatalyst-fat,maccatalyst,maccatalyst,MACCATALYST)) -endif -ifdef INCLUDE_MAC -$(eval $(call FatFrameworkSymlinksTemplate,macos-fat,macos,macos,MACOS)) -endif - -ifdef INCLUDE_IOS -XCPLATFORMS+= iphoneos iphonesimulator -endif -ifdef INCLUDE_TVOS -XCPLATFORMS+= tvos tvsimulator -endif -ifdef INCLUDE_MAC -XCPLATFORMS+= macos -endif -ifdef INCLUDE_MACCATALYST -XCPLATFORMS+= maccatalyst -endif +$(foreach testFramework,$(DYNAMIC_TEST_FRAMEWORKS),$(foreach xcframeworkPlatform,$(XCFRAMEWORK_DESKTOP_PLATFORMS),$(eval $(call PlatformFrameworkSymlinksTemplate,$(xcframeworkPlatform),$(testFramework))))) define ZippedFrameworkTemplate -.libs/$(1)/XTest.framework.zip: $$($(2)_TARGETS) - $$(Q_ZIP) cd .libs/$(1) && $(ZIP) -r XTest.framework.zip XTest.framework +.libs/$(1)/$(2).framework.zip: .libs/$(1)/$(2).framework.stamp + $$(Q_ZIP) cd .libs/$(1) && $(ZIP) -r $(2).framework.zip $(2).framework -ZIPPED_TARGETS += .libs/$(1)/XTest.framework.zip +all-local:: .libs/$(1)/$(2).framework.zip +zip:: .libs/$(1)/$(2).framework.zip endef +$(foreach testFramework,$(TEST_FRAMEWORKS),$(foreach xcframeworkPlatform,$(XCFRAMEWORK_PLATFORMS),$(eval $(call ZippedFrameworkTemplate,$(xcframeworkPlatform),$(testFramework))))) -ifdef INCLUDE_IOS -$(eval $(call ZippedFrameworkTemplate,ios-fat,IPHONESIMULATOR)) -endif -ifdef INCLUDE_TVOS -$(eval $(call ZippedFrameworkTemplate,tvos-fat,TVSIMULATOR)) -endif -ifdef INCLUDE_MACCATALYST -$(eval $(call ZippedFrameworkTemplate,maccatalyst-fat,MACCATALYST)) -endif -ifdef INCLUDE_MAC -$(eval $(call ZippedFrameworkTemplate,macos-fat,MACOS)) -endif - -all-local:: $(ZIPPED_TARGETS) -zip: $(ZIPPED_TARGETS) - -XTEST_XCFRAMEWORKS += $(foreach platform,$(XCPLATFORMS),.libs/$(platform)/XTest.framework) -XTEST_XCTARGETS += \ - $(foreach platform,$(XCPLATFORMS),.libs/$(platform)/XTest.framework.stamp) \ - -.libs/XTest.xcframework: $(XTEST_XCTARGETS) Makefile - $(Q) rm -rf $@ - $(Q_GEN) $(XCODE_DEVELOPER_ROOT)/usr/bin/xcodebuild -quiet -create-xcframework $(foreach fw,$(XTEST_XCFRAMEWORKS),-framework $(fw)) -output $@ - -all-local:: .libs/XTest.xcframework - -XSTATICARTEST_XCFRAMEWORKS += $(foreach platform,$(XCPLATFORMS),.libs/$(platform)/XStaticArTest.framework) -XSTATICARTEST_XCTARGETS += \ - $(foreach platform,$(XCPLATFORMS),.libs/$(platform)/XStaticArTest.framework.stamp) \ - -.libs/XStaticArTest.xcframework: $(XSTATICARTEST_XCTARGETS) Makefile - $(Q) rm -rf $@ - $(Q_GEN) $(XCODE_DEVELOPER_ROOT)/usr/bin/xcodebuild -quiet -create-xcframework $(foreach fw,$(XSTATICARTEST_XCFRAMEWORKS),-framework $(fw)) -output $@ - -all-local:: .libs/XStaticArTest.xcframework +define Template +$(1)_TARGETS = \ + .libs/$(1)/libtest2.a \ + .libs/$(1)/libtest.a \ -XSTATICOBJECTTEST_XCFRAMEWORKS += $(foreach platform,$(XCPLATFORMS),.libs/$(platform)/XStaticObjectTest.framework) -XSTATICOBJECTTEST_XCTARGETS += \ - $(foreach platform,$(XCPLATFORMS),.libs/$(platform)/XStaticObjectTest.framework.stamp) \ +all-local:: $$($(1)_TARGETS) $(GENERATED_FILES) -.libs/XStaticObjectTest.xcframework: $(XSTATICOBJECTTEST_XCTARGETS) Makefile - $(Q) rm -rf $@ - $(Q_GEN) $(XCODE_DEVELOPER_ROOT)/usr/bin/xcodebuild -quiet -create-xcframework $(foreach fw,$(XSTATICOBJECTTEST_XCFRAMEWORKS),-framework $(fw)) -output $@ +EXTRA_DEPENDENCIES = libtest.h $(GENERATED_FILES) rename.h -all-local:: .libs/XStaticObjectTest.xcframework +.libs/$(1)/lib%.a: .libs/$(1)/lib%.o + $(Q) rm -f $$@ + $$(call Q_2,AR [$(1)]) $(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/ar cru $$@ $$< -LIBTEST_XCFRAMEWORKS += $(foreach platform,$(XCPLATFORMS),.libs/$(platform)/libtest.a) +.libs/$(1)/libframework.dylib: libframework.m -.libs/libtest.xcframework: $(LIBTEST_XCFRAMEWORKS) Makefile - $(Q) rm -rf $@ - $(Q_GEN) $(XCODE_DEVELOPER_ROOT)/usr/bin/xcodebuild -quiet -create-xcframework $(foreach lib,$(LIBTEST_XCFRAMEWORKS),-library $(lib)) -output $@ +# XTest is a framework where the binary code is a (fat) dynamic library +.libs/$(1)/libXTest.dylib: .libs/$(1)/libframework.dylib + $$(Q) $(CP) $$^ $$@ + $$(Q) $(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool -id @rpath/XTest.framework/XTest $$@ -all-local:: .libs/libtest.xcframework +# XStaticObjectTest is a framework where the binary code is a (fat) object file +.libs/$(1)/libXStaticObjectTest.o: .libs/$(1)/libtest-object.o + $$(Q) rm -f $$@ + $$(Q) $$(CP) $$^ $$@ -LIBTEST2_XCFRAMEWORKS += $(foreach platform,$(XCPLATFORMS),.libs/$(platform)/libtest2.a) +# XStaticArTest is a framework where the binary code is a (fat) ar archive (of object files) +.libs/$(1)/libXStaticArTest.a: .libs/$(1)/libtest-ar.a + $$(Q) rm -f $$@ + $$(Q) $$(CP) $$^ $$@ +endef -.libs/libtest2.xcframework: $(LIBTEST2_XCFRAMEWORKS) Makefile - $(Q) rm -rf $@ - $(Q_GEN) $(XCODE_DEVELOPER_ROOT)/usr/bin/xcodebuild -quiet -create-xcframework $(foreach lib,$(LIBTEST2_XCFRAMEWORKS),-library $(lib)) -output $@ +$(foreach platform,$(DOTNET_PLATFORMS),$(foreach rid,$(DOTNET_$(shell echo $(platform) | tr 'a-z' 'A-Z')_RUNTIME_IDENTIFIERS),$(eval $(call Template,$(rid),$(platform))))) -all-local:: .libs/libtest2.xcframework +# +# Swift libraries and frameworks +# -SWIFTTEST_XCFRAMEWORKS += $(foreach platform,$(XCPLATFORMS),.libs/$(platform)/SwiftTest.framework) -SWIFTTEST_XCTARGETS += \ - $(foreach platform,$(XCPLATFORMS),.libs/$(platform)/SwiftTest.framework.stamp) \ +EXTRA_libSwiftTest_FLAGS=-enable-library-evolution -emit-objc-header -.libs/SwiftTest.xcframework: $(SWIFTTEST_XCTARGETS) Makefile - $(Q) rm -rf $@ - $(Q_GEN) $(XCODE_DEVELOPER_ROOT)/usr/bin/xcodebuild -quiet -create-xcframework $(foreach fw,$(SWIFTTEST_XCFRAMEWORKS),-framework $(fw)) -output $@ +# SwiftTest is a framework where the binary code is a (fat) dynamic library +SWIFT_TESTS+=SwiftTest -all-local:: .libs/SwiftTest.xcframework +define SwiftTestsPerPlatform +.libs/$(1)/$(3).dylib: $$(foreach rid,$(2),.libs/$(1)/$(3).dylib) | .libs/$(1) + $$(call Q_2,LIPO [$(1)]) $(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo $$^ -create -output $$@ +endef +$(foreach swiftTest,$(SWIFT_TESTS),$(foreach platform,$(DOTNET_PLATFORMS),$(eval $(call SwiftTestsPerPlatform,$(platform),$(DOTNET_$(shell echo $(platform) | tr 'a-z' 'A-Z')_RUNTIME_IDENTIFIERS),$(swiftTest))))) + +# create an xcframework of frameworks +define TestFrameworkXCFramework +$(1)_XCFRAMEWORKS += $$(foreach xcframeworkPlatform,$$(XCFRAMEWORK_PLATFORMS),.libs/$$(xcframeworkPlatform)/$(1).framework) +$(1)_XCTARGETS += $$(foreach xcframeworkPlatform,$$(XCFRAMEWORK_PLATFORMS),.libs/$$(xcframeworkPlatform)/$(1).framework/$(1)) +.libs/$(1).xcframework: $$($(1)_XCTARGETS) Makefile + $$(Q) rm -rf $$@ + $$(Q_GEN) $$(XCODE_DEVELOPER_ROOT)/usr/bin/xcodebuild -quiet -create-xcframework $$(foreach fw,$$($(1)_XCFRAMEWORKS),-framework $$(fw)) -output $$@ +all-local:: .libs/$(1).xcframework +endef +$(foreach testFramework,$(TEST_FRAMEWORKS),$(eval $(call TestFrameworkXCFramework,$(testFramework)))) + +# create an xcframework of libraries +define TestLibraryXCFramework +$(1)_XCFRAMEWORKS += $$(foreach xcframeworkPlatform,$$(XCFRAMEWORK_PLATFORMS),.libs/$$(xcframeworkPlatform)/$(1).a) +$(1)_XCTARGETS += $$(foreach xcframeworkPlatform,$$(XCFRAMEWORK_PLATFORMS),.libs/$$(xcframeworkPlatform)/$(1).a) +.libs/$(1).xcframework: $$($(1)_XCTARGETS) Makefile + $$(Q) rm -rf $$@ + $$(Q_GEN) $$(XCODE_DEVELOPER_ROOT)/usr/bin/xcodebuild -quiet -create-xcframework $$(foreach fw,$$($(1)_XCFRAMEWORKS),-library $$(fw)) -output $$@ +all-local:: .libs/$(1).xcframework +endef +$(eval $(call TestLibraryXCFramework,libtest)) +$(eval $(call TestLibraryXCFramework,libtest2)) define ZippedXcframework .libs/$(1).xcframework.zip: .libs/$(1).xcframework - $(Q_ZIP) cd .libs && $(ZIP) -r "$$(notdir $$@)" "$$(notdir $$<)" + $$(Q_ZIP) cd .libs && $(ZIP) -r "$$(notdir $$@)" "$$(notdir $$<)" all-local:: .libs/$(1).xcframework.zip endef - -$(eval $(call ZippedXcframework,XTest)) -$(eval $(call ZippedXcframework,XStaticArTest)) -$(eval $(call ZippedXcframework,XStaticObjectTest)) - -# Xamarin.Mac - -MAC_CLANG = DEVELOPER_DIR=$(XCODE_DEVELOPER_ROOT) $(MAC_CC) -MAC_OBJC_CFLAGS=-ObjC++ -std=c++0x -fno-exceptions -MAC_CFLAGS = -mmacosx-version-min=$(MIN_MACOS_SDK_VERSION) -Wall -DMONOMAC -g -MAC_LDFLAGS = -mmacosx-version-min=$(MIN_MACOS_SDK_VERSION) -framework AppKit - -.libs/macos/libtest.%.o: libtest.m $(EXTRA_DEPENDENCIES) | .libs/macos - $(call Q_2,OBJC, [mac]) $(MAC_CLANG) -arch $* -c $(MAC_OBJC_CFLAGS) $(MAC_CFLAGS) -o $@ $< - -.libs/macos/libtest-object.%.o: libtest.m $(EXTRA_DEPENDENCIES) | .libs/macos - $(call Q_2,OBJC, [mac]) $(MAC_CLANG) -arch $* -c $(MAC_OBJC_CFLAGS) $(MAC_CFLAGS) -o $@ $< -DPREFIX=1 - -.libs/macos/libtest-ar.%.o: libtest.m $(EXTRA_DEPENDENCIES) | .libs/macos - $(call Q_2,OBJC, [mac]) $(MAC_CLANG) -arch $* -c $(MAC_OBJC_CFLAGS) $(MAC_CFLAGS) -o $@ $< -DPREFIX=2 - -.libs/macos/libtest2.%.o: libtest2.m $(EXTRA_DEPENDENCIES) | .libs/macos - $(call Q_2,OBJC, [mac]) $(MAC_CLANG) -arch $* -c $(MAC_OBJC_CFLAGS) $(MAC_CFLAGS) -o $@ $< - -.libs/macos: - $(Q) mkdir -p $@ - -clean-local:: $(CLEAN_TARGETS) +#$(foreach testFramework,$(TEST_FRAMEWORKS),$(call ZippedXcframework,$(testFramework))) +$(foreach testFramework,$(TEST_FRAMEWORKS),$(eval $(call ZippedXcframework,$(testFramework)))) +$(eval $(call ZippedXcframework,libtest)) +$(eval $(call ZippedXcframework,libtest2)) include $(TOP)/mk/rules.mk diff --git a/tests/test-libraries/frameworks/Makefile b/tests/test-libraries/frameworks/Makefile index 296de8d449e..56efff206d0 100644 --- a/tests/test-libraries/frameworks/Makefile +++ b/tests/test-libraries/frameworks/Makefile @@ -1,5 +1,6 @@ TOP=../../.. include $(TOP)/Make.config +include $(TOP)/mk/rules.mk # These frameworks are used by the test nugets (which are then used in the BundleStructure test) NAMES+=FrameworksInRuntimesNativeDirectory1 FrameworksInRuntimesNativeDirectory2 @@ -19,20 +20,18 @@ XPCSERVICES=XpcServiceE CompressedXpcServiceF XpcServiceG CompressedXpcServiceH # a few lookup tables, because the data we have is not always in the format we need it COMMON_DYLIB_ARGS=-g -dynamiclib -gdwarf-2 -fms-extensions shared.c -Wall -framework Foundation -lz -iphonesimulator_DYLIB_FLAGS=$(COMMON_DYLIB_ARGS) -mios-simulator-version-min=$(MIN_IOS_SDK_VERSION) -isysroot $(SIMULATOR_SDK) -iphoneos_DYLIB_FLAGS=$(COMMON_DYLIB_ARGS) -miphoneos-version-min=$(MIN_IOS_SDK_VERSION) -isysroot $(DEVICE_SDK) -tvsimulator_DYLIB_FLAGS=$(COMMON_DYLIB_ARGS) -mtvos-simulator-version-min=$(MIN_TVOS_SDK_VERSION) -isysroot $(SIMULATORTV_SDK) -tvos_DYLIB_FLAGS=$(COMMON_DYLIB_ARGS) -mtvos-version-min=$(MIN_TVOS_SDK_VERSION) -isysroot $(DEVICETV_SDK) -maccatalyst_DYLIB_FLAGS=$(COMMON_DYLIB_ARGS) $(MACCATALYST_COMMON_CFLAGS) +iphonesimulator_DYLIB_FLAGS=$(COMMON_DYLIB_ARGS) -mios-simulator-version-min=$(MIN_IOS_SDK_VERSION) -isysroot $(iossimulator_SDK) +iphoneos_DYLIB_FLAGS=$(COMMON_DYLIB_ARGS) -miphoneos-version-min=$(MIN_IOS_SDK_VERSION) -isysroot $(ios_SDK) +tvsimulator_DYLIB_FLAGS=$(COMMON_DYLIB_ARGS) -mtvos-simulator-version-min=$(MIN_TVOS_SDK_VERSION) -isysroot $(tvossimulator_SDK) +tvos_DYLIB_FLAGS=$(COMMON_DYLIB_ARGS) -mtvos-version-min=$(MIN_TVOS_SDK_VERSION) -isysroot $(tvos_SDK) +maccatalyst_DYLIB_FLAGS=$(COMMON_DYLIB_ARGS) $(maccatalyst_CFLAGS) mac_DYLIB_FLAGS=$(COMMON_DYLIB_ARGS) -mmacosx-version-min=$(MIN_OSX_VERSION_FOR_MAC) -isysroot $(XCODE_DEVELOPER_ROOT)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$(OSX_SDK_VERSION).sdk -maccatalyst-x64_DYLIB_FLAGS=$(MACCATALYST_X86_64_CFLAGS) -maccatalyst-arm64_DYLIB_FLAGS=$(MACCATALYST_ARM64_CFLAGS) +maccatalyst-x64_DYLIB_FLAGS=$(maccatalyst-x64_CFLAGS) +maccatalyst-arm64_DYLIB_FLAGS=$(maccatalyst-arm64_CFLAGS) iossimulator-x64_ARCHITECTURES=x86_64 iossimulator-arm64_ARCHITECTURES=arm64 -iossimulator-x86_ARCHITECTURES=i386 -ios-arm_ARCHITECTURES=armv7 armv7s ios-arm64_ARCHITECTURES=arm64 tvossimulator-x64_ARCHITECTURES=x86_64 tvossimulator-arm64_ARCHITECTURES=arm64 @@ -90,7 +89,7 @@ all-local:: $$($(3)_TARGETS) $$(Q) touch $$@ .libs/$(3)/lib$(1).dylib: shared.c | .libs/$(3) - $$(call Q_2,CC, [$(3)]) $$(XCODE_CC) -o $$@ $$(foreach arch,$$($(3)_ARCHITECTURES),-arch $$(arch)) $$($(2)_DYLIB_FLAGS) $$($(3)_DYLIB_FLAGS) -DNAME=$(4) + $$(call Q_2,CC, [$(3)]) $$(CLANG) -o $$@ $$(foreach arch,$$($(3)_ARCHITECTURES),-arch $$(arch)) $$($(2)_DYLIB_FLAGS) $$($(3)_DYLIB_FLAGS) -DNAME=$(4) $$(Q) $(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool -id @rpath/lib$(1).dylib $$@ .libs/$(3)/$(1).framework$($(2)_BINARY_INFIX)/$(1): .libs/$(3)/lib$(1).dylib | .libs/$(3)/$(1).framework$($(2)_BINARY_INFIX) @@ -175,12 +174,6 @@ endef # 3: platform as used by xcframework $(foreach name,$(NAMES),$(foreach platform,$(DOTNET_PLATFORMS),$(foreach xcplatform,$(DOTNET_$(platform)_SDK_PLATFORMS),$(eval $(call XCTemplate,$(name),$(platform),$(xcplatform)))))) -$(foreach platform,$(DOTNET_PLATFORMS),$(foreach xcplatform,$(DOTNET_$(platform)_SDK_PLATFORMS),.libs/$(xcplatform))): - $(Q) mkdir -p $@ - -$(foreach platform,$(DOTNET_PLATFORMS),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),.libs/$(rid))): - $(Q) mkdir -p $@ - define XCFrameworkTemplate .libs/$(1).xcframework.stamp: $$($(1)_XCTARGETS) Makefile $$(Q) rm -rf .libs/$(1).xcframework @@ -227,7 +220,7 @@ all-local:: $$($(3)_PLUGIN_TARGETS) $$(Q) touch $$@ .libs/$(3)/lib$(1).dylib: shared.c | .libs/$(3) - $$(call Q_2,CC, [$(3)]) $$(XCODE_CC) -o $$@ $$(foreach arch,$$($(3)_ARCHITECTURES),-arch $$(arch)) $$($(2)_DYLIB_FLAGS) $$($(3)_DYLIB_FLAGS) -DNAME=$(4) + $$(call Q_2,CC, [$(3)]) $$(CLANG) -o $$@ $$(foreach arch,$$($(3)_ARCHITECTURES),-arch $$(arch)) $$($(2)_DYLIB_FLAGS) $$($(3)_DYLIB_FLAGS) -DNAME=$(4) $$(Q) $(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool -id @rpath/lib$(1).dylib $$@ .libs/$(3)/$(1).$(4)$($(2)_BINARY_INFIX)/$(1): .libs/$(3)/lib$(1).dylib | .libs/$(3)/$(1).$(4)$($(2)_BINARY_INFIX) diff --git a/tests/test-libraries/libraries/Makefile b/tests/test-libraries/libraries/Makefile index 137d4ab0c21..4544396f8a1 100644 --- a/tests/test-libraries/libraries/Makefile +++ b/tests/test-libraries/libraries/Makefile @@ -1,5 +1,6 @@ TOP=../../.. include $(TOP)/Make.config +include $(TOP)/mk/rules.mk NAMES+=NoneE NoneF UnknownD SomewhatUnknownD SkipInstallNameTool NOPREFIX+=NoLibPrefix @@ -9,19 +10,17 @@ NO_INSTALL_NAME_TOOL_SkipInstallNameTool=1 # a few lookup tables, because the data we have is not always in the format we need it COMMON_ARGS=-g -gdwarf-2 -fms-extensions shared.c -Wall -iphonesimulator_COMPILER_FLAGS=$(COMMON_ARGS) -mios-simulator-version-min=$(MIN_IOS_SDK_VERSION) -isysroot $(SIMULATOR_SDK) -iphoneos_COMPILER_FLAGS=$(COMMON_ARGS) -miphoneos-version-min=$(MIN_IOS_SDK_VERSION) -isysroot $(DEVICE_SDK) -tvsimulator_COMPILER_FLAGS=$(COMMON_ARGS) -mtvos-simulator-version-min=$(MIN_TVOS_SDK_VERSION) -isysroot $(SIMULATORTV_SDK) -tvos_COMPILER_FLAGS=$(COMMON_ARGS) -mtvos-version-min=$(MIN_TVOS_SDK_VERSION) -isysroot $(DEVICETV_SDK) -maccatalyst_COMPILER_FLAGS=$(COMMON_ARGS) $(MACCATALYST_COMMON_CFLAGS) +iphonesimulator_COMPILER_FLAGS=$(COMMON_ARGS) -mios-simulator-version-min=$(MIN_IOS_SDK_VERSION) -isysroot $(iossimulator_SDK) +iphoneos_COMPILER_FLAGS=$(COMMON_ARGS) -miphoneos-version-min=$(MIN_IOS_SDK_VERSION) -isysroot $(ios_SDK) +tvsimulator_COMPILER_FLAGS=$(COMMON_ARGS) -mtvos-simulator-version-min=$(MIN_TVOS_SDK_VERSION) -isysroot $(tvossimulator_SDK) +tvos_COMPILER_FLAGS=$(COMMON_ARGS) -mtvos-version-min=$(MIN_TVOS_SDK_VERSION) -isysroot $(tvos_SDK) +maccatalyst_COMPILER_FLAGS=$(COMMON_ARGS) $(maccatalyst_CFLAGS) mac_COMPILER_FLAGS=$(COMMON_ARGS) -mmacosx-version-min=$(MIN_OSX_VERSION_FOR_MAC) -isysroot $(XCODE_DEVELOPER_ROOT)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX$(OSX_SDK_VERSION).sdk -maccatalyst-x64_COMPILER_FLAGS=$(MACCATALYST_X86_64_CFLAGS) -maccatalyst-arm64_COMPILER_FLAGS=$(MACCATALYST_ARM64_CFLAGS) +maccatalyst-x64_COMPILER_FLAGS=$(maccatalyst-x64_CFLAGS) +maccatalyst-arm64_COMPILER_FLAGS=$(maccatalyst-arm64_CFLAGS) iossimulator-x64_ARCHITECTURES=x86_64 -iossimulator-x86_ARCHITECTURES=i386 -ios-arm_ARCHITECTURES=armv7 armv7s ios-arm64_ARCHITECTURES=arm64 tvossimulator-x64_ARCHITECTURES=x86_64 tvos-arm64_ARCHITECTURES=arm64 @@ -44,13 +43,13 @@ $(3)_TARGETS += \ all-local:: $$($(3)_TARGETS) .libs/$(3)/$(4)$(1).dylib: shared.c | .libs/$(3) - $$(call Q_2,CC, [$(3)]) $$(XCODE_CC) -o $$@ $$(foreach arch,$$($(3)_ARCHITECTURES),-arch $$(arch)) $$($(2)_COMPILER_FLAGS) $$($(3)_COMPILER_FLAGS) -DNAME=$(1) -shared -framework Foundation -lz + $$(call Q_2,CC, [$(3)]) $$(CLANG) -o $$@ $$(foreach arch,$$($(3)_ARCHITECTURES),-arch $$(arch)) $$($(2)_COMPILER_FLAGS) $$($(3)_COMPILER_FLAGS) -DNAME=$(1) -shared -framework Foundation -lz ifneq ($(NO_INSTALL_NAME_TOOL_$(1)),1) $$(Q) $(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool -id @rpath/$(4)$(1).dylib $$@ endif .libs/$(3)/$(4)$(1).o: shared.c | .libs/$(3) - $$(call Q_2,CC, [$(3)]) $$(XCODE_CC) -o $$@ $$(foreach arch,$$($(3)_ARCHITECTURES),-arch $$(arch)) $$($(2)_COMPILER_FLAGS) $$($(3)_COMPILER_FLAGS) -DNAME=$(1) -c + $$(call Q_2,CC, [$(3)]) $$(CLANG) -o $$@ $$(foreach arch,$$($(3)_ARCHITECTURES),-arch $$(arch)) $$($(2)_COMPILER_FLAGS) $$($(3)_COMPILER_FLAGS) -DNAME=$(1) -c ifneq ($(NO_INSTALL_NAME_TOOL_$(1)),1) $$(Q) $(XCODE_DEVELOPER_ROOT)/Toolchains/XcodeDefault.xctoolchain/usr/bin/install_name_tool -id @rpath/$(4)$(1).dylib $$@ endif @@ -71,6 +70,3 @@ endef # 3: runtime identifier $(foreach name,$(NAMES),$(foreach platform,$(DOTNET_PLATFORMS),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(eval $(call DotNetTemplate,$(name),$(DOTNET_$(rid)_SDK_PLATFORM),$(rid),lib))))) $(foreach name,$(NOPREFIX),$(foreach platform,$(DOTNET_PLATFORMS),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(eval $(call DotNetTemplate,$(name),$(DOTNET_$(rid)_SDK_PLATFORM),$(rid)))))) - -$(foreach platform,$(DOTNET_PLATFORMS),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),.libs/$(rid))): - $(Q) mkdir -p $@ diff --git a/tests/test-libraries/libtest-ar.m b/tests/test-libraries/libtest-ar.m new file mode 100644 index 00000000000..c2b6ec57d3a --- /dev/null +++ b/tests/test-libraries/libtest-ar.m @@ -0,0 +1,5 @@ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnullability-completeness" + +#define PREFIX 2 +#include "libtest.m" diff --git a/tests/test-libraries/libtest-object.m b/tests/test-libraries/libtest-object.m new file mode 100644 index 00000000000..d60e55867e4 --- /dev/null +++ b/tests/test-libraries/libtest-object.m @@ -0,0 +1,5 @@ +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wnullability-completeness" + +#define PREFIX 1 +#include "libtest.m" diff --git a/tests/test-libraries/nugets/DynamicLibrariesInRuntimesNativeDirectory/DynamicLibrariesInRuntimesNativeDirectory.csproj b/tests/test-libraries/nugets/DynamicLibrariesInRuntimesNativeDirectory/DynamicLibrariesInRuntimesNativeDirectory.csproj index b89a52fa78d..dacde216b49 100644 --- a/tests/test-libraries/nugets/DynamicLibrariesInRuntimesNativeDirectory/DynamicLibrariesInRuntimesNativeDirectory.csproj +++ b/tests/test-libraries/nugets/DynamicLibrariesInRuntimesNativeDirectory/DynamicLibrariesInRuntimesNativeDirectory.csproj @@ -25,48 +25,48 @@ - + PreserveNewest true - runtimes/osx-x64/native/libtest.dylib + runtimes/osx-x64/native/libframework.dylib - + PreserveNewest true - runtimes/osx-arm64/native/libtest.dylib + runtimes/osx-arm64/native/libframework.dylib - + PreserveNewest true - runtimes/maccatalyst-x64/native/libtest.dylib + runtimes/maccatalyst-x64/native/libframework.dylib - + PreserveNewest true - runtimes/maccatalyst-arm64/native/libtest.dylib + runtimes/maccatalyst-arm64/native/libframework.dylib - + PreserveNewest true - bin/osx-x64/libtest.dylib + bin/osx-x64/libframework.dylib - + PreserveNewest true - bin/osx-arm64/libtest.dylib + bin/osx-arm64/libframework.dylib - + PreserveNewest true - bin/maccatalyst-x64/libtest.dylib + bin/maccatalyst-x64/libframework.dylib - + PreserveNewest true - bin/maccatalyst-arm64/libtest.dylib + bin/maccatalyst-arm64/libframework.dylib - + PreserveNewest true bin/maccatalyst-arm64/libtest2.dylib diff --git a/tests/test-libraries/nugets/DynamicLibrariesInRuntimesNativeDirectory/Xamarin.Tests.DynamicLibrariesInRuntimesNativeDirectory.targets b/tests/test-libraries/nugets/DynamicLibrariesInRuntimesNativeDirectory/Xamarin.Tests.DynamicLibrariesInRuntimesNativeDirectory.targets index 837d26bd973..ef3b041f5d6 100644 --- a/tests/test-libraries/nugets/DynamicLibrariesInRuntimesNativeDirectory/Xamarin.Tests.DynamicLibrariesInRuntimesNativeDirectory.targets +++ b/tests/test-libraries/nugets/DynamicLibrariesInRuntimesNativeDirectory/Xamarin.Tests.DynamicLibrariesInRuntimesNativeDirectory.targets @@ -1,13 +1,13 @@ - + false $(OutputDirectory)\subdir\%(FileName)%(Extension) PreserveNewest PreserveNewest Included - + false $(OutputDirectory)\subdir\%(FileName).so PreserveNewest diff --git a/tests/test-libraries/SwiftTest-Info-iphoneos.plist b/tests/test-libraries/plists/SwiftTest-Info-ios-arm64.plist similarity index 100% rename from tests/test-libraries/SwiftTest-Info-iphoneos.plist rename to tests/test-libraries/plists/SwiftTest-Info-ios-arm64.plist diff --git a/tests/test-libraries/SwiftTest-Info-iphonesimulator.plist b/tests/test-libraries/plists/SwiftTest-Info-iossimulator-arm64.plist similarity index 100% rename from tests/test-libraries/SwiftTest-Info-iphonesimulator.plist rename to tests/test-libraries/plists/SwiftTest-Info-iossimulator-arm64.plist diff --git a/tests/test-libraries/plists/SwiftTest-Info-iossimulator-x64.plist b/tests/test-libraries/plists/SwiftTest-Info-iossimulator-x64.plist new file mode 100644 index 00000000000..d6ec76f0fe2 --- /dev/null +++ b/tests/test-libraries/plists/SwiftTest-Info-iossimulator-x64.plist @@ -0,0 +1,57 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleIdentifier + xamarin.ios.swifttest + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + SwiftTest + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 3.12 + NSPrincipalClass + + CFBundleExecutable + SwiftTest + BuildMachineOSBuild + 13F34 + CFBundleDevelopmentRegion + en + CFBundleSupportedPlatforms + + iPhoneOS + + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 12D508 + DTPlatformName + iphoneos + DTPlatformVersion + 8.2 + DTSDKBuild + 12D508 + DTSDKName + iphoneos8.2 + DTXcode + 0620 + DTXcodeBuild + 6C131e + MinimumOSVersion + 12.2 + UIDeviceFamily + + 1 + 2 + + + diff --git a/tests/test-libraries/SwiftTest-Info-maccatalyst.plist b/tests/test-libraries/plists/SwiftTest-Info-maccatalyst-arm64.plist similarity index 100% rename from tests/test-libraries/SwiftTest-Info-maccatalyst.plist rename to tests/test-libraries/plists/SwiftTest-Info-maccatalyst-arm64.plist diff --git a/tests/test-libraries/plists/SwiftTest-Info-maccatalyst-x64.plist b/tests/test-libraries/plists/SwiftTest-Info-maccatalyst-x64.plist new file mode 100644 index 00000000000..eaa51a731d7 --- /dev/null +++ b/tests/test-libraries/plists/SwiftTest-Info-maccatalyst-x64.plist @@ -0,0 +1,48 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleIdentifier + xamarin.ios.swifttest + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + SwiftTest + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 3.12 + NSPrincipalClass + + CFBundleExecutable + SwiftTest + BuildMachineOSBuild + 13F34 + CFBundleDevelopmentRegion + en + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 12D508 + DTPlatformName + macosx + DTPlatformVersion + 10.15 + DTSDKBuild + 12D508 + DTSDKName + macosx10.15 + DTXcode + 0620 + DTXcodeBuild + 6C131e + LSMinimumSystemVersion + 12.0 + + diff --git a/tests/test-libraries/SwiftTest-Info-macos.plist b/tests/test-libraries/plists/SwiftTest-Info-osx-arm64.plist similarity index 100% rename from tests/test-libraries/SwiftTest-Info-macos.plist rename to tests/test-libraries/plists/SwiftTest-Info-osx-arm64.plist diff --git a/tests/test-libraries/plists/SwiftTest-Info-osx-x64.plist b/tests/test-libraries/plists/SwiftTest-Info-osx-x64.plist new file mode 100644 index 00000000000..ac20a955698 --- /dev/null +++ b/tests/test-libraries/plists/SwiftTest-Info-osx-x64.plist @@ -0,0 +1,48 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleIdentifier + xamarin.ios.swifttest + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + SwiftTest + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 3.12 + NSPrincipalClass + + CFBundleExecutable + SwiftTest + BuildMachineOSBuild + 13F34 + CFBundleDevelopmentRegion + en + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 12D508 + DTPlatformName + macosx + DTPlatformVersion + 10.9 + DTSDKBuild + 12D508 + DTSDKName + macosx10.9 + DTXcode + 0620 + DTXcodeBuild + 6C131e + LSMinimumSystemVersion + 12.0 + + diff --git a/tests/test-libraries/SwiftTest-Info-tvos.plist b/tests/test-libraries/plists/SwiftTest-Info-tvos-arm64.plist similarity index 100% rename from tests/test-libraries/SwiftTest-Info-tvos.plist rename to tests/test-libraries/plists/SwiftTest-Info-tvos-arm64.plist diff --git a/tests/test-libraries/SwiftTest-Info-tvsimulator.plist b/tests/test-libraries/plists/SwiftTest-Info-tvossimulator-arm64.plist similarity index 100% rename from tests/test-libraries/SwiftTest-Info-tvsimulator.plist rename to tests/test-libraries/plists/SwiftTest-Info-tvossimulator-arm64.plist diff --git a/tests/test-libraries/plists/SwiftTest-Info-tvossimulator-x64.plist b/tests/test-libraries/plists/SwiftTest-Info-tvossimulator-x64.plist new file mode 100644 index 00000000000..77d16103123 --- /dev/null +++ b/tests/test-libraries/plists/SwiftTest-Info-tvossimulator-x64.plist @@ -0,0 +1,56 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleIdentifier + xamarin.ios.swifttest + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + SwiftTest + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 3.12 + NSPrincipalClass + + CFBundleExecutable + SwiftTest + BuildMachineOSBuild + 13F34 + CFBundleDevelopmentRegion + en + CFBundleSupportedPlatforms + + AppleTVOS + + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 12D508 + DTPlatformName + appletvos + DTPlatformVersion + 9.0 + DTSDKBuild + 12D508 + DTSDKName + appletvos9.0 + DTXcode + 0620 + DTXcodeBuild + 6C131e + MinimumOSVersion + 12.2 + UIDeviceFamily + + 3 + + + diff --git a/tests/test-libraries/XTest-Info-iphoneos.plist b/tests/test-libraries/plists/XTest-Info-ios-arm64.plist similarity index 100% rename from tests/test-libraries/XTest-Info-iphoneos.plist rename to tests/test-libraries/plists/XTest-Info-ios-arm64.plist diff --git a/tests/test-libraries/XTest-Info-iphonesimulator.plist b/tests/test-libraries/plists/XTest-Info-iossimulator-arm64.plist similarity index 100% rename from tests/test-libraries/XTest-Info-iphonesimulator.plist rename to tests/test-libraries/plists/XTest-Info-iossimulator-arm64.plist diff --git a/tests/test-libraries/plists/XTest-Info-iossimulator-x64.plist b/tests/test-libraries/plists/XTest-Info-iossimulator-x64.plist new file mode 100644 index 00000000000..106435c2473 --- /dev/null +++ b/tests/test-libraries/plists/XTest-Info-iossimulator-x64.plist @@ -0,0 +1,57 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleIdentifier + xamarin.ios.xtest + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + XTest + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 3.12 + NSPrincipalClass + + CFBundleExecutable + XTest + BuildMachineOSBuild + 13F34 + CFBundleDevelopmentRegion + en + CFBundleSupportedPlatforms + + iPhoneOS + + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 12D508 + DTPlatformName + iphoneos + DTPlatformVersion + 8.2 + DTSDKBuild + 12D508 + DTSDKName + iphoneos8.2 + DTXcode + 0620 + DTXcodeBuild + 6C131e + MinimumOSVersion + 12.2 + UIDeviceFamily + + 1 + 2 + + + diff --git a/tests/test-libraries/XTest-Info-maccatalyst.plist b/tests/test-libraries/plists/XTest-Info-maccatalyst-arm64.plist similarity index 100% rename from tests/test-libraries/XTest-Info-maccatalyst.plist rename to tests/test-libraries/plists/XTest-Info-maccatalyst-arm64.plist diff --git a/tests/test-libraries/plists/XTest-Info-maccatalyst-x64.plist b/tests/test-libraries/plists/XTest-Info-maccatalyst-x64.plist new file mode 100644 index 00000000000..42b44f8b858 --- /dev/null +++ b/tests/test-libraries/plists/XTest-Info-maccatalyst-x64.plist @@ -0,0 +1,48 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleIdentifier + xamarin.ios.xtest + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + XTest + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 3.12 + NSPrincipalClass + + CFBundleExecutable + XTest + BuildMachineOSBuild + 13F34 + CFBundleDevelopmentRegion + en + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 12D508 + DTPlatformName + macosx + DTPlatformVersion + 10.15 + DTSDKBuild + 12D508 + DTSDKName + macosx10.15 + DTXcode + 0620 + DTXcodeBuild + 6C131e + LSMinimumSystemVersion + 12.0 + + diff --git a/tests/test-libraries/XTest-Info-macos.plist b/tests/test-libraries/plists/XTest-Info-osx-arm64.plist similarity index 100% rename from tests/test-libraries/XTest-Info-macos.plist rename to tests/test-libraries/plists/XTest-Info-osx-arm64.plist diff --git a/tests/test-libraries/plists/XTest-Info-osx-x64.plist b/tests/test-libraries/plists/XTest-Info-osx-x64.plist new file mode 100644 index 00000000000..96fa47dd3ce --- /dev/null +++ b/tests/test-libraries/plists/XTest-Info-osx-x64.plist @@ -0,0 +1,48 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleIdentifier + xamarin.ios.xtest + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + XTest + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 3.12 + NSPrincipalClass + + CFBundleExecutable + XTest + BuildMachineOSBuild + 13F34 + CFBundleDevelopmentRegion + en + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 12D508 + DTPlatformName + macosx + DTPlatformVersion + 10.9 + DTSDKBuild + 12D508 + DTSDKName + macosx10.9 + DTXcode + 0620 + DTXcodeBuild + 6C131e + LSMinimumSystemVersion + 12.0 + + diff --git a/tests/test-libraries/XTest-Info-tvos.plist b/tests/test-libraries/plists/XTest-Info-tvos-arm64.plist similarity index 100% rename from tests/test-libraries/XTest-Info-tvos.plist rename to tests/test-libraries/plists/XTest-Info-tvos-arm64.plist diff --git a/tests/test-libraries/XTest-Info-tvsimulator.plist b/tests/test-libraries/plists/XTest-Info-tvossimulator-arm64.plist similarity index 100% rename from tests/test-libraries/XTest-Info-tvsimulator.plist rename to tests/test-libraries/plists/XTest-Info-tvossimulator-arm64.plist diff --git a/tests/test-libraries/plists/XTest-Info-tvossimulator-x64.plist b/tests/test-libraries/plists/XTest-Info-tvossimulator-x64.plist new file mode 100644 index 00000000000..e23045757e9 --- /dev/null +++ b/tests/test-libraries/plists/XTest-Info-tvossimulator-x64.plist @@ -0,0 +1,56 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleIdentifier + xamarin.ios.xtest + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + XTest + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 3.12 + NSPrincipalClass + + CFBundleExecutable + XTest + BuildMachineOSBuild + 13F34 + CFBundleDevelopmentRegion + en + CFBundleSupportedPlatforms + + AppleTVOS + + DTCompiler + com.apple.compilers.llvm.clang.1_0 + DTPlatformBuild + 12D508 + DTPlatformName + appletvos + DTPlatformVersion + 9.0 + DTSDKBuild + 12D508 + DTSDKName + appletvos9.0 + DTXcode + 0620 + DTXcodeBuild + 6C131e + MinimumOSVersion + 12.2 + UIDeviceFamily + + 3 + + + diff --git a/tools/devops/automation/templates/tests/run-tests.yml b/tools/devops/automation/templates/tests/run-tests.yml index 8eedd85e96e..ad64a561889 100644 --- a/tools/devops/automation/templates/tests/run-tests.yml +++ b/tools/devops/automation/templates/tests/run-tests.yml @@ -63,8 +63,6 @@ steps: displayName: Set output variables - pwsh: | - Write-Host "##vso[task.setvariable variable=MAC_DESTDIR]/" - Write-Host "##vso[task.setvariable variable=IOS_DESTDIR]/" Write-Host "##vso[task.setvariable variable=TESTS_USE_SYSTEM]true" displayName: Set SDK destination dirs diff --git a/tools/mmp/Makefile b/tools/mmp/Makefile index be210c75849..2f0fd920688 100644 --- a/tools/mmp/Makefile +++ b/tools/mmp/Makefile @@ -1,5 +1,6 @@ TOP=../.. include $(TOP)/Make.config +include $(TOP)/mk/rules.mk export DEVELOPER_DIR=$(XCODE_DEVELOPER_ROOT) @@ -68,10 +69,10 @@ Microsoft.macOS.registrar.coreclr.arm64.m: $(TOP)/src/build/dotnet/macos/64/Micr $(Q) touch $@ $(basename $@).h %.x86_64.a: %.x86_64.m - $(Q_CC) $(MAC_CC) -DDEBUG -g -gdwarf-2 -x objective-c++ -std=c++14 -o $@ -c -arch x86_64 $< -Wall -Wno-unguarded-availability-new -I$(TOP)/runtime -mmacosx-version-min=$(MIN_MACOS_SDK_VERSION) -fobjc-runtime=macosx $(EXTRA_DEFINES) + $(Q_CC) $(CLANG) -isysroot $(macos_SDK) -DDEBUG -g -gdwarf-2 -x objective-c++ -std=c++14 -o $@ -c -arch x86_64 $< -Wall -Wno-unguarded-availability-new -I$(TOP)/runtime -mmacosx-version-min=$(MIN_MACOS_SDK_VERSION) -fobjc-runtime=macosx $(EXTRA_DEFINES) %.arm64.a: %.arm64.m - $(Q_CC) $(MAC_CC) -DDEBUG -g -gdwarf-2 -x objective-c++ -std=c++14 -o $@ -c -arch arm64 $< -Wall -Wno-unguarded-availability-new -I$(TOP)/runtime -mmacosx-version-min=$(MIN_MACOS_SDK_VERSION) -fobjc-runtime=macosx $(EXTRA_DEFINES) + $(Q_CC) $(CLANG) -isysroot $(macos_SDK) -DDEBUG -g -gdwarf-2 -x objective-c++ -std=c++14 -o $@ -c -arch arm64 $< -Wall -Wno-unguarded-availability-new -I$(TOP)/runtime -mmacosx-version-min=$(MIN_MACOS_SDK_VERSION) -fobjc-runtime=macosx $(EXTRA_DEFINES) dotnet: $(MMP_TARGETS_DOTNET) ifdef INCLUDE_MAC @@ -82,5 +83,4 @@ endif clean-local:: rm -rf bin obj -include $(TOP)/mk/rules.mk include ../common/Make.common diff --git a/tools/mtouch/Makefile b/tools/mtouch/Makefile index 6ee9d92a7a9..ebde0cf10fe 100644 --- a/tools/mtouch/Makefile +++ b/tools/mtouch/Makefile @@ -1,5 +1,6 @@ TOP=../.. include $(TOP)/Make.config +include $(TOP)/mk/rules.mk # without this many compiler warnings about unused functions and variables # in system headers show up. @@ -38,16 +39,16 @@ define RunRegistrar $$(Q) touch $$(basename $$@).m $$(basename $$@).h .libs/Microsoft.$(9).registrar.$(10).a: .libs/Microsoft.$(9).registrar.$(10).m .libs/Microsoft.$(9).registrar.$(10).h | .libs - $$(Q_CC) $$(IOS_CC) -DDEBUG -g -gdwarf-2 $(6) -stdlib=libc++ -std=c++14 -x objective-c++ -o $$@ -c $$< -Wall -Wno-unguarded-availability-new -I$(TOP)/runtime + $$(Q_CC) $$(CLANG) -DDEBUG -g -gdwarf-2 $(6) -stdlib=libc++ -std=c++14 -x objective-c++ -o $$@ -c $$< -Wall -Wno-unguarded-availability-new -I$(TOP)/runtime endef -$(eval $(call RunRegistrar,ios,x86_64,64,$(IOS_SDK_VERSION),iOS,$(SIMULATOR64_CFLAGS),,,iOS,iossimulator-x64)) -$(eval $(call RunRegistrar,ios,arm64,64,$(IOS_SDK_VERSION),iOS,$(SIMULATOR_ARM64_CFLAGS),,,iOS,iossimulator-arm64)) -$(eval $(call RunRegistrar,ios,arm64,64,$(IOS_SDK_VERSION),iOS,$(DEVICE64_CFLAGS),,,iOS,ios-arm64)) -$(eval $(call RunRegistrar,tvos,x86_64,64,$(TVOS_SDK_VERSION),TVOS,$(SIMULATORTV_CFLAGS),,,tvOS,tvossimulator-x64)) -$(eval $(call RunRegistrar,tvos,arm64,64,$(TVOS_SDK_VERSION),TVOS,$(SIMULATORTV_ARM64_CFLAGS),,,tvOS,tvossimulator-arm64)) -$(eval $(call RunRegistrar,tvos,arm64,64,$(TVOS_SDK_VERSION),TVOS,$(DEVICETV_CFLAGS),,,tvOS,tvos-arm64)) -$(eval $(call RunRegistrar,maccatalyst,x86_64,64,$(MACCATALYST_SDK_VERSION),MacCatalyst,$(MACCATALYST_X86_64_CFLAGS),,,MacCatalyst,maccatalyst-x64)) -$(eval $(call RunRegistrar,maccatalyst,arm64,64,$(MACCATALYST_SDK_VERSION),MacCatalyst,$(MACCATALYST_ARM64_CFLAGS),,,MacCatalyst,maccatalyst-arm64)) +$(eval $(call RunRegistrar,ios,x86_64,64,$(IOS_SDK_VERSION),iOS,$(iossimulator-x64_CFLAGS),,,iOS,iossimulator-x64)) +$(eval $(call RunRegistrar,ios,arm64,64,$(IOS_SDK_VERSION),iOS,$(iossimulator-arm64_CFLAGS),,,iOS,iossimulator-arm64)) +$(eval $(call RunRegistrar,ios,arm64,64,$(IOS_SDK_VERSION),iOS,$(ios-arm64_CFLAGS),,,iOS,ios-arm64)) +$(eval $(call RunRegistrar,tvos,x86_64,64,$(TVOS_SDK_VERSION),TVOS,$(tvossimulator-x64_CFLAGS),,,tvOS,tvossimulator-x64)) +$(eval $(call RunRegistrar,tvos,arm64,64,$(TVOS_SDK_VERSION),TVOS,$(tvossimulator-arm64_CFLAGS),,,tvOS,tvossimulator-arm64)) +$(eval $(call RunRegistrar,tvos,arm64,64,$(TVOS_SDK_VERSION),TVOS,$(tvos-arm64_CFLAGS),,,tvOS,tvos-arm64)) +$(eval $(call RunRegistrar,maccatalyst,x86_64,64,$(MACCATALYST_SDK_VERSION),MacCatalyst,$(maccatalyst-x64_CFLAGS),,,MacCatalyst,maccatalyst-x64)) +$(eval $(call RunRegistrar,maccatalyst,arm64,64,$(MACCATALYST_SDK_VERSION),MacCatalyst,$(maccatalyst-arm64_CFLAGS),,,MacCatalyst,maccatalyst-arm64)) TARGETS_DOTNET = \ $(foreach platform,$(DOTNET_PLATFORMS_MTOUCH),$(foreach rid,$(DOTNET_$(platform)_RUNTIME_IDENTIFIERS),$(DOTNET_DESTDIR)/$($(rid)_NUGET_RUNTIME_NAME)/runtimes/$(rid)/native/Microsoft.$(platform).registrar.a)) \ @@ -93,5 +94,4 @@ verify-sorted-resx: clean-dotnet: rm -f $(TARGETS_DOTNET) -include $(TOP)/mk/rules.mk include ../common/Make.common