-
Notifications
You must be signed in to change notification settings - Fork 283
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
Move version detection and compiler flags into utilities.cmake #1421
base: main
Are you sure you want to change the base?
Conversation
If anything I don't like that Can you explain what the intended benefit of moving this content to utilities.cmake is? Thanks for your contribution! |
Yes see below:
I my opinion its exactly the other way around. The If I express the current state of the |
There doesn't appear to be any subdirectory below the root to which anything could be restricted. CMake loses its mind whenever a target mentions something 'above' the current CMakeLists.txt, and we put 'src' and 'include' in separate top-level directories. (I don't like that either, but just hasn't been a can of worms I've been willing to spend energy opening) Moreover, the outputs all need to end up built into the same directory, I believe CMake's default behavior with
It must be built to the same place or the result will be broken because the exe finds where the artifacts live by looking relative to where the exe is.
Once upon a time vcpkg-test also contained e2e stuff and cared about the directory to which it was built, but now I believe it could be built elsewhere. Ditto the other mini test exes, though of course corresponding test changes would need to be made to respond to being built into different locations.
I agree that functions could reduce a lot of the copy pasta. I don't agree that putting those functions into a separate file buys anything unless the files are understandable on their own, and I don't believe But again, I'm speaking as me personally, not as 'the will of the vcpkg maintainers' here. |
Since when? Never observed any issues with that.
There are ways to control all build output folders (basically all
The contents of The contents of In the end these changes here are for humans. Shorter files mean faster skimming through files. Physical separation of code into different files in general means that code is in some way logical separated/grouped. This in return reduces the mental load on the reader. |
tldr; I agree that at some level of buildsystem complexity it becomes important to separate and organize, but I don't think the vcpkg-tool build has reached the tradeoff point yet (currently at <700 lines). I think that the nature of the CMake language (lots of imperative, global state, without proper function returns) makes it nearly impossible to effectively encapsulate concerns. When debugging or making improvements, you cannot ignore the function call Given the above, I'd agree with the following changes:
I'd be interested in reviewing a change that rearranges parts of the file in a way that has clearly articulated principles -- perhaps separating binary targets (like vcpkglib) from "maintenance" targets (like verify-messages or format) from logical targets (vcpkg-artifacts-target and npm-restore). But it is essential that any such reorganization has clear rules about what goes where and why (for example, putting all the |
No description provided.