Skip to content
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

Fix build errors on macOS #950

Merged
merged 2 commits into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
1 change: 1 addition & 0 deletions app/celer-g4/TimerOutput.hh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
//---------------------------------------------------------------------------//
#pragma once

#include <unordered_map>
#include <vector>
#include <G4Event.hh>

Expand Down
10 changes: 10 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,16 @@ celeritas_target_include_directories(testcel_harness
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
)

if (CELERITAS_USE_JSON)
celeritas_target_include_directories(testcel_harness
PUBLIC
$<BUILD_INTERFACE:${NLOHMANN_INCLUDE_DIR}>
)
celeritas_target_link_libraries(testcel_harness
PUBLIC nlohmann_json::nlohmann_json
)
endif()
Copy link
Member

Choose a reason for hiding this comment

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

  • The include_directories isn't necessary because the modern cmake targets propagate that information
  • This should be PRIVATE not PUBLIC because it's only used in a .cc file
  • if ( -> if(
  • Our top-level cmakelists defines nlohmann_json_LIBRARIES so that it's empty if json isn't available, so that makes it easier to add for the optional cases
  • It turns out I'm not directly using JSON anyway for now, so we could've just deleted the include 😅

Copy link
Member Author

Choose a reason for hiding this comment

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

Wait, so target_link_libraries(...) sets the include dirs as well?

Copy link
Member

Choose a reason for hiding this comment

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

Exactly. Modern cmake targets propagate build flags, library flags, include directories, etc.


#-----------------------------------------------------------------------------#
# HIP SUPPORT
#-----------------------------------------------------------------------------#
Expand Down