Skip to content
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

Allows to specify custom build configuration #216

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -42,6 +42,8 @@ Options:
-d, --directory specify CMake project's directory (where CMakeLists.txt
located) [string]
-D, --debug build debug configuration [boolean]
-C, --config specify build configuration (Debug, RelWithDebInfo,
Release), will ignore '--debug' if specified [string]
-c, --cmake-path path of CMake executable [string]
-m, --prefer-make use Unix Makefiles even if Ninja is available (Posix)
[boolean]
Expand Down
6 changes: 6 additions & 0 deletions bin/cmake-js
Expand Up @@ -66,6 +66,12 @@ var yargs = require("yargs")
describe: "build debug configuration",
type: "boolean"
},
C: {
alias: "config",
demand: false,
describe: "specify build configuration (Debug, RelWithDebInfo, Release), will ignore '--debug' if specified",
type: "string"
},
c: {
alias: "cmake-path",
demand: false,
Expand Down
2 changes: 1 addition & 1 deletion lib/cMake.js
Expand Up @@ -20,7 +20,7 @@ function CMake(options) {
this.dist = new Dist(this.options);
this.projectRoot = path.resolve(this.options.directory || process.cwd());
this.workDir = path.resolve(this.options.out || path.join(this.projectRoot, "build"));
this.config = this.options.debug ? "Debug" : "Release";
this.config = this.options.config || this.options.debug ? "Debug" : "Release";
this.buildDir = path.join(this.workDir, this.config);
this._isAvailable = null;
this.targetOptions = new TargetOptions(this.options);
Expand Down