Skip to content

Commit

Permalink
Implement --cc and --cxx flags for overriding compiler detection (#191)
Browse files Browse the repository at this point in the history
* Implement --cc and --cxx flags for overriding compiler detection

* Update README.md with --cc and --cxx
  • Loading branch information
ColdenCullen authored and unbornchikken committed Sep 25, 2019
1 parent cd1ab85 commit b0f9a09
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 42 deletions.
3 changes: 2 additions & 1 deletion README.md
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
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.

0 comments on commit b0f9a09

Please sign in to comment.