Skip to content

Implement --cc and --cxx flags for overriding compiler detection #191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ Options:
-T, --target only build the specified target [string]
-C, --prefer-clang use Clang compiler instead of default CMake compiler,
if available (Posix) [boolean]
--cc use the specified C compiler [string]
--cxx use the specified C++ compiler [string]
-r, --runtime the runtime to use [string]
-v, --runtime-version the runtime version to use [string]
-a, --arch the architecture to build in [string]
Expand All @@ -143,7 +145,6 @@ Options:
-i, --silent Prevents CMake.js to print to the stdio [boolean]
-O, --out Specify the output directory to compile to, default is
projectRoot/build [string]
projectRoot/build [string]
```

**Requirements:**
Expand Down
12 changes: 12 additions & 0 deletions bin/cmake-js
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,16 @@ var yargs = require("yargs")
describe: "use Clang compiler instead of default CMake compiler, if available (Posix)",
type: "boolean"
},
cc: {
demand: false,
describe: "use the specified C compiler",
type: "string"
},
cxx: {
demand: false,
describe: "use the specified C++ compiler",
type: "string"
},
r: {
alias: "runtime",
demand: false,
Expand Down Expand Up @@ -188,6 +198,8 @@ var options = {
preferXcode: argv.x,
preferGnu: argv.g,
preferClang: argv.C,
cCompilerPath: argv.cc,
cppCompilerPath: argv.cxx,
runtime: argv.r,
runtimeVersion: argv.v,
arch: argv.a,
Expand Down
40 changes: 21 additions & 19 deletions lib/es5/toolset.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading