From: Adrian Prantl Date: Fri, 19 May 2023 17:22:27 +0000 (-0700) Subject: Work around a modularization issue in the Python headers. X-Git-Tag: upstream/17.0.6~7852 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aa2c2c8e3c3fe74f2b374b3fdc703ca7b05f80a0;p=platform%2Fupstream%2Fllvm.git Work around a modularization issue in the Python headers. --- 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