Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Remove static usage at compile-time of GIT_INFO to enable builds outs…
…ide of a git repo
  • Loading branch information
larsbergstrom committed Aug 27, 2016
1 parent 8e39313 commit bdf4563
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components/script/dom/htmliframeelement.rs
Expand Up @@ -355,7 +355,7 @@ unsafe fn build_mozbrowser_event_detail(event: MozBrowserEvent,
type_: Some(DOMString::from(error_type.name())),
description: Some(DOMString::from(description)),
report: Some(DOMString::from(report)),
version: Some(DOMString::from_string(servo_version().into())),
version: Some(DOMString::from_string(servo_version())),
}.to_jsval(cx, rval);
},
MozBrowserEvent::SecurityChange(https_state) => {
Expand Down
9 changes: 7 additions & 2 deletions components/util/lib.rs
Expand Up @@ -36,6 +36,11 @@ pub mod prefs;
pub mod resource_files;
pub mod thread;

pub fn servo_version() -> &'static str {
concat!("Servo ", env!("CARGO_PKG_VERSION"), env!("GIT_INFO"))
pub fn servo_version() -> String {
let cargo_version = env!("CARGO_PKG_VERSION");
let git_info = option_env!("GIT_INFO");
match git_info {
Some(info) => format!("Servo {}{}", cargo_version, info),
None => format!("Servo {}", cargo_version),
}
}

0 comments on commit bdf4563

Please sign in to comment.