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

Revert "[cxxmodules] Enable a module if json is present." #9267

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
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
4 changes: 1 addition & 3 deletions core/clingutils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@ set(clinginclude ${CMAKE_SOURCE_DIR}/interpreter/cling/include)

set(custom_modulemaps)
if (runtime_cxxmodules)
set(custom_modulemaps boost.modulemap tinyxml2.modulemap cuda.modulemap
module.modulemap.build
json.modulemap)
set(custom_modulemaps boost.modulemap tinyxml2.modulemap cuda.modulemap module.modulemap.build)
# FIXME: We should install vc.modulemap only when Vc is found (Vc_FOUND) but
# some systems install it under /usr/include/Vc/Vc which allows rootcling to
# discover it and assert that the modulemap is not found.
Expand Down
17 changes: 0 additions & 17 deletions graf3d/eve7/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,6 @@ ROOT_STANDARD_LIBRARY_PACKAGE(ROOTEve
src/REveViewer.cxx
src/REveVSD.cxx
src/REveVSDStructs.cxx
DICTIONARY_OPTIONS
-mByproduct Json
DEPENDENCIES
Core
Geom
Expand All @@ -138,23 +136,8 @@ ROOT_STANDARD_LIBRARY_PACKAGE(ROOTEve

if(builtin_nlohmannjson)
target_include_directories(ROOTEve PRIVATE ${CMAKE_SOURCE_DIR}/builtins)
target_compile_definitions(ROOTEve INTERFACE NLOHMANN_JSON_PROVIDES_FWD_HPP)
else()
target_link_libraries(ROOTEve PUBLIC nlohmann_json::nlohmann_json)

get_target_property(inc_dirs nlohmann_json::nlohmann_json INTERFACE_INCLUDE_DIRECTORIES)
foreach(dir ${inc_dirs})
if(EXISTS "${dir}/nlohmann/json_fwd.hpp")
set(found_fwd true)
endif()
endforeach()

if(found_fwd)
target_compile_definitions(ROOTEve INTERFACE NLOHMANN_JSON_PROVIDES_FWD_HPP)
else()
message("-- missing nlohmann/json_fwd.hpp required by eve7")
endif()

endif()

# this is required for glew
Expand Down
4 changes: 0 additions & 4 deletions graf3d/eve7/inc/ROOT/REveElement.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,7 @@

#include <memory>

#ifdef NLOHMANN_JSON_PROVIDES_FWD_HPP
#include <nlohmann/json_fwd.hpp>
Copy link
Member

Choose a reason for hiding this comment

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

I believe that only #include <nlohmann/json.hpp> should be used, as nlohmann/json_fwd.hpp is not always available, and we don't have control over when it's available or not if nlohmann_json is taken from the system. Other than that, seems fine.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, maybe the build system should detect that early on and switch to builtin_json=On...

Copy link
Member

@amadio amadio Nov 12, 2021

Choose a reason for hiding this comment

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

No, for distros you cannot enable builtins, it has to be taken from the system. Same for LCG, probably, but there we can change the installation of nlohman_json.

#else
#include <nlohmann/json.hpp>
#endif

class TGeoMatrix;

Expand Down
2 changes: 2 additions & 0 deletions graf3d/eve7/src/REveViewer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include <ROOT/REveManager.hxx>
#include <ROOT/REveSelection.hxx>

#include <nlohmann/json.hpp>

using namespace ROOT::Experimental;
namespace REX = ROOT::Experimental;

Expand Down
4 changes: 0 additions & 4 deletions interpreter/cling/include/cling/json.modulemap

This file was deleted.

6 changes: 0 additions & 6 deletions interpreter/cling/lib/Interpreter/CIFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,6 @@ namespace {
llvm::SmallString<256> tinyxml2IncLoc(getIncludePathForHeader(HS, "tinyxml2.h"));
llvm::SmallString<256> cudaIncLoc(getIncludePathForHeader(HS, "cuda.h"));
llvm::SmallString<256> vcVcIncLoc(getIncludePathForHeader(HS, "Vc/Vc"));
llvm::SmallString<256> jsonIncLoc(getIncludePathForHeader(HS, "nlohmann/json.hpp"));
llvm::SmallString<256> clingIncLoc(getIncludePathForHeader(HS,
"cling/Interpreter/RuntimeUniverse.h"));

Expand Down Expand Up @@ -706,11 +705,6 @@ namespace {
clingIncLoc.str(), MOverlay,
/*RegisterModuleMap=*/ true,
/*AllowModulemapOverride=*/ false);
if (!jsonIncLoc.empty())
maybeAppendOverlayEntry(jsonIncLoc.str(), "json.modulemap",
clingIncLoc.str(), MOverlay,
/*RegisterModuleMap=*/ true,
/*AllowModulemapOverride=*/ false);
if (!boostIncLoc.empty()) {
// Add the modulemap in the include/boost folder not in include.
llvm::sys::path::append(boostIncLoc, "boost");
Expand Down