-
Notifications
You must be signed in to change notification settings - Fork 4
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
CMake Updates, main branch (2024.11.10.) #41
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,15 +7,15 @@ | |
# obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
# Create the benchmark executable from the individual files. | ||
add_executable(benchmark_cpu benchmark_cpu.cpp) | ||
add_executable(covfie_benchmark_cpu benchmark_cpu.cpp) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's keep the original name on this. |
||
|
||
# Ensure that the tests are linked against the required libraries. | ||
target_link_libraries( | ||
benchmark_cpu | ||
covfie_benchmark_cpu | ||
PUBLIC | ||
core | ||
cpu | ||
benchmark | ||
covfie::core | ||
covfie::cpu | ||
covfie_benchmark | ||
benchmark::benchmark | ||
Boost::headers | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,15 +12,15 @@ enable_language(CUDA) | |
include(covfie-compiler-options-cuda) | ||
|
||
# Create the benchmark executable from the individual files. | ||
add_executable(benchmark_cuda benchmark_cuda.cu) | ||
add_executable(covfie_benchmark_cuda benchmark_cuda.cu) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And on this. |
||
|
||
# Ensure that the tests are linked against the required libraries. | ||
target_link_libraries( | ||
benchmark_cuda | ||
covfie_benchmark_cuda | ||
PUBLIC | ||
core | ||
cuda | ||
benchmark | ||
covfie::core | ||
covfie::cuda | ||
covfie_benchmark | ||
benchmark::benchmark | ||
Boost::headers | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,23 +6,30 @@ | |
# v. 2.0. If a copy of the MPL was not distributed with this file, You can | ||
# obtain one at http://mozilla.org/MPL/2.0/. | ||
|
||
add_library(core INTERFACE) | ||
add_library(covfie_core INTERFACE) | ||
|
||
target_include_directories( | ||
core | ||
covfie_core | ||
INTERFACE | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}> | ||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> | ||
) | ||
|
||
target_compile_features(core INTERFACE cxx_std_20) | ||
target_compile_features(covfie_core INTERFACE cxx_std_20) | ||
|
||
if(COVFIE_QUIET) | ||
target_compile_definitions(core INTERFACE COVFIE_QUIET) | ||
target_compile_definitions(covfie_core INTERFACE COVFIE_QUIET) | ||
endif() | ||
|
||
# Logic to ensure that the core module can be installed properly. | ||
install(TARGETS core EXPORT ${PROJECT_NAME}Targets) | ||
set_target_properties( | ||
covfie_core | ||
PROPERTIES | ||
EXPORT_NAME | ||
core | ||
) | ||
|
||
install(TARGETS covfie_core EXPORT ${PROJECT_NAME}Targets) | ||
Comment on lines
+25
to
+32
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we really need to make this so complicated? Can't we just set There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I didn't touch the code that specifies the This is exactly how the "trick" of using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right, but this is what I am saying, just like Google Benchmark does it, the target should be named e.g. |
||
|
||
install( | ||
DIRECTORY | ||
|
@@ -32,7 +39,7 @@ install( | |
|
||
# Hack for people using the disgusting mal-practice of pullling in external | ||
# projects via "add_subdirectory"... | ||
add_library(covfie::core ALIAS core) | ||
add_library(covfie::core ALIAS covfie_core) | ||
|
||
# Test the public headers of covfie::core. | ||
if(COVFIE_TEST_HEADERS) | ||
|
@@ -45,7 +52,7 @@ if(COVFIE_TEST_HEADERS) | |
) | ||
|
||
covfie_test_public_headers( | ||
core | ||
covfie_core | ||
"${public_headers}" | ||
) | ||
endif() |
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.
I'm not on board with the benchmarks, tests, and examples being renamed; these should never be installed anyway, so there is no way for any name collisions to occur.