Skip to content

[cxxmodules] Always enable -Rmodule-build #1336

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
Nov 19, 2017
Merged
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
9 changes: 3 additions & 6 deletions core/dictgen/src/rootcling_impl.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -4302,12 +4302,9 @@ int RootClingMain(int argc,
clingArgsInterpreter.push_back("-fmodules-cache-path=" +
llvm::sys::path::parent_path(sharedLibraryPathName).str());

// If the user has passed ROOT_MODULES with the value 'DEBUG', then we
// enable remarks in clang for building on-demand modules. This is useful
// to figure out when and why on-demand modules are built by clang.
if (llvm::StringRef(getenv("ROOT_MODULES")) == "DEBUG") {
clingArgsInterpreter.push_back("-Rmodule-build");
}
// We enable remarks in clang for building on-demand modules. This is
// useful to figure out when and why on-demand modules are built by clang.
clingArgsInterpreter.push_back("-Rmodule-build");
}

// Convert arguments to a C array and check if they are sane
Expand Down
4 changes: 4 additions & 0 deletions core/metacling/src/TCling.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1258,6 +1258,10 @@ TCling::TCling(const char *name, const char *title)
if (useCxxModules && !fromRootCling) {
// We only set this flag, rest is done by the CIFactory.
interpArgs.push_back("-fmodules");
// We should never build modules during runtime, so let's enable the
// module build remarks from clang to make it easier to spot when we do
// this by accident.
interpArgs.push_back("-Rmodule-build");

TString vfsPath = TROOT::GetIncludeDir() + "/modulemap.overlay.yaml";
// On modules aware build systems (such as OSX) we do not need an overlay file and thus the build system does not
Expand Down