Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
dsrw committed Jun 28, 2024
1 parent 5a4aac6 commit 2ba399a
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 15 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ vendor/pcre
*.so
*.dylib
*.dll
*.a
bin/
scratch/
tools/build_helpers
Expand Down
6 changes: 3 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
url = https://github.com/dsrw/godot.git
branch = enu
ignore = untracked
[submodule "vendor/pcre2"]
path = vendor/pcre2
url = https://github.com/PhilipHazel/pcre2.git
[submodule "vendor/pcre"]
path = vendor/pcre
url = https://github.com/luvit/pcre
Binary file removed app/libenu.a
Binary file not shown.
1 change: 0 additions & 1 deletion enu.nimble
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ requires "nim >= 2.0.2",
"https://github.com/dsrw/model_citizen 0.19.2",
"https://github.com/dsrw/nanoid.nim 0.2.1", "cligen 1.6.17",
"https://github.com/treeform/pretty",
"https://github.com/theAkito/xxnimterop",
"chroma", "markdown", "chronicles", "dotenv", "nimibook", "metrics#51f1227",
"zippy"

Expand Down
4 changes: 0 additions & 4 deletions ios.sh

This file was deleted.

8 changes: 4 additions & 4 deletions src/config.nims
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ if defined(release):

# --passC:"-I/opt/homebrew/include"

--define:usePcreHeader
--passC:"-Ivendor/pcre"

if project_name() == "enu":
if host_os == "ios":
--define:use_pcre_header
--define:"chronicles_colors=None"
--passC:"-Ivendor/pcre -miphoneos-version-min=12.0 --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -mcpu=apple-a10"
--passL:"-target aarch64-ios --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk"
--app:staticlib
else:
--app:lib
--passL:"-Lvendor/pcre/.libs -lpcre"
--no_main
else:
--define:
Expand Down
7 changes: 6 additions & 1 deletion src/controllers/script_controllers/host_bridge_utils.nim
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,12 @@ macro bridged_from_vm(
result.add quote do:
mixin implement_routine
debug "implementing routine", name = `proc_name`
`self`.interpreter.implement_routine "*",
const pkg_name =
when host_os == "ios":
"unknown"
else:
"enu"
`self`.interpreter.implement_routine pkg_name,
`module_name`,
`proc_impl_name`,
proc(a {.inject.}: VmArgs) {.gcsafe.} =
Expand Down
2 changes: 0 additions & 2 deletions src/libs/eval.nim
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,6 @@ proc loadModule*(
if iface.module != nil and iface.module.name.s == moduleName and
fileName == toFullPath(i.graph.config, iface.module.info):
module = iface.module
print "@@@@module ", iface.module.info
discard posix.raise SIGINT
break

if module.isNil:
Expand Down
17 changes: 17 additions & 0 deletions tools/build_ios.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
set -e

export SDK=$(xcrun --sdk iphoneos --show-sdk-path)
export CC=$(xcrun --sdk iphoneos -f clang)
export CFLAGS="-arch arm64 -isysroot $SDK -mios-version-min=12.0"
export LDFLAGS="-arch arm64 -isysroot $SDK"

cd "$(dirname "$0")/../vendor/pcre"
./configure --disable-shared --disable-cpp --enable-unicode-properties --enable-pcre16 --enable-pcre32 --host=arm-apple-darwin
make

cd ../..

nim c --os:ios --debugger:native -o:libenu.a src/enu.nim

libtool -static -o app/libenu.a libenu.a vendor/pcre/.libs/libpcre.a
1 change: 1 addition & 0 deletions vendor/pcre
Submodule pcre added at 5c78f7

0 comments on commit 2ba399a

Please sign in to comment.