mirror of
https://github.com/servo/servo
synced 2026-04-27 09:57:23 +02:00
* Run main and try jobs with debug assertions
* use single quotes in workflow expressions
* set force-debug-assertions in main.yml
* set force-debug-assertions as part of decision job
* fix typo in MachCommands.build
* fix more hardcoded profile names
* fix tidy
* split cargo_profile_option on windows
* Fix running servoshell and unit tests through a symlink
* rename steps to make them less confusing
* fix more hardcoded cargo profile options
* fix missing inputs in linux-wpt and mac-wpt
* make filename an inherent method of Resource
* rework release-with-debug-assertions profile to production profile
* rework resource logic to eliminate std_test_override
* set production flag in nightly release builds
* clean up servobuild.example and windows.yml
* oops forgot to check in embedder_traits/build.rs
* fix mach test-unit behaviour through symlink
* unit tests only need current_dir and ancestors
* fix macOS package smoketest breakage
* expect css/css-color/currentcolor-003 to crash under layout 2013
* fix more references to {force,release-with}-debug-assertions
* fix local build failures under --profile production
58 lines
1.9 KiB
Rust
58 lines
1.9 KiB
Rust
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
|
|
|
use std::error::Error;
|
|
use std::path::Path;
|
|
|
|
use vergen::EmitBuilder;
|
|
|
|
fn main() -> Result<(), Box<dyn Error>> {
|
|
// Cargo does not expose the profile name to crates or their build scripts,
|
|
// but we can extract it from OUT_DIR and set a custom cfg() ourselves.
|
|
let out = std::env::var("OUT_DIR")?;
|
|
let out = Path::new(&out);
|
|
let krate = out.parent().unwrap();
|
|
let build = krate.parent().unwrap();
|
|
let profile = build.parent().unwrap();
|
|
if profile.file_name().unwrap() == "production" {
|
|
println!("cargo:rustc-cfg=servo_production");
|
|
} else {
|
|
println!("cargo:rustc-cfg=servo_do_not_use_in_production");
|
|
}
|
|
|
|
#[cfg(windows)]
|
|
{
|
|
let mut res = winres::WindowsResource::new();
|
|
res.set_icon("../../resources/servo.ico");
|
|
res.set_manifest_file("platform/windows/servo.exe.manifest");
|
|
res.compile().unwrap();
|
|
}
|
|
#[cfg(target_os = "macos")]
|
|
{
|
|
cc::Build::new()
|
|
.file("platform/macos/count_threads.c")
|
|
.compile("count_threads");
|
|
}
|
|
|
|
if let Err(error) = EmitBuilder::builder()
|
|
.fail_on_error()
|
|
.git_sha(true /* short */)
|
|
.emit()
|
|
{
|
|
println!(
|
|
"cargo:warning=Could not generate git version information: {:?}",
|
|
error
|
|
);
|
|
println!("cargo:rustc-env=VERGEN_GIT_SHA=nogit");
|
|
}
|
|
|
|
// On MacOS, all dylib dependencies are shipped along with the binary
|
|
// in the "/lib" directory. Setting the rpath here, allows the dynamic
|
|
// linker to locate them. See `man dyld` for more info.
|
|
#[cfg(target_os = "macos")]
|
|
println!("cargo:rustc-link-arg=-Wl,-rpath,@executable_path/lib/");
|
|
|
|
Ok(())
|
|
}
|