-
Notifications
You must be signed in to change notification settings - Fork 146
Add -G command line option to specify generator #64
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
Conversation
allow specification of generator from commandline. add -G option. (more to come)
if options.generator is specified, use that instead of computing one. (for windows; which can use mingw64 or openwatcom) further changes would be to pass toolset through.
Need to revisit ES5 to apply these better edits.
node.lib is c++ so the name mangling between gcc and msvc is incompatible... and all symbols from node.exe are failing :) |
@@ -60,8 +60,14 @@ Toolset.prototype.initializePosix = function (install) { | |||
this.cCompilerPath = "gcc"; | |||
} | |||
|
|||
if( this.options.generator ){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code style is off,
if (install) { | ||
this.log.info("TOOL", "Using " + this.options.generator + " generator, as specified from commandline."); | ||
} | ||
this.generator = this.options.generator; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you set this.generator again? It's already have options.generator's value at this point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not already set. The code immediately after this point sets the generator to a computed default.
(Oh it COULD be set, but it might not be....)
Because initially I left the generator initialization as = null; but I modified that to initialize to the options.generator thinking I could later check if generator is set, don't set it.
Then there's the logging that's done to report what generator was used....
// 2: Generator | ||
if (environment.isOSX) { | ||
else if (environment.isOSX) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't put generator override code at this point. Let toolset find its defaults and then, after initialize() around line 34, we should override the default value by logging out the exact information about which default generator got changed into which one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I figured it was pretty silly to do any sort of work to determine a default if it was already specified externally.
@@ -60,11 +60,10 @@ Toolset.prototype.initializePosix = function (install) { | |||
this.cCompilerPath = "gcc"; | |||
} | |||
|
|||
if( this.options.generator ){ | |||
if( this.generator ){ // if it's already set because of options... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, but this is still not following CMake.js' code style.
You know this is all edited on github... could have just moved the comments for me :p I didn't see a lot of examples; and even so the language isn't in the style either.
@@ -149,7 +149,8 @@ Toolset.prototype._setupGNUStd = function (install) { | |||
|
|||
Toolset.prototype.initializeWin = async(function*(install) { | |||
// Visual Studio: | |||
if( this.generator ){ // if it's already set because of options... | |||
// if it's already set because of options... | |||
if( this.generator ){ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
:) I mean:
if (this.generator) {
instead of
if( this.generator ){
Thanks. Will test and release soon. |
Allow specification of generator from command line.
(Allows use of MinGW-64 instead of visual studio for instance)
MUST complete; if a step fails when using this...
(MinGW Makefiles) cmake script complains if 'sh.exe' is in the path. Normally I can just run
cmake .
again and finish the process... but cmake-js continues to error.Second, I ended up doing it in an environment that was missing gcc, but didn't have sh.exe; so it finished with failure to find compilers, and retriggering failed....
But; deleting the build, having no sh.exe, having gcc in my path correctly - am able to finish building with
cmake-js build -G "MinGW Makefiles"
Error: could not find CMAKE_PROJECT_NAME in Cache
I guess; if it fails too soon that's the state.