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

fix: fix VS CMake generator finder #30

Conversation

diefbell-grabcad
Copy link

If a newer version of Visual Studio build tools (>= 2019) is installed then the automatic build tools finder fails because cmake -G outputs:

Generators
* Visual Studio 17 2022        = Generates Visual Studio 2022 project files.
                                 Use -A option to specify architecture.
  Visual Studio 16 2019        = Generates Visual Studio 2019 project files.
                                 Use -A option to specify architecture.
  Visual Studio 15 2017 [arch] = Generates Visual Studio 2017 project files.
                                 Optional [arch] can be "Win64" or "ARM".
  Visual Studio 14 2015 [arch] = Generates Visual Studio 2015 project files.

and the function GET_CMAKE_VS_GENERATOR doesn't recognise them because it expects the [arch] suffix.

This fixes:
- Above issue;
- Issue where one of the build tools is prefixed by * (I think that means it's the system default or something? Idk;)
- For the build tools that don't end with [arch], it appends -A arch to the generator string in the argumentBuilder (kinda janky).

Co-Authored-By: Dief Bell <107551242+diefbell-grabcad@users.noreply.github.com>
@aminya aminya force-pushed the fix-vs-generator-finder branch from 8fdb172 to 1f9c204 Compare November 22, 2024 20:50
@aminya aminya changed the title Fix vs generator finder fix: fix VS CMake generator finder Nov 22, 2024
@aminya
Copy link
Collaborator

aminya commented Nov 26, 2024

I had rebased this into a single commit. Any reason to undo that? Could you rebase and squash the changes?

package.json Outdated
@@ -1,6 +1,6 @@
{
"name": "cmake-ts",
"version": "0.3.0",
"version": "0.4.0",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please keep the version as is. We can publish it as a patch

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So bump patch version? Or just leave as is?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leave as is. I'll handle the version bunp

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@diefbell-grabcad
Copy link
Author

I had rebased this into a single commit. Any reason to undo that? Could you rebase and squash the changes?

I have no idea how that happened. I can try just creating a new branch. I think because my branch was off your fork originally.

@aminya
Copy link
Collaborator

aminya commented Nov 28, 2024

Sounds good. Here's the branch I rebased:
https://github.com/EmbeddedEnterprises/cmake-ts/tree/vs-cmake-generator

@diefbell-grabcad
Copy link
Author

diefbell-grabcad commented Nov 28, 2024

Created #32 without messy un-squash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants