Skip to content

Commit ced0d3b

Browse files
authored
Merge pull request #87 from rnburn/bazel
Run cmake in isolated directory.
2 parents c9d9215 + 664ad8e commit ced0d3b

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

BUILD.bazel

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,21 @@ genrule(
3434
"include/lightstep/version.h",
3535
],
3636
cmd = """
37+
TEMP_DIR=$$(mktemp -d)
38+
CONFIG_H_OUT=$${PWD}/$(location :include/lightstep/config.h)
39+
VERSION_H_OUT=$${PWD}/$(location :include/lightstep/version.h)
40+
LIGHTSTEP_ROOT=$$(dirname $${PWD}/$(location :CMakeLists.txt))
41+
cd $$TEMP_DIR
3742
cmake \\
3843
-DBUILD_TESTING=OFF \\
3944
-DWITH_GRPC=OFF \\
4045
-DOPENTRACING_INCLUDE_DIR="" \\
4146
-DOPENTRACING_LIBRARY="" \\
4247
-L \\
43-
$$(dirname $(location :CMakeLists.txt))
44-
mv include/lightstep/config.h $(location :include/lightstep/config.h)
45-
mv include/lightstep/version.h $(location :include/lightstep/version.h)
48+
$$LIGHTSTEP_ROOT
49+
mv include/lightstep/config.h $$CONFIG_H_OUT
50+
mv include/lightstep/version.h $$VERSION_H_OUT
51+
rm -rf $$TEMP_DIR
4652
""",
4753
)
4854

0 commit comments

Comments
 (0)