-
Notifications
You must be signed in to change notification settings - Fork 248
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pass toolchain and user env variables to make invocation (#777)
* Pass toolchain and user env variables to make invocation * Rename configure --> make * Add integration test coverage for make flag passing This requires making the make_simple Makefile more realistic by * using CXX and forwarding it to the wrapper; * using CXXFLAGS instead of CXX_FLAGS and not overwriting its contents.
- Loading branch information
Showing
11 changed files
with
193 additions
and
157 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
exports_files(["clang_wrapper.sh"]) | ||
exports_files(["cxx_wrapper.sh"]) | ||
|
||
filegroup( | ||
name = "srcs", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,5 +4,5 @@ if [[ $(uname) == *"NT"* ]]; then | |
# If Windows | ||
exec clang-cl "$@" | ||
else | ||
exec clang "$@" | ||
exec "$CXX" "$@" | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,19 @@ | ||
#include "liba.h" | ||
|
||
#include <math.h> | ||
|
||
#ifndef REQUIRED_DEFINE | ||
// '-DREQUIRED_DEFINE' is set via the copts attribute of the make rule. | ||
#error "REQUIRED_DEFINE is not defined" | ||
#endif | ||
|
||
std::string hello_liba(void) { | ||
return "Hello from LIBA!"; | ||
} | ||
} | ||
|
||
double hello_math(double a) { | ||
// On Unix, this call requires linking to libm.so. The Bazel toolchain adds | ||
// the required `-lm` linkopt automatically and rules_foreign_cc forwards | ||
// this option to make invocation via the CXXFLAGS variable. | ||
return acos(a); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,6 @@ | |
#include <string> | ||
|
||
std::string hello_liba(void); | ||
double hello_math(double); | ||
|
||
#endif | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.