Skip to content

Commit eb4976c

Browse files
starting first revision of build system for core-ios (turtl/tracker#24). doesnt really work because we are compiling against lipo (fat) libs with cargo-lipo, and probably need to use the lipo tool to individually extract each lib for each target and link against it directly, then manually build our final lipo lib. so it goes.
1 parent f72c8f8 commit eb4976c

File tree

3 files changed

+20
-3
lines changed

3 files changed

+20
-3
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
vars.mk
2+
vars.ios.mk
23
target
34
config.yaml
45
*sess.vim

Makefile

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
.PHONY: all clean release build test test-panic test-st doc macros
22

33
# non-versioned include
4-
-include vars.mk
4+
VARS ?= vars.mk
5+
-include $(VARS)
56

6-
CARGO := $(shell which cargo)
7+
CARGO ?= $(shell which cargo)
78
FEATURES ?= sqlite-static
9+
BUILDCMD ?= build
810
override CARGO_BUILD_ARGS += --features "$(FEATURES)"
911

1012
all: build
1113

1214
build:
13-
cargo build $(CARGO_BUILD_ARGS)
15+
$(CARGO) $(BUILDCMD) $(CARGO_BUILD_ARGS)
1416

1517
release: override CARGO_BUILD_ARGS += --release
1618
release: build

scripts/build-ios.sh

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash
2+
3+
4+
function cleanup() {
5+
git checkout Cargo.toml
6+
}
7+
trap cleanup exit
8+
9+
sed -i '' 's/crate-type = .*/crate-type = ["staticlib"]/g' Cargo.toml
10+
make \
11+
BUILDCMD=lipo \
12+
VARS=vars.ios.mk \
13+
release
14+

0 commit comments

Comments
 (0)