mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 10:44:56 +00:00
servo: Merge #6220 - Switch task_info to use modern Cargo tools (from metajack:task-info-build-cleanup); r=nox
This is the first bit of build cleanup on my quest to make Cargo faster. Source-Repo: https://github.com/servo/servo Source-Revision: e6c4ca4960cc9f6ac9bd17c35a10b78350b70c73
This commit is contained in:
parent
6679e6dff7
commit
1bf663cb58
@ -10,9 +10,6 @@ path = "lib.rs"
|
||||
[dependencies.profile_traits]
|
||||
path = "../profile_traits"
|
||||
|
||||
[dependencies.task_info]
|
||||
path = "../../support/rust-task_info"
|
||||
|
||||
[dependencies.util]
|
||||
path = "../util"
|
||||
|
||||
@ -20,3 +17,9 @@ path = "../util"
|
||||
libc = "*"
|
||||
regex = "0.1.14"
|
||||
time = "0.1.12"
|
||||
|
||||
[target.x86_64-apple-darwin.dependencies.task_info]
|
||||
path = "../../support/rust-task_info"
|
||||
|
||||
[target.i686-apple-darwin.dependencies.task_info]
|
||||
path = "../../support/rust-task_info"
|
||||
|
3
servo/components/servo/Cargo.lock
generated
3
servo/components/servo/Cargo.lock
generated
@ -1180,6 +1180,9 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "task_info"
|
||||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"gcc 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tempdir"
|
||||
|
3
servo/ports/cef/Cargo.lock
generated
3
servo/ports/cef/Cargo.lock
generated
@ -1173,6 +1173,9 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "task_info"
|
||||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"gcc 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tempdir"
|
||||
|
3
servo/ports/gonk/Cargo.lock
generated
3
servo/ports/gonk/Cargo.lock
generated
@ -1044,6 +1044,9 @@ dependencies = [
|
||||
[[package]]
|
||||
name = "task_info"
|
||||
version = "0.0.1"
|
||||
dependencies = [
|
||||
"gcc 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "tempdir"
|
||||
|
@ -5,3 +5,6 @@ version = "0.0.1"
|
||||
authors = ["The Servo Project Developers"]
|
||||
|
||||
build = "build.rs"
|
||||
|
||||
[build-dependencies]
|
||||
gcc = "0.3.4"
|
||||
|
@ -1,32 +0,0 @@
|
||||
VPATH=%VPATH%
|
||||
|
||||
CC ?= gcc
|
||||
RUSTC ?= rustc
|
||||
AR ?= ar
|
||||
RUSTFLAGS ?=
|
||||
CFLAGS += -Wall
|
||||
|
||||
RUST_SRC = $(shell find $(VPATH)/. -type f -name '*.rs')
|
||||
|
||||
.PHONY: all
|
||||
all: libtask_info-servo.dummy
|
||||
|
||||
libtask_info-servo.dummy: task_info.rc $(RUST_SRC) libtask_info.a
|
||||
$(RUSTC) $(RUSTFLAGS) $< --out-dir . -C extra-filename=-servo
|
||||
touch $@
|
||||
|
||||
task_info-test: task_info.rc $(RUST_SRC) libtask_info.a
|
||||
$(RUSTC) $(RUSTFLAGS) $< -o $@ --test
|
||||
|
||||
libtask_info.a: task_info.o
|
||||
$(AR) rcs libtask_info.a task_info.o
|
||||
|
||||
task_info.o: task_info.c
|
||||
$(CC) $(CFLAGS) $< -o $@ -c
|
||||
|
||||
check: task_info-test
|
||||
./task_info-test
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -f task_info-test *.a *.o *.so *.dylib *.rlib *.dll *.dummy task_info-test
|
@ -2,14 +2,10 @@
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
use std::process::Command;
|
||||
use std::env;
|
||||
extern crate gcc;
|
||||
|
||||
fn main() {
|
||||
assert!(Command::new("make")
|
||||
.args(&["-f", "makefile.cargo"])
|
||||
.status()
|
||||
.unwrap()
|
||||
.success());
|
||||
println!("cargo:rustc-flags=-L native={}", env::var("OUT_DIR").unwrap());
|
||||
let mut cfg = gcc::Config::new();
|
||||
cfg.file("src/task_info.c");
|
||||
cfg.compile("libtask_info.a");
|
||||
}
|
||||
|
@ -1,20 +0,0 @@
|
||||
CC ?= gcc
|
||||
AR ?= ar
|
||||
CFLAGS += -Wall
|
||||
|
||||
.PHONY: all
|
||||
ifeq (darwin,$(findstring darwin,$(TARGET)))
|
||||
|
||||
all: $(OUT_DIR)/libtask_info.a
|
||||
|
||||
$(OUT_DIR)/libtask_info.a: $(OUT_DIR)/task_info.o
|
||||
$(AR) rcs $@ $^
|
||||
|
||||
$(OUT_DIR)/task_info.o: src/task_info.c
|
||||
$(CC) $(CFLAGS) $< -o $@ -c
|
||||
|
||||
else
|
||||
|
||||
all:
|
||||
|
||||
endif
|
@ -14,6 +14,5 @@
|
||||
|
||||
extern crate libc;
|
||||
|
||||
#[cfg(target_os="macos")]
|
||||
pub mod task_basic_info;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user