Now it builds for ios with some objective-c.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@4518 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
Cory McWilliams 2023-10-14 02:11:20 +00:00
parent a57916b3db
commit 84eaa3e2fd
2 changed files with 20 additions and 2 deletions

View File

@ -160,9 +160,11 @@ get_objs = \
$(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 iossimdebug iossimrelease,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_macos))))) \
$(foreach build_type,iosdebug iosrelease iossimdebug iossimrelease,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_ios))))) \
$(foreach build_type,androiddebug-x86 androidrelease-x86,$(addprefix $(BUILD_DIR)/$(build_type)/,$(addsuffix .o,$(basename $(value $(1)_x86)))))
APP_SOURCES := $(wildcard src/*.c)
APP_SOURCES_ios := $(wildcard src/*.m)
APP_OBJS := $(call get_objs,APP_SOURCES)
$(APP_OBJS): CFLAGS += \
-Ideps/base64c/include \
@ -505,6 +507,11 @@ $(ANDROID_TARGETS): LDFLAGS += \
-llog \
-lssl \
-lcrypto
$(IOS_TARGETS) $(IOSSIM_TARGETS): LDFLAGS += \
-framework Foundation \
-framework CoreFoundation \
-framework UIKit \
-framework WebKit
unix: debug release
win: windebug winrelease
@ -542,6 +549,11 @@ $(BUILD_DIR)/$(1)/%.o: %.c
@echo [c] $$@
@$$(CC) $$(CFLAGS) -c $$< -o $$@
$(BUILD_DIR)/$(1)/%.o: %.m
@mkdir -p $$(dir $$@)
@echo [m] $$@
@$$(CC) $$(CFLAGS) -c $$< -o $$@
$(BUILD_DIR)/$(1)/%.o: %.S
@mkdir -p $$(dir $$@)
@echo [as] $$@

View File

@ -22,6 +22,10 @@
#include <sys/resource.h>
#endif
#if defined(__APPLE__)
#include <TargetConditionals.h>
#endif
#if !defined(_WIN32)
#include <unistd.h>
#endif
@ -30,6 +34,9 @@
#define _countof(a) ((int)(sizeof((a)) / sizeof(*(a))))
#endif
struct backtrace_state* g_backtrace_state;
#if !TARGET_OS_IPHONE
#define XOPT_PARSE(name, flags, options, config_ptr, argc, argv, extrac_ptr, extrav_ptr, err_ptr, autohelp_file, autohelp_usage, autohelp_prefix, autohelp_suffix, autohelp_spacer) do { \
xoptContext *_xopt_ctx; \
*(err_ptr) = NULL; \
@ -83,8 +90,6 @@ const command_t k_commands[] = {
const char* k_db_path_default = "db.sqlite";
struct backtrace_state* g_backtrace_state;
void shedPrivileges()
{
#if !defined(_WIN32)
@ -648,3 +653,4 @@ done:
tf_mem_shutdown();
return result;
}
#endif