Skip to content

Commit 49a5136

Browse files
committed
Fix python include path
Some of the ANTLR and Python include files are conflicting, so this change adjusts the python include path to be private. ANTLR exposed the issue, but I believe this is more generally a positive thing, independent of the particular ANTLR/Python collision.
1 parent 79d0b71 commit 49a5136

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

ProjectMacros.cmake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,11 @@ macro(MAKE_SWIG_TARGET NAME SIMPLENAME KEY_I_FILE I_FILES PARENT_TARGET PARENT_S
357357
${SWIG_WRAPPER}
358358
)
359359

360+
target_include_directories(${swig_target}
361+
SYSTEM PRIVATE
362+
${Python_INCLUDE_DIRS}
363+
)
364+
360365
target_compile_definitions(${swig_target} PRIVATE SHARED_OS_LIBS)
361366
target_compile_definitions(${swig_target} PRIVATE SWIG_PYTHON_SILENT_MEMLEAK) # Shush it, cf #5421
362367
set_target_properties(${swig_target} PROPERTIES OUTPUT_NAME _${LOWER_NAME})
@@ -454,6 +459,11 @@ macro(MAKE_SWIG_TARGET NAME SIMPLENAME KEY_I_FILE I_FILES PARENT_TARGET PARENT_S
454459
${SWIG_WRAPPER}
455460
)
456461

462+
target_include_directories(${swig_target}
463+
SYSTEM PRIVATE
464+
${Python_INCLUDE_DIRS}
465+
)
466+
457467
set_target_properties(${swig_target} PROPERTIES OUTPUT_NAME _${LOWER_NAME})
458468
set_target_properties(${swig_target} PROPERTIES PREFIX "")
459469
set_target_properties(${swig_target} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY "${PYTHON_PACKAGE_FOLDER}/openstudio/")

python/SetupPython.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,6 @@ else()
8585
# endif()
8686
endif()
8787

88-
include_directories(SYSTEM ${Python_INCLUDE_DIRS})
8988
set(ALL_PYTHON_BINDING_TARGETS "") # global list of python bindings
9089
set(ALL_PYTHON_BINDING_DEPENDS "") # global list of library dependencies of the generated wrapper cxx files
9190
set(ALL_PYTHON_WRAPPER_FILES "") # global list of generated wrapper cxx files

0 commit comments

Comments
 (0)