Skip to content

Commit

Permalink
build_env_info: resolve issues with ninja
Browse files Browse the repository at this point in the history
This PR resolves issues with ninja as generator reported in
trilinos#13643

In Trilinos builds with ninja as generator, calling `make clean`
followed by recompiling resulted in compilation errors due to a missing
generated file Kokkos_Version_Info.cpp that was deleted during clean

The changes in this PR resolve the issue

Added notes:

* The issue did not occur with Unix Makefiles as generator
* The issue did not ocur with standalond kokkos

Co-authored-by: Daniel Arndt <[email protected]>
Signed-off-by: Nathan Ellingwood <[email protected]>
  • Loading branch information
ndellingwood and masterleinad committed Dec 3, 2024
1 parent 3acb4c9 commit f6f9dca
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/kokkos/cmake/build_env_info.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ find_package(Git QUIET)

set(CURRENT_LIST_DIR ${CMAKE_CURRENT_LIST_DIR})
set(pre_configure_dir ${CMAKE_CURRENT_LIST_DIR})
set(post_configure_dir ${CMAKE_BINARY_DIR}/generated)
set(post_configure_dir ${CMAKE_CURRENT_BINARY_DIR}/generated)

set(pre_configure_file ${pre_configure_dir}/Kokkos_Version_Info.cpp.in)
set(post_configure_file ${post_configure_dir}/Kokkos_Version_Info.cpp)
Expand Down Expand Up @@ -105,7 +105,7 @@ function(check_git_setup)
${CURRENT_LIST_DIR}/build_env_info.cmake BYPRODUCTS ${post_configure_file}
)

add_library(impl_git_version ${CMAKE_BINARY_DIR}/generated/Kokkos_Version_Info.cpp)
add_library(impl_git_version ${CMAKE_CURRENT_BINARY_DIR}/generated/Kokkos_Version_Info.cpp)
target_include_directories(impl_git_version PUBLIC ${CMAKE_BINARY_DIR}/generated)
target_compile_features(impl_git_version PRIVATE cxx_raw_string_literals)
add_dependencies(impl_git_version AlwaysCheckGit)
Expand Down

0 comments on commit f6f9dca

Please sign in to comment.