Unverified Commit 10d64cc6 authored by Rob Loach's avatar Rob Loach Committed by GitHub
Browse files

Merge pull request #383 from jet082/ios

ios support
parents c7f2fb3a 023b2050
......@@ -4,6 +4,11 @@ All notable changes to [ChaiLove](https://github.com/RobLoach/ChaiLove) will be
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## 1.1.x - xxxx-xx-xx
### Fixes
- iOS compilation
## 1.0.0 - 2019-08-23
### Chores
- Updated dependencies
......
......@@ -102,14 +102,16 @@ else ifneq (,$(findstring ios,$(platform)))
IOSSDK := $(shell xcodebuild -version -sdk iphoneos Path)
endif
ifeq ($(platform),ios-arm64)
CC = cc -arch arm64 -isysroot $(IOSSDK)
CC = cc -arch arm64 -isysroot -DHAVE_POSIX_MEMALIGN $(IOSSDK)
CFLAGS += -DDONT_WANT_ARM_OPTIMIZATIONS
HAVE_NEON = 0
else
CC = cc -arch armv7 -isysroot $(IOSSDK)
CC = cc -arch armv7 -isysroot $(IOSSDK)
endif
CFLAGS += -DIOS
ifeq ($(platform),$(filter $(platform),ios9 ios-arm64))
CC += -miphoneos-version-min=8.0
CFLAGS += -miphoneos-version-min=8.0
CC += -miphoneos-version-min=8.0 -DHAVE_POSIX_MEMALIGN
CFLAGS += -miphoneos-version-min=8.0 -DHAVE_POSIX_MEMALIGN
else
CC += -miphoneos-version-min=5.0
CFLAGS += -miphoneos-version-min=5.0
......@@ -299,8 +301,8 @@ else ifeq ($(platform), libnx)
# Platform affix = classic_<ISA>_<µARCH>
# Help at https://modmyclassic.com/comp
# (armv7 a7, hard point, neon based) ###
# NESC, SNESC, C64 mini
# (armv7 a7, hard point, neon based) ###
# NESC, SNESC, C64 mini
else ifeq ($(platform), classic_armv7_a7)
TARGET := $(TARGET_NAME)_libretro.so
fpic := -fPIC
......@@ -611,6 +613,13 @@ else
endif
endif
ifeq ($(platform), ios-arm64)
LDFLAGS += -framework IOKit -framework Foundation
FLAGS += -D__MACH__ -D__APPLE__ -DPHYSFS_PLATFORM_APPLE
FLAGS += -DCHAILOVE_DISABLE_LOVE_SYSTEM_EXECUTE
SOURCES_M += $(CORE_DIR)/vendor/didstopia-physfs/src/physfs_platform_apple.m
endif
ifeq ($(EXTERNAL_ZLIB), 1)
CFLAGS += -DHAVE_EXTERNAL_ZLIB
endif
......
......@@ -106,6 +106,10 @@ std::string system::getUsername() {
}
bool system::execute(const std::string& command) {
#ifdef CHAILOVE_DISABLE_LOVE_SYSTEM_EXECUTE
std::cout << "[ChaiLove] [system] love.system.execute() is disabled." << std::endl;
return false;
#else
std::cout << "[ChaiLove] [system] love.system.execute(\"" << command << "\")" << std::endl;
int result = std::system(command.c_str());
if (result != 0) {
......@@ -114,6 +118,7 @@ bool system::execute(const std::string& command) {
}
std::cout << "[ChaiLove] [system] Finished " << command << std::endl;
return true;
#endif
}
std::string system::getClipboardText() {
......
......@@ -8,7 +8,7 @@ assert_equal(version[1], '.', "love.system.getVersionString()")
// getVersion()
var versionNumber = love.system.getVersion()
assert_equal(versionNumber[0], 0, "love.system.getVersion()")
assert_equal(versionNumber[0], 1, "love.system.getVersion()")
// getUsername()
var username = love.system.getUsername()
......
Subproject commit f88c23f5c64bed490b3e61d582f4c20cf3925ed1
Subproject commit 68d1fd0b325ca5e4288f7189b2ec41898edca84a
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment