-
Notifications
You must be signed in to change notification settings - Fork 6
Bump minimum CMake version up to 3.16 #33
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
seems sensible to me |
137065f
to
54c32bf
Compare
54c32bf
to
b517d5c
Compare
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.
ACK b517d5c
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.
ACK b517d5c
message(WARNING "PIE is not supported at link time: ${check_pie_output}") | ||
list(APPEND configure_warnings "Position independent code disabled.") | ||
endif() | ||
unset(check_pie_output) |
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.
This unset
is new in the rebase, no? Is it needed for some reason? Is this a pattern we should be reviewing for?
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.
The reason is to keep the global namespace tidy.
Can someone link to the discussion about the CMake PIE checks, their output, and how it differs from what we do with master? i.e, one example on Fedora Linux: # Master
src/init.cpp -fPIE
bitcoind -fPIE -pie
# CMake
src/init.cpp -fPIC
bitcoind -fPIE |
From CMake docs: |
Sure, I can lookup the docs, but I'm asking why have we changed this, does the difference matter, etc? |
In the docs I also see:
but that doesn't seem to be the case here? So is the check not working as intended, is our behaviour differing from the docs? |
Autotools:
CMake:
|
The link command for
|
CMake added the necessary linker behavior here: https://cmake.org/cmake/help/latest/policy/CMP0083.html
|
Wait, no. I misunderstood what was happening here. I thought we agreed not to force this on, letting CMake do the right thing depending on what was being built? Wasn't this only turned on as a stop-gap for initial review? |
Just to clarify, this PR did not aim to alter the PIC/PIE behavior. It dropped the code branch for CMake versions older than 3.16. |
Yes, understood. And I think above I was misremembering, that's how we handled it for libsecp. For Core, yeah, just turn it on. All good. Sorry for the noise. |
Speaking of PIC/PIE, I really doubt that the check, or at least a warning, is required for a Windows target (both MSVC and cross-compiling). |
Implemented in #39. |
Considering the time when the new CMake-based build system will be available for users, it seems reasonable to drop support
for CMake versions older than 3.16.
Here are benefits of such version bumping:
cmake --build
tool gained--verbose
and-v
options to specify verbose build outputcmake-gui
dialog gained new-S
and-B
arguments to explicitly specify source and build directoriesFindSQLite3
module was added to find the SQLite v3.x library (not implemented in this PR yet)cmake --build
tool--target
parameter gained support for multiple targets. It now also has a short form-t
aliascmake
command gained a new--install
option