Skip to content

local, bugfix: Define CRC32C_HAVE_CONFIG_H macro for all targets #5

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

Merged
merged 1 commit into from
Aug 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,10 @@ target_include_directories(crc32c
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)

target_compile_definitions(crc32c
PRIVATE
CRC32C_HAVE_CONFIG_H=1
set_property(
TARGET crc32c_arm64 crc32c_sse42 crc32c
Copy link
Member

Choose a reason for hiding this comment

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

If you want to define it for all targets, is it necessary to list all of them? There's no "blanket" option to just define it?

Copy link
Member Author

@hebasto hebasto Jun 24, 2022

Choose a reason for hiding this comment

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

Yes, it is possible to add_definitions(-DCRC32C_HAVE_CONFIG_H). It works for all targets in this directory, even those which do not require such a definition, e.g., crc32c_bench. But it is not relevant to the Bitcoin Core as we do not build other targets.

Do you want me to apply this solution?

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure. I admit I don't have a good view on the compromises involved.

Copy link
Member Author

Choose a reason for hiding this comment

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

It is considered best CMake practice to keep properties bound to targets.

APPEND
PROPERTY COMPILE_DEFINITIONS CRC32C_HAVE_CONFIG_H
)

set_target_properties(crc32c
Expand Down