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
Add: [CMake] Option to only build tools #8372
Conversation
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.
Nice, simple, clean. Sweet :)
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.
With this change, the Mac OS builds don't work:
/Users/runner/work/OpenTTD/OpenTTD/src/settingsgen/../3rdparty/optional/optional.hpp:182:27: error: unknown type name 'constexpr'
No clue what it is on about .. but possibly we skip too much now.
Found it: we now skip this too:
and later too:
and below that:
after that:
and almost at the end:
I think those are the important blobs. So we might want to re-arrange some things, or maybe better, move them to their own files? Sorry ... this was not as simple as you might have hoped :D |
Added |
Merging both options seems to be the cleanest solution. I'm just not sure about the option name. |
cmake/Options.cmake
Outdated
@@ -57,6 +57,7 @@ function(set_options) | |||
option(OPTION_USE_ASSERTS "Use assertions; leave enabled for nightlies, betas, and RCs" ON) | |||
option(OPTION_USE_THREADS "Use threads" ON) | |||
option(OPTION_USE_NSIS "Use NSIS to create windows installer; enable only for stable releases" OFF) | |||
option(OPTION_TOOLS_DOCS "Build only tools and docs targets" OFF) |
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.
weird name for the option honestly. I wouldn't guess what it does based on that. Can't we consider "docs" to be a tool too? OPTION_TOOLS_ONLY
sounded so much better :) Maybe others have good ideas :)
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.
\o/
Seriously nice job, tnx a lot for putting in the effort :)
I first tried adding
if(NOT OPTION_TOOLS_ONLY)
around parts ofCMakeLists.txt
, but I finally opted for something less invasive.Of course there's some copy/paste (
add_custom_target
andadd_subdirectory
), but it's cleaner for me that way.