From aa2c2c8e3c3fe74f2b374b3fdc703ca7b05f80a0 Mon Sep 17 00:00:00 2001 From: Adrian Prantl Date: Fri, 19 May 2023 10:22:27 -0700 Subject: [PATCH] Work around a modularization issue in the Python headers. --- lldb/source/API/CMakeLists.txt | 5 +++++ lldb/source/Plugins/ScriptInterpreter/Python/CMakeLists.txt | 6 ++++++ lldb/unittests/ScriptInterpreter/Python/CMakeLists.txt | 6 ++++++ 3 files changed, 17 insertions(+) diff --git a/lldb/source/API/CMakeLists.txt b/lldb/source/API/CMakeLists.txt index 3e189f3..238372b 100644 --- a/lldb/source/API/CMakeLists.txt +++ b/lldb/source/API/CMakeLists.txt @@ -6,6 +6,11 @@ if(LLDB_BUILD_FRAMEWORK) endif() if(LLDB_ENABLE_PYTHON) + if (APPLE AND LLVM_ENABLE_LOCAL_SUBMODULE_VISIBILITY) + # Work around an issue with the Python headers, which have a modular include + # inside an extern "C" block. + remove_module_flags() + endif() get_target_property(python_bindings_dir swig_wrapper_python BINARY_DIR) set(lldb_python_wrapper ${python_bindings_dir}/LLDBWrapPython.cpp) endif() diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/CMakeLists.txt b/lldb/source/Plugins/ScriptInterpreter/Python/CMakeLists.txt index d59b7bb..7236116 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/CMakeLists.txt +++ b/lldb/source/Plugins/ScriptInterpreter/Python/CMakeLists.txt @@ -1,3 +1,9 @@ +if (APPLE AND LLVM_ENABLE_LOCAL_SUBMODULE_VISIBILITY) + # Work around an issue with the Python headers, which have a modular include + # inside an extern "C" block. + remove_module_flags() +endif() + if(NOT LLDB_PYTHON_RELATIVE_PATH) message(FATAL_ERROR "LLDB_PYTHON_RELATIVE_PATH is not set.") endif() diff --git a/lldb/unittests/ScriptInterpreter/Python/CMakeLists.txt b/lldb/unittests/ScriptInterpreter/Python/CMakeLists.txt index 90a53bf..daaf40d 100644 --- a/lldb/unittests/ScriptInterpreter/Python/CMakeLists.txt +++ b/lldb/unittests/ScriptInterpreter/Python/CMakeLists.txt @@ -1,3 +1,9 @@ +if (APPLE AND LLVM_ENABLE_LOCAL_SUBMODULE_VISIBILITY) + # Work around an issue with the Python headers, which have a modular include + # inside an extern "C" block. + remove_module_flags() +endif() + add_lldb_unittest(ScriptInterpreterPythonTests PythonDataObjectsTests.cpp PythonTestSuite.cpp -- 2.7.4