Commit 319fb898 by Tomasz Moniuszko Committed by Jamie Madill

Use default commit.h file if git index is not available

The solution is the same as in GYP version: 1. Check if .git/index is available in angle directory. 2. Use generated commit.h file if git is available or copy the default file instead. Change-Id: Ic3cedf6793c368070228a63c0eb270ca6fb47f81 Reviewed-on: https://chromium-review.googlesource.com/289391Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarTomasz Moniuszko <tmoniuszko@opera.com>
parent 56193ce3
......@@ -5,6 +5,15 @@
# import the use_x11 variable
import("//build/config/ui.gni")
angle_git_is_present = exec_script("src/commit_id.py",
[
"check",
rebase_path(".", root_build_dir),
],
"value")
angle_use_commit_id = angle_git_is_present == 1
gles_gypi = exec_script(
"//build/gypi_to_gn.py",
[ rebase_path("src/libGLESv2.gypi") ],
......@@ -184,19 +193,32 @@ config("commit_id_config") {
include_dirs = [ "$root_gen_dir/angle" ]
}
action("commit_id") {
script = "src/commit_id.py"
output_file = "$root_gen_dir/angle/id/commit.h"
outputs = [ output_file ]
commit_id_output_file = "$root_gen_dir/angle/id/commit.h"
if (angle_use_commit_id) {
action("commit_id") {
script = "src/commit_id.py"
outputs = [
commit_id_output_file,
]
args = [
"gen",
rebase_path(".", root_build_dir),
rebase_path(output_file, root_build_dir),
]
args = [
"gen",
rebase_path(".", root_build_dir),
rebase_path(commit_id_output_file, root_build_dir),
]
public_configs = [ ":commit_id_config" ]
public_configs = [ ":commit_id_config" ]
}
} else {
copy("commit_id") {
sources = [
"src/commit.h",
]
outputs = [
commit_id_output_file,
]
public_configs = [ ":commit_id_config" ]
}
}
config("libANGLE_config") {
......
......@@ -104,3 +104,4 @@ NVIDIA Corporation
Opera Software ASA
Daniel Bratell
Tomasz Moniuszko
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment