diff --git a/Makefile b/Makefile index 39c0bc11..ccf14c9d 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ BUILD_DIR ?= out UNAME_S := $(shell uname -s) UNAME_M := $(shell uname -m) ifeq ($(UNAME_S),Darwin) -BUILD_TYPES := macosdebug macosrelease iosdebug iosrelease +BUILD_TYPES := macosdebug macosrelease iosdebug iosrelease iossimdebug iossimrelease else BUILD_TYPES := debug release windebug winrelease androiddebug androidrelease androiddebug-x86 androidrelease-x86 androiddebug-x86_64 androidrelease-x86_64 androiddebug-armv7a androidrelease-armv7a endif @@ -62,11 +62,15 @@ MACOS_TARGETS := \ IOS_TARGETS := \ out/iosdebug/tildefriends \ out/iosrelease/tildefriends +IOSSIM_TARGETS := \ + out/iossimdebug/tildefriends \ + out/iossimrelease/tildefriends DEBUG_TARGETS := \ out/debug/tildefriends \ out/windebug/tildefriends.exe \ out/iosdebug/tildefriends \ + out/iossimdebug/tildefriends \ out/macosdebug/tildefriends \ out/androiddebug/tildefriends \ out/androiddebug-armv7a/tildefriends \ @@ -76,6 +80,7 @@ RELEASE_TARGETS := \ out/release/tildefriends \ out/winrelease/tildefriends.exe \ out/iosrelease/tildefriends \ + out/iossimrelease/tildefriends \ out/macosrelease/tildefriends \ out/androidrelease/tildefriends \ out/androidrelease-armv7a/tildefriends \ @@ -84,7 +89,7 @@ RELEASE_TARGETS := \ ANDROID_RELEASE_TARGETS := $(filter-out $(DEBUG_TARGETS),$(ANDROID_TARGETS)) NONANDROID_RELEASE_TARGETS := $(filter-out $(ANDROID_ARM64_TARGETS),$(RELEASE_TARGETS)) NONANDROID_TARGETS := $(filter-out $(ANDROID_TARGETS),$(DEBUG_TARGETS) $(RELEASE_TARGETS)) -NONMACOS_TARGETS := $(filter-out $(MACOS_TARGETS) $(IOS_TARGETS),$(DEBUG_TARGETS) $(RELEASE_TARGETS)) +NONMACOS_TARGETS := $(filter-out $(MACOS_TARGETS) $(IOS_TARGETS) $(IOSSIM_TARGETS),$(DEBUG_TARGETS) $(RELEASE_TARGETS)) $(NONANDROID_TARGETS): CFLAGS += -fno-omit-frame-pointer $(filter-out $(ANDROID_TARGETS) $(WINDOWS_TARGETS),$(DEBUG_TARGETS) $(RELEASE_TARGETS)): LDFLAGS += -rdynamic @@ -115,6 +120,8 @@ ifeq ($(UNAME_S),Darwin) $(MACOS_TARGETS): CC = xcrun clang $(IOS_TARGETS): IOS_SYSROOT := $(shell xcrun --sdk iphoneos --show-sdk-path) $(IOS_TARGETS): CC = xcrun --sdk iphoneos clang -isysroot $(IOS_SYSROOT) -arch arm64 +$(IOSSIM_TARGETS): IOSSIM_SYSROOT := $(shell xcrun --sdk iphonesimulator --show-sdk-path) +$(IOSSIM_TARGETS): CC = xcrun --sdk iphonesimulator clang -isysroot $(IOSSIM_SYSROOT) -arch x86_64 endif $(ANDROID_X86_64_TARGETS): ANDROID_NDK_TARGET_TRIPLE := x86_64-linux-android $(ANDROID_X86_TARGETS): ANDROID_NDK_TARGET_TRIPLE := i686-linux-android @@ -138,6 +145,8 @@ $(NONMACOS_TARGETS): CFLAGS += -Wno-cast-function-type $(NONMACOS_TARGETS): LDFLAGS += -Wl,--gc-sections $(IOS_TARGETS): CFLAGS += -Ideps/openssl/ios/ios64-xcrun/usr/local/include $(IOS_TARGETS): LDFLAGS += -Ldeps/openssl/ios/ios64-xcrun/usr/local/lib +$(IOSSIM_TARGETS): CFLAGS += -Ideps/openssl/ios/iossimulator-xcrun/usr/local/include +$(IOSSIM_TARGETS): LDFLAGS += -Ldeps/openssl/ios/iossimulator-xcrun/usr/local/lib ifeq ($(UNAME_M),x86_64) debug: CFLAGS += -fsanitize=address -fsanitize=undefined -fno-common @@ -150,7 +159,7 @@ get_objs = \ $(foreach build_type,windebug winrelease,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_win))))) \ $(foreach build_type,androiddebug androidrelease androiddebug-x86 androidrelease-x86 androiddebug-x86_64 androidrelease-x86_64 androiddebug-armv7a androiddebug-armv7a,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_android))))) \ $(foreach build_type,androiddebug androidrelease androiddebug-x86 androidrelease-x86 androiddebug-x86_64 androidrelease-x86_64 androiddebug-armv7a androidrelease-armv7a,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_unix))))) \ - $(foreach build_type,macosdebug macosrelease iosdebug iosrelease,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_macos))))) \ + $(foreach build_type,macosdebug macosrelease iosdebug iosrelease iossimdebug iossimrelease,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_macos))))) \ $(foreach build_type,androiddebug-x86 androidrelease-x86,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_x86))))) APP_SOURCES := $(wildcard src/*.c) @@ -474,7 +483,7 @@ $(MINIUNZIP_OBJS): CFLAGS += \ LDFLAGS += \ -pthread \ -lm -debug release $(MACOS_TARGETS) $(IOS_TARGETS): LDFLAGS += \ +debug release $(MACOS_TARGETS) $(IOS_TARGETS) $(IOSSIM_TARGETS): LDFLAGS += \ -ldl \ -lssl \ -lcrypto diff --git a/tools/ssl-ios b/tools/ssl-ios index 43352425..ca0542c0 100755 --- a/tools/ssl-ios +++ b/tools/ssl-ios @@ -6,7 +6,7 @@ API_LEVEL=28 BUILD_DIR=out/openssl_ios_build -BUILD_TARGETS="ios64-xcrun" +BUILD_TARGETS="ios64-xcrun iossimulator-xcrun" rm -rfv openssl-${OPENSSL_VERSION} @@ -47,6 +47,13 @@ do SSL_TARGET="ios64-xcrun" CC=clang ;; + iossimulator-xcrun) + TRIBLE="x86_64-darwin-ios" + OPTIONS="--static -static -ffunction-sections -fdata-sections -fPIC -Wno-macro-redefined" + DESTDIR="/tmp/$BUILD_DIR/x86_64-iossim" + SSL_TARGET="iossimulator-xcrun" + CC=clang + ;; esac rm -rf $DESTDIR