Skip to content
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: 2 additions & 7 deletions cmake/modules/RootConfiguration.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@ if(IS_ABSOLUTE ${CMAKE_INSTALL_LIBDIR})
else()
set(libdir ${prefix}/${CMAKE_INSTALL_LIBDIR})
endif()
if(IS_ABSOLUTE ${CMAKE_INSTALL_INCLUDEDIR})
set(incdir ${CMAKE_INSTALL_INCLUDEDIR})
else()
set(incdir ${prefix}/${CMAKE_INSTALL_INCLUDEDIR})
endif()
if(IS_ABSOLUTE ${CMAKE_INSTALL_MANDIR})
set(mandir ${CMAKE_INSTALL_MANDIR})
else()
Expand Down Expand Up @@ -685,7 +680,7 @@ install(EXPORT ${CMAKE_PROJECT_NAME}Exports NAMESPACE ROOT:: FILE ROOTConfig-tar

#---Especial definitions for root-config et al.--------------------------------------------------------------
if(prefix STREQUAL "$(ROOTSYS)")
foreach(d prefix bindir libdir incdir etcdir tutdir mandir)
foreach(d prefix bindir libdir etcdir tutdir mandir)
string(REPLACE "$(ROOTSYS)" "$ROOTSYS" ${d} ${${d}})
endforeach()
endif()
Expand Down Expand Up @@ -718,7 +713,7 @@ else()
${CMAKE_BINARY_DIR}/ginclude/compiledata.h "${CMAKE_CXX_COMPILER}"
"${CMAKE_CXX_FLAGS_RELEASE}" "${CMAKE_CXX_FLAGS_DEBUG}" "${CMAKE_CXX_ACLIC_FLAGS}"
"${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS}" "${CMAKE_EXE_LINKER_FLAGS}" "so"
"${libdir}" "-lCore" "-lRint" "${incdir}" "" "" "${ROOT_ARCHITECTURE}" "${ROOTBUILD}"
"${libdir}" "-lCore" "-lRint" "" "" "${ROOT_ARCHITECTURE}" "${ROOTBUILD}"
"${local_ROOT_COMPILEDATA_IGNORE_BUILD_NODE_CHANGES}")
endif()

Expand Down
1 change: 0 additions & 1 deletion cmake/scripts/compiledata.win32.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@
#define CXXDEBUG "@CMAKE_CXX_FLAGS_DEBUG@ @BLDCXXFLAGS@"
#define ROOTBUILD "release"
#define LINKEDLIBS "-LIBPATH:%ROOTSYS%\\lib libCore.lib "
#define INCLUDEPATH "-I%ROOTSYS%\\include"
#define OBJEXT "obj"
#define SOEXT "dll"
6 changes: 0 additions & 6 deletions cmake/unix/compiledata.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ ROOTLIBS=$9
shift
RINTLIBS=$9
shift
INCDIR=$9
shift
CUSTOMSHARED=$9
shift
CUSTOMEXE=$9
Expand All @@ -32,9 +30,6 @@ shift
IGNORE_BUILD_NODE_CHANGES=$9
shift

if [ "$INCDIR" = "$ROOTSYS/include" ]; then
INCDIR=\$ROOTSYS/include
fi
if [ "$LIBDIR" = "$ROOTSYS/lib" ]; then
LIBDIR=\$ROOTSYS/lib
fi
Expand Down Expand Up @@ -139,7 +134,6 @@ echo "#define CXXOPT \"$CXXOPT\"" >> "${COMPILEDATA}.tmp"
echo "#define CXXDEBUG \"$CXXDEBUG\"" >> "${COMPILEDATA}.tmp"
echo "#define ROOTBUILD \"$ROOTBUILD\"" >> "${COMPILEDATA}.tmp"
echo "#define LINKEDLIBS \"-L$LIBDIR $ROOTLIBS $RINTLIBS \"" >> "${COMPILEDATA}.tmp"
echo "#define INCLUDEPATH \"-I$INCDIR\"" >> "${COMPILEDATA}.tmp"
echo "#define OBJEXT \"o\"" >> "${COMPILEDATA}.tmp"
echo "#define SOEXT \"$SOEXT\"" >> "${COMPILEDATA}.tmp"

Expand Down
4 changes: 3 additions & 1 deletion core/base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,9 @@ if(core_soversion)
else()
set(full_core_filename "${core_prefix}Core${core_suffix}")
endif()
target_compile_options(Core PRIVATE -DLIB_CORE_NAME=${full_core_filename})
target_compile_options(Core PRIVATE -DLIB_CORE_NAME=${full_core_filename}
-DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_INSTALL_INCLUDEDIR}
)

if(PCRE2_FOUND)
target_link_libraries(Core PRIVATE PCRE2::PCRE2)
Expand Down
10 changes: 6 additions & 4 deletions core/base/src/TROOT.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1993,6 +1993,10 @@ void TROOT::InitSystem()
if (gSystem->Init())
fprintf(stderr, "Fatal in <TROOT::InitSystem>: can't init operating system layer\n");

TString rootincludedir = _R_QUOTEVAL_(CMAKE_INSTALL_INCLUDEDIR);
gSystem->PrependPathName(GetRootSys(), rootincludedir);
gSystem->SetIncludePath(("-I" + rootincludedir).Data());

if (!gSystem->HomeDirectory()) {
fprintf(stderr, "Fatal in <TROOT::InitSystem>: HOME directory not set\n");
fprintf(stderr, "Fix this by defining the HOME shell variable\n");
Expand Down Expand Up @@ -3037,8 +3041,6 @@ const TString &TROOT::GetLibDir()

namespace fs = std::filesystem;

#define TO_LITERAL(string) _QUOTE_(string)

#if defined(__APPLE__)

uint32_t count = _dyld_image_count();
Expand All @@ -3048,7 +3050,7 @@ const TString &TROOT::GetLibDir()
continue;

fs::path p(path);
if (p.filename() == TO_LITERAL(LIB_CORE_NAME)) {
if (p.filename() == _R_QUOTEVAL_(LIB_CORE_NAME)) {
rootlibdir = p.parent_path().c_str();
break;
}
Expand All @@ -3068,7 +3070,7 @@ const TString &TROOT::GetLibDir()
return 0;

fs::path p = info->dlpi_name;
if (p.filename() == TO_LITERAL(LIB_CORE_NAME)) {
if (p.filename() == _R_QUOTEVAL_(LIB_CORE_NAME)) {
libdir = p.parent_path().c_str();
return 1; // stop iteration
}
Expand Down
2 changes: 1 addition & 1 deletion core/base/src/TSystem.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ Bool_t TSystem::Init()
fBuildNode = BUILD_NODE;
fFlagsDebug = CXXDEBUG;
fFlagsOpt = CXXOPT;
fIncludePath = INCLUDEPATH;
// fIncludePath is set in TROOT::InitSystem()
fLinkedLibs = LINKEDLIBS;
fSoExt = SOEXT;
fObjExt = OBJEXT;
Expand Down
2 changes: 2 additions & 0 deletions core/foundation/inc/ROOT/RConfig.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,8 @@

#endif

#define _R_QUOTEVAL_(string) _QUOTE_(string)

/* produce an identifier that is almost unique inside a file */
# define _R__JOIN_(X,Y) _NAME2_(X,Y)
# define _R__JOIN3_(F,X,Y) _NAME3_(F,X,Y)
Expand Down
7 changes: 1 addition & 6 deletions roofit/batchcompute/src/RooBatchCompute.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,7 @@ class RooBatchComputeClass : public RooBatchComputeInterface {
std::string architectureName() const override
{
// transform to lower case to match the original architecture name passed to the compiler
#ifdef _QUOTEVAL_ // to quote the value of the preprocessor macro instead of the name
#error "It's unexpected that _QUOTEVAL_ is defined at this point!"
#endif
#define _QUOTEVAL_(x) _QUOTE_(x)
std::string out = _QUOTEVAL_(RF_ARCH);
#undef _QUOTEVAL_
std::string out = _R_QUOTEVAL_(RF_ARCH);
std::transform(out.begin(), out.end(), out.begin(), [](unsigned char c) { return std::tolower(c); });
return out;
};
Expand Down
5 changes: 2 additions & 3 deletions tree/tree/test/TTreeRegressions.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,11 @@ TEST(TTreeRegressions, EmptyLeafObject)
#define MYCLASS struct MyClass { std::vector<MySubClass> sub; MySubClass *Get(int id) { for (size_t i = 0; i < sub.size(); ++i) if (sub[i].id == id) return &sub[i]; return nullptr; } };
MYSUBCLASS
MYCLASS
#define TO_LITERAL(string) _QUOTE_(string)

TEST(TTreeRegressions, TTreeFormulaMemberIndex)
{
gInterpreter->Declare(TO_LITERAL(MYSUBCLASS));
gInterpreter->Declare(TO_LITERAL(MYCLASS));
gInterpreter->Declare(_R_QUOTEVAL_(MYSUBCLASS));
gInterpreter->Declare(_R_QUOTEVAL_(MYCLASS));

TTree tree("tree", "tree");
MyClass mc;
Expand Down
3 changes: 1 addition & 2 deletions tree/treeplayer/test/regressions.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,9 @@ TEST(TTreeFormulaRegressions, ConstantAlias)
// ROOT-8577 (JIRA)
#define MYSTRUCT struct MyS { int x; };
MYSTRUCT
#define TO_LITERAL(string) _QUOTE_(string)
TEST(TTreeFormulaRegressions, WrongName)
{
gInterpreter->Declare(TO_LITERAL(MYSTRUCT));
gInterpreter->Declare(_R_QUOTEVAL_(MYSTRUCT));
MyS s;
TLorentzVector v(1, 2, 3, 4);
TTree t("t", "t");
Expand Down
Loading