mirror of
https://github.com/servo/servo.git
synced 2025-07-02 21:13:39 +01:00
Switch task_info to use modern Cargo tools.
This commit is contained in:
parent
bf4fc6f388
commit
29fcdce5e0
9 changed files with 22 additions and 64 deletions
|
@ -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
components/servo/Cargo.lock
generated
3
components/servo/Cargo.lock
generated
|
@ -1178,6 +1178,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
ports/cef/Cargo.lock
generated
3
ports/cef/Cargo.lock
generated
|
@ -1171,6 +1171,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
ports/gonk/Cargo.lock
generated
3
ports/gonk/Cargo.lock
generated
|
@ -1042,6 +1042,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…
Add table
Add a link
Reference in a new issue