Skip to content

Commit 3a28aad

Browse files
committed
[CMake] Add R__HAS_CLAD preprocessor macro
To avoid warnings about unknown pragmas, it's useful to have a `R__HAS_CLAD` macro defined in the interpreter, so that Clad pragmas can be conditional on Clad being available.
1 parent c591107 commit 3a28aad

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

cmake/modules/RootConfiguration.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,11 @@ if(lz4)
355355
else()
356356
set(haslz4compression undef)
357357
endif()
358+
if(clad)
359+
set(hasclad define)
360+
else()
361+
set(hasclad undef)
362+
endif()
358363
if(cocoa)
359364
set(hascocoa define)
360365
else()

config/RConfigure.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
#@hasmathmore@ R__HAS_MATHMORE /**/
3636
#@haspthread@ R__HAS_PTHREAD /**/
3737
#@hasxft@ R__HAS_XFT /**/
38+
#@hasclad@ R__HAS_CLAD /**/
3839
#@hascocoa@ R__HAS_COCOA /**/
3940
#@hasvc@ R__HAS_VC /**/
4041
#@hasvdt@ R__HAS_VDT /**/

roofit/roofitcore/inc/RooFit/Detail/MathFuncs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ template <typename DoubleArray>
177177
double constraintSum(DoubleArray comp, unsigned int compSize)
178178
{
179179
double sum = 0;
180-
#ifdef __CLING__
180+
#if defined(__CLING__) && defined(R__HAS_CLAD)
181181
#pragma clad checkpoint loop
182182
#endif
183183
for (unsigned int i = 0; i < compSize; i++) {
@@ -367,7 +367,7 @@ double flexibleInterp(unsigned int code, ParamsArray params, unsigned int n, Dou
367367
double boundary, double nominal, int doCutoff)
368368
{
369369
double total = nominal;
370-
#ifdef __CLING__
370+
#if defined(__CLING__) && defined(R__HAS_CLAD)
371371
#pragma clad checkpoint loop
372372
#endif
373373
for (std::size_t i = 0; i < n; ++i) {

0 commit comments

Comments
 (0)