Cargoify rust-cocoa

This must build on non-mac platform too, since Cargo doesn't have
support for conditional dependencies yet.
This commit is contained in:
Jack Moffitt
2014-08-25 18:26:08 -06:00
parent 0d1ac254b4
commit 55a92e9985
8 changed files with 39 additions and 3 deletions
+2
View File
@@ -9,3 +9,5 @@
*.dummy
cocoa-test
build
/target
/Cargo.lock
+12
View File
@@ -0,0 +1,12 @@
[package]
name = "cocoa"
version = "0.1.0"
authors = ["The Servo Project Developers"]
build = "make -f makefile.msgsend"
[lib]
name = "cocoa"
crate-type = ["rlib"]
+3 -3
View File
@@ -6,16 +6,16 @@ AR ?= ar
RUSTFLAGS ?=
CFLAGS += -Wall
RUST_SRC = $(shell find $(VPATH)/. -type f -name '*.rs')
RUST_SRC = $(shell find $(VPATH)/src -type f -name '*.rs')
.PHONY: all
all: libcocoa.dummy
libcocoa.dummy: cocoa.rc $(RUST_SRC) libmsgsend.a
libcocoa.dummy: src/lib.rs $(RUST_SRC) libmsgsend.a
$(RUSTC) $(RUSTFLAGS) $< --out-dir .
touch $@
cocoa-test: cocoa.rc $(RUST_SRC) libmsgsend.a
cocoa-test: src/lib.rs $(RUST_SRC) libmsgsend.a
$(RUSTC) $(RUSTFLAGS) $< -o $@ --test
libmsgsend.a: msgsend.o
+20
View File
@@ -0,0 +1,20 @@
CC ?= gcc
AR ?= ar
CFLAGS += -Wall
.PHONY : all
ifeq (darwin,$(findstring darwin,$(TARGET)))
all: $(OUT_DIR)/libmsgsend.a
$(OUT_DIR)/libmsgsend.a: $(OUT_DIR)/msgsend.o
$(AR) rcs $(OUT_DIR)/libmsgsend.a $(OUT_DIR)/msgsend.o
$(OUT_DIR)/msgsend.o: src/msgsend.m
$(CC) $(CFLAGS) $< -o $@ -c
else
all:
endif
View File
View File
+2
View File
@@ -20,6 +20,8 @@
extern crate libc;
extern crate std;
#[cfg(target_os="macos")]
pub mod appkit;
#[cfg(target_os="macos")]
pub mod base;
View File