Skip to content

Commit

Permalink
Merge branch 'master' into tenum.getenum
Browse files Browse the repository at this point in the history
  • Loading branch information
dpiparo authored Sep 27, 2024
2 parents aaf2922 + ae22b41 commit 7d7acd4
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
6 changes: 6 additions & 0 deletions root/aclic/misc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ ROOTTEST_ADD_TEST(assertmyfun
ROOTTEST_ADD_TEST(assertROOT7027
MACRO assertROOT7027.C
OUTREF assertROOT7027.ref)

if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
ROOTTEST_ADD_TEST(addIncludePath
MACRO addIncludePath.C
COPY_TO_BUILDDIR addIncludePathTest.C addIncludePathGCCMajor.C)
endif()
8 changes: 8 additions & 0 deletions root/aclic/misc/addIncludePath.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
int addIncludePath() {

const auto gccVersion = gInterpreter->ProcessLine(".x addIncludePathGCCMajor.C+");
std::string newIncludePath = "-I/usr/include/c++/";
newIncludePath += std::to_string(gccVersion);
gSystem->AddIncludePath(newIncludePath.c_str());
return gROOT->LoadMacro("addIncludePathTest.C+"); // returns 0 in case of success
}
4 changes: 4 additions & 0 deletions root/aclic/misc/addIncludePathGCCMajor.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
int addIncludePathGCCMajor()
{
return __GNUC__;
}
8 changes: 8 additions & 0 deletions root/aclic/misc/addIncludePathTest.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#include <iostream>

struct Foo
{
Foo() {}
~Foo() {}
void print() { std::cout << "Hello, I'm Foo" << std::endl; }
};

0 comments on commit 7d7acd4

Please sign in to comment.