build: There seems to be a way to build for macos from Linux. Neat.
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 24m17s
All checks were successful
Build Tilde Friends / Build-All (push) Successful in 24m17s
This commit is contained in:
parent
fbff3386a9
commit
6f9b548b1a
1
.gitignore
vendored
1
.gitignore
vendored
@ -2,6 +2,7 @@ build/
|
|||||||
*.core
|
*.core
|
||||||
db.*
|
db.*
|
||||||
deps/ios_toolchain/
|
deps/ios_toolchain/
|
||||||
|
deps/macos_toolchain/
|
||||||
deps/openssl/
|
deps/openssl/
|
||||||
dist/
|
dist/
|
||||||
.flatpak-builder
|
.flatpak-builder
|
||||||
|
46
GNUmakefile
46
GNUmakefile
@ -46,6 +46,7 @@ else ifeq ($(UNAME_S),Linux)
|
|||||||
BUILD_TYPES := debug release
|
BUILD_TYPES := debug release
|
||||||
HAVE_ANDROID = $(if $(shell which $(ANDROID_SDK)/platform-tools/adb),1)
|
HAVE_ANDROID = $(if $(shell which $(ANDROID_SDK)/platform-tools/adb),1)
|
||||||
HAVE_LINUX_IOS = $(if $(shell which deps/ios_toolchain/target/bin deps/ios_toolchain/target/bin/arm-apple-darwin11-clang),1)
|
HAVE_LINUX_IOS = $(if $(shell which deps/ios_toolchain/target/bin deps/ios_toolchain/target/bin/arm-apple-darwin11-clang),1)
|
||||||
|
HAVE_LINUX_MACOS = $(if $(shell which deps/macos_toolchain/bin/oa64-clang),1)
|
||||||
HAVE_WIN = $(if $(shell which x86_64-w64-mingw32-gcc-win32),1)
|
HAVE_WIN = $(if $(shell which x86_64-w64-mingw32-gcc-win32),1)
|
||||||
ifneq ($(UNAME_M),aarch64)
|
ifneq ($(UNAME_M),aarch64)
|
||||||
HAVE_CROSS_AARCH64 = $(if $(shell which aarch64-linux-gnu-gcc),1)
|
HAVE_CROSS_AARCH64 = $(if $(shell which aarch64-linux-gnu-gcc),1)
|
||||||
@ -67,13 +68,14 @@ LDFLAGS += \
|
|||||||
-lc++abi
|
-lc++abi
|
||||||
HAVE_ANDROID :=
|
HAVE_ANDROID :=
|
||||||
HAVE_LINUX_IOS :=
|
HAVE_LINUX_IOS :=
|
||||||
|
HAVE_LINUX_MACOS :=
|
||||||
USE_SYSTEM_SSL := 1
|
USE_SYSTEM_SSL := 1
|
||||||
else
|
else
|
||||||
$(error Unexpected host platform $(UNAME_S).)
|
$(error Unexpected host platform $(UNAME_S).)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Everything is set above.
|
# Everything is set above.
|
||||||
$(info Building Tilde Friends $(VERSION_NUMBER) android=$(if $(HAVE_ANDROID),1,0) win=$(if $(HAVE_WIN),1,0) cross_aarch64=$(if $(HAVE_CROSS_AARCH64),1,0) cross_ios=$(if $(HAVE_LINUX_IOS),1,0) system_ssl=$(if $(USE_SYSTEM_SSL),1,0))
|
$(info Building Tilde Friends $(VERSION_NUMBER) android=$(if $(HAVE_ANDROID),1,0) win=$(if $(HAVE_WIN),1,0) cross_aarch64=$(if $(HAVE_CROSS_AARCH64),1,0) cross_ios=$(if $(HAVE_LINUX_IOS),1,0) cross_macos=$(if $(HAVE_LINUX_MACOS),1,0) system_ssl=$(if $(USE_SYSTEM_SSL),1,0))
|
||||||
|
|
||||||
CFLAGS += \
|
CFLAGS += \
|
||||||
-std=gnu11 \
|
-std=gnu11 \
|
||||||
@ -149,6 +151,14 @@ ifeq ($(UNAME_S),Darwin)
|
|||||||
MACOS_TARGETS := \
|
MACOS_TARGETS := \
|
||||||
out/debug/tildefriends \
|
out/debug/tildefriends \
|
||||||
out/release/tildefriends
|
out/release/tildefriends
|
||||||
|
else ifeq ($(UNAME_S),Linux)
|
||||||
|
ifeq ($(HAVE_LINUX_MACOS),1)
|
||||||
|
MACOS_TARGETS := \
|
||||||
|
out/macosdebug/tildefriends \
|
||||||
|
out/macosrelease/tildefriends
|
||||||
|
else
|
||||||
|
MACOS_TARGETS :=
|
||||||
|
endif
|
||||||
else
|
else
|
||||||
MACOS_TARGETS :=
|
MACOS_TARGETS :=
|
||||||
endif
|
endif
|
||||||
@ -165,6 +175,10 @@ ifeq ($(HAVE_LINUX_IOS),1)
|
|||||||
BUILD_TYPES += iosdebug iosrelease
|
BUILD_TYPES += iosdebug iosrelease
|
||||||
all: $(IOS_APPS)
|
all: $(IOS_APPS)
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(HAVE_LINUX_MACOS),1)
|
||||||
|
BUILD_TYPES += macosdebug macosrelease
|
||||||
|
all: $(IOS_APPS)
|
||||||
|
endif
|
||||||
ifeq ($(UNAME_S),Darwin)
|
ifeq ($(UNAME_S),Darwin)
|
||||||
all: $(IOS_APPS) \
|
all: $(IOS_APPS) \
|
||||||
out/tildefriends-iossimdebug.app/tildefriends \
|
out/tildefriends-iossimdebug.app/tildefriends \
|
||||||
@ -183,7 +197,8 @@ DEBUG_TARGETS := \
|
|||||||
out/androiddebug-armv7a/tildefriends \
|
out/androiddebug-armv7a/tildefriends \
|
||||||
out/androiddebug-x86_64/tildefriends \
|
out/androiddebug-x86_64/tildefriends \
|
||||||
out/androiddebug-x86/tildefriends \
|
out/androiddebug-x86/tildefriends \
|
||||||
out/armdebug/tildefriends
|
out/armdebug/tildefriends \
|
||||||
|
out/macosdebug/tildefriends
|
||||||
RELEASE_TARGETS := \
|
RELEASE_TARGETS := \
|
||||||
out/release/tildefriends \
|
out/release/tildefriends \
|
||||||
out/winrelease/tildefriends.exe \
|
out/winrelease/tildefriends.exe \
|
||||||
@ -193,7 +208,8 @@ RELEASE_TARGETS := \
|
|||||||
out/androidrelease-armv7a/tildefriends \
|
out/androidrelease-armv7a/tildefriends \
|
||||||
out/androidrelease-x86_64/tildefriends \
|
out/androidrelease-x86_64/tildefriends \
|
||||||
out/androidrelease-x86/tildefriends \
|
out/androidrelease-x86/tildefriends \
|
||||||
out/armrelease/tildefriends
|
out/armrelease/tildefriends \
|
||||||
|
out/macosrelease/tildefriends
|
||||||
ALL_TARGETS = $(DEBUG_TARGETS) $(RELEASE_TARGETS)
|
ALL_TARGETS = $(DEBUG_TARGETS) $(RELEASE_TARGETS)
|
||||||
ANDROID_RELEASE_TARGETS := $(filter-out $(DEBUG_TARGETS),$(ANDROID_TARGETS))
|
ANDROID_RELEASE_TARGETS := $(filter-out $(DEBUG_TARGETS),$(ANDROID_TARGETS))
|
||||||
NONANDROID_RELEASE_TARGETS := $(filter-out $(ANDROID_ARM64_TARGETS),$(RELEASE_TARGETS))
|
NONANDROID_RELEASE_TARGETS := $(filter-out $(ANDROID_ARM64_TARGETS),$(RELEASE_TARGETS))
|
||||||
@ -247,6 +263,9 @@ else ifeq ($(UNAME_S),Linux)
|
|||||||
$(IOS_TARGETS): CFLAGS += -isysroot deps/ios_toolchain/target/SDKs/iPhoneOS18.2.sdk -arch arm64 -DTARGET_OS_IPHONE=1
|
$(IOS_TARGETS): CFLAGS += -isysroot deps/ios_toolchain/target/SDKs/iPhoneOS18.2.sdk -arch arm64 -DTARGET_OS_IPHONE=1
|
||||||
$(IOS_TARGETS): LDFLAGS += -isysroot deps/ios_toolchain/target/SDKs/iPhoneOS18.2.sdk
|
$(IOS_TARGETS): LDFLAGS += -isysroot deps/ios_toolchain/target/SDKs/iPhoneOS18.2.sdk
|
||||||
$(IOS_TARGETS): CC = PATH=$$PATH:deps/ios_toolchain/target/bin LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:deps/ios_toolchain/target/lib deps/ios_toolchain/target/bin/arm-apple-darwin11-clang
|
$(IOS_TARGETS): CC = PATH=$$PATH:deps/ios_toolchain/target/bin LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:deps/ios_toolchain/target/lib deps/ios_toolchain/target/bin/arm-apple-darwin11-clang
|
||||||
|
$(MACOS_TARGETS): CC = PATH=deps/macos_toolchain/bin:$$PATH deps/macos_toolchain/bin/oa64-clang
|
||||||
|
$(MACOS_TARGETS): CFLAGS += -arch arm64
|
||||||
|
$(MACOS_TARGETS): LDFLAGS += -arch arm64
|
||||||
endif
|
endif
|
||||||
$(ANDROID_X86_64_TARGETS): ANDROID_NDK_TARGET_TRIPLE := x86_64-linux-android
|
$(ANDROID_X86_64_TARGETS): ANDROID_NDK_TARGET_TRIPLE := x86_64-linux-android
|
||||||
$(ANDROID_X86_TARGETS): ANDROID_NDK_TARGET_TRIPLE := i686-linux-android
|
$(ANDROID_X86_TARGETS): ANDROID_NDK_TARGET_TRIPLE := i686-linux-android
|
||||||
@ -277,6 +296,8 @@ $(IOS_TARGETS): LDFLAGS += -Lout/openssl/ios/ios64-xcrun/usr/local/lib
|
|||||||
else
|
else
|
||||||
$(IOS_TARGETS): CFLAGS += -Iout/openssl/$(UNAME_S)/ios64-cross/usr/local/include
|
$(IOS_TARGETS): CFLAGS += -Iout/openssl/$(UNAME_S)/ios64-cross/usr/local/include
|
||||||
$(IOS_TARGETS): LDFLAGS += -Lout/openssl/$(UNAME_S)/ios64-cross/usr/local/lib
|
$(IOS_TARGETS): LDFLAGS += -Lout/openssl/$(UNAME_S)/ios64-cross/usr/local/lib
|
||||||
|
$(MACOS_TARGETS): CFLAGS += -Iout/openssl/$(UNAME_S)/macos/usr/local/include
|
||||||
|
$(MACOS_TARGETS): LDFLAGS += -Lout/openssl/$(UNAME_S)/macos/usr/local/lib
|
||||||
endif
|
endif
|
||||||
$(IOSSIM_TARGETS): CFLAGS += -Iout/openssl/ios/iossimulator-xcrun/usr/local/include
|
$(IOSSIM_TARGETS): CFLAGS += -Iout/openssl/ios/iossimulator-xcrun/usr/local/include
|
||||||
$(IOSSIM_TARGETS): LDFLAGS += -Lout/openssl/ios/iossimulator-xcrun/usr/local/lib
|
$(IOSSIM_TARGETS): LDFLAGS += -Lout/openssl/ios/iossimulator-xcrun/usr/local/lib
|
||||||
@ -304,7 +325,7 @@ get_objs = \
|
|||||||
$(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)_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)_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,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,iosdebug iosrelease iossimdebug iossimrelease,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_ios))))) \
|
$(foreach build_type,iosdebug iosrelease iossimdebug iossimrelease,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_ios))))) \
|
||||||
$(foreach build_type,iosdebug iosrelease iossimdebug iossimrelease,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_macos))))) \
|
$(foreach build_type,iosdebug iosrelease iossimdebug iossimrelease macosdebug macosrelease,$(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))))) \
|
$(foreach build_type,androiddebug-x86 androidrelease-x86,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_x86))))) \
|
||||||
$(if $(findstring Darwin,$(UNAME_S)),$(foreach build_type,debug release,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_macos)))))) \
|
$(if $(findstring Darwin,$(UNAME_S)),$(foreach build_type,debug release,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_macos)))))) \
|
||||||
$(if $(findstring Darwin,$(UNAME_S)),,$(foreach build_type,debug release armdebug armrelease,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_unix))))))
|
$(if $(findstring Darwin,$(UNAME_S)),,$(foreach build_type,debug release armdebug armrelease,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_unix))))))
|
||||||
@ -331,7 +352,7 @@ $(APP_OBJS): CFLAGS += \
|
|||||||
-Werror
|
-Werror
|
||||||
ifneq ($(UNAME_S),Darwin)
|
ifneq ($(UNAME_S),Darwin)
|
||||||
ifeq ($(UNAME_M),x86_64)
|
ifeq ($(UNAME_M),x86_64)
|
||||||
$(filter-out $(BUILD_DIR)/android% $(BUILD_DIR)/ios%,$(APP_OBJS)): CFLAGS += \
|
$(filter-out $(BUILD_DIR)/android% $(BUILD_DIR)/ios% $(BUILD_DIR)/macos%,$(APP_OBJS)): CFLAGS += \
|
||||||
-fanalyzer
|
-fanalyzer
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@ -767,7 +788,7 @@ $(MINIUNZIP_OBJS): CFLAGS += \
|
|||||||
LDFLAGS += \
|
LDFLAGS += \
|
||||||
-pthread \
|
-pthread \
|
||||||
-lm
|
-lm
|
||||||
$(HOST_TARGETS) $(IOS_TARGETS) $(IOSSIM_TARGETS) $(AARCH64_TARGETS): LDFLAGS += \
|
$(HOST_TARGETS) $(IOS_TARGETS) $(IOSSIM_TARGETS) $(AARCH64_TARGETS) $(MACOS_TARGETS): LDFLAGS += \
|
||||||
-lssl \
|
-lssl \
|
||||||
-lcrypto
|
-lcrypto
|
||||||
ifneq ($(UNAME_S),Haiku)
|
ifneq ($(UNAME_S),Haiku)
|
||||||
@ -1180,6 +1201,19 @@ $(LOCAL_DEPS):
|
|||||||
tools/ssl-local
|
tools/ssl-local
|
||||||
$(filter $(BUILD_DIR)/ios%,$(APP_OBJS)): | $(LOCAL_DEPS)
|
$(filter $(BUILD_DIR)/ios%,$(APP_OBJS)): | $(LOCAL_DEPS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifeq ($(HAVE_LINUX_MACOS),1)
|
||||||
|
LOCAL_DEPS := out/openssl/$(UNAME_S)/macos/usr/local/lib/libssl.a
|
||||||
|
$(LOCAL_DEPS):
|
||||||
|
+@PATH=../../deps/macos_toolchain/bin:$$PATH \
|
||||||
|
BUILD_TARGET=macos \
|
||||||
|
SSL_TARGET=darwin64-arm64 \
|
||||||
|
CC=../../deps/macos_toolchain/bin/oa64-clang \
|
||||||
|
RANLIB=../../deps/macos_toolchain/bin/x86_64-apple-darwin24-ranlib \
|
||||||
|
AR=../../deps/macos_toolchain/bin/arm64-apple-darwin24-ar \
|
||||||
|
tools/ssl-local
|
||||||
|
$(filter $(BUILD_DIR)/macos%,$(APP_OBJS)): | $(LOCAL_DEPS)
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(UNAME_S),Darwin)
|
ifeq ($(UNAME_S),Darwin)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user