Fix macOS 26 CLING runtime dictionary errors caused by Homebrew/SDK header conflicts

macOS 26 (Darwin 25.5.0) introduced stricter Clang module map rules in
DarwinFoundation1.modulemap: the '_c_standard_library_obsolete' module
now requires the 'found_incompatible_headers__check_search_paths' feature,
which CLING's runtime interpreter does not set. When fftw3.h (from
/opt/homebrew/include) was parsed by CLING via the inlined PStartupHandler
dictionary payload, it triggered this module map error, causing all
PStartupHandler signal/slot connections to fail.

Two fixes:
- PMusr.h: guard '#include "fftw3.h"' with '#ifndef __CLING__'. No fftw
  types appear in PMusr.h class definitions, so CLING does not need it
  for reflection. This is the primary runtime fix.
- CMakeLists.txt (src/classes and all src/external libs): replace
  '-I${FFTW3_INCLUDE}', '-I${Boost_INCLUDE_DIRS}', '-I${GSL_INCLUDE_DIRS}',
  and '-I${ROOT_INCLUDE_DIRS}' with '-isystem' in all root_generate_dictionary
  OPTIONS blocks, and change 'include_directories(${FFTW3_INCLUDE})' to
  'include_directories(SYSTEM ...)'. Internal project paths (MUSRFIT_INC,
  BMW_TOOLS_INC, NONLOCAL_INC, CMAKE_CURRENT_SOURCE_DIR, etc.) keep '-I'.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-07-15 10:29:43 +02:00
co-authored by Claude Sonnet 4.6
parent 358fc8ec6d
commit b90d0d9e8b
14 changed files with 38 additions and 33 deletions
+9 -9
View File
@@ -6,14 +6,14 @@ set(MUSRFIT_INC ${CMAKE_SOURCE_DIR}/src/include)
# Hence, target_include_directories cannot be used here because, targets are
# setup only afterwards.
include_directories(${MUSRFIT_INC})
include_directories(${FFTW3_INC})
include_directories(SYSTEM ${FFTW3_INCLUDE})
root_generate_dictionary(
PFourierCanvasDict
PFourierCanvas.h
OPTIONS
-I${MUSRFIT_INC}
-I${FFTW3_INCLUDE}
-isystem ${FFTW3_INCLUDE}
-inlineInputHeader
LINKDEF ${MUSRFIT_INC}/PFourierCanvasLinkDef.h
MODULE PFourierCanvas
@@ -23,7 +23,7 @@ root_generate_dictionary(
PMsgBox.h
LINKDEF ${MUSRFIT_INC}/PMsgBoxLinkDef.h
OPTIONS
-I${Boost_INCLUDE_DIRS} -I${FFTW3_INCLUDE} -I${MUSRFIT_INC}
-isystem ${Boost_INCLUDE_DIRS} -isystem ${FFTW3_INCLUDE} -I${MUSRFIT_INC}
-inlineInputHeader
MODULE PMsgBox
)
@@ -32,7 +32,7 @@ root_generate_dictionary(
PMusrCanvas.h
LINKDEF ${MUSRFIT_INC}/PMusrCanvasLinkDef.h
OPTIONS
-I${Boost_INCLUDE_DIRS} -I${FFTW3_INCLUDE} -I${MUSRFIT_INC}
-isystem ${Boost_INCLUDE_DIRS} -isystem ${FFTW3_INCLUDE} -I${MUSRFIT_INC}
-inlineInputHeader
MODULE PMusrCanvas
)
@@ -41,7 +41,7 @@ root_generate_dictionary(
PMusrT0.h
LINKDEF ${MUSRFIT_INC}/PMusrT0LinkDef.h
OPTIONS
-I${Boost_INCLUDE_DIRS} -I${FFTW3_INCLUDE} -I${MUSRFIT_INC}
-isystem ${Boost_INCLUDE_DIRS} -isystem ${FFTW3_INCLUDE} -I${MUSRFIT_INC}
-inlineInputHeader
MODULE PMusrT0
)
@@ -50,7 +50,7 @@ root_generate_dictionary(
PStartupHandler.h
LINKDEF ${MUSRFIT_INC}/PStartupHandlerLinkDef.h
OPTIONS
-I${FFTW3_INCLUDE} -I${MUSRFIT_INC}
-isystem ${FFTW3_INCLUDE} -I${MUSRFIT_INC}
-inlineInputHeader
MODULE PStartupHandler
)
@@ -60,7 +60,7 @@ root_generate_dictionary(
LINKDEF ${MUSRFIT_INC}/PUserFcnBaseLinkDef.h
OPTIONS
-inlineInputHeader
-I${FFTW3_INCLUDE} -I${MUSRFIT_INC}
-isystem ${FFTW3_INCLUDE} -I${MUSRFIT_INC}
MODULE PUserFcnBase
)
root_generate_dictionary(
@@ -69,7 +69,7 @@ root_generate_dictionary(
OPTIONS
-I${NONLOCAL_INC}
-I${MUSRFIT_INC}
-I${FFTW3_INCLUDE}
-isystem ${FFTW3_INCLUDE}
-I${CMAKE_CURRENT_SOURCE_DIR}
-inlineInputHeader
LINKDEF ${MUSRFIT_INC}/PRgeHandlerLinkDef.h
@@ -129,7 +129,7 @@ add_library(PMusr SHARED
)
#--- make sure that the include directory is found ----------------------------
target_include_directories(
PMusr BEFORE PRIVATE
PMusr SYSTEM BEFORE PRIVATE
$<BUILD_INTERFACE:${DKS_INCLUDE_DIR}>
$<BUILD_INTERFACE:${Boost_INCLUDE_DIRS}>
$<BUILD_INTERFACE:${FFTW3_INCLUDE}>