Description
What is the problem or limitation you are having?
As discussed in #249
we should update the location of module.modulemap
and its content to fit the preference of Darwin-styled framework.
it will support Xcode automatically mapping to Xcode's Framework Search Paths (-F) instead of changing Build Settings of Header Search Paths.
Describe the solution you'd like
- We should update the
module.modulemap
into the right location intoPython.framework/Modules
folder
and update its content to:
framework module Python {
umbrella header "Python.h"
export *
link "Python"
}
-
edit the content in the file
Headers/cpython/pyatomic.h
:- replace
cpython/pyatomic_gcc.h
withpyatomic_gcc.h
- replace
cpython/pyatomic_std.h
withpyatomic_std.h
- replace
cpython/pyatomic_msc.h
withpyatomic_msc.h
- replace
-
Delete the setting of Target - Build settings - Search path - Header Search Paths in Xcode
Describe alternatives you've considered
Keep current design, but notice developer to adjust Target - Build settings - Search path - Header Search Paths to $(BUILT_PRODUCTS_DIR)/Python.framework/Headers
in Xcode.
Additional context
the difference between framework module a non-framework module is:
https://chatgpt.com/share/67b02a23-00d8-8004-abdc-f21bf070b7c5
the difference between framework modulemap and non-framework modulemap module is:
https://chatgpt.com/share/67b029dd-5ae4-8004-a4ab-7a0c37db8f11
The right location of framework modulemap is also documented on clang website:
- make sure the framework modulemap file in the
Python.framework/Modules
folder hasframework
keyword andlink "python"
line as:
framework module Python {
umbrella header "Python.h"
export *
link "Python"
}
-
Delete the setting of Target - Build settings - Search path - Header Search Paths in Xcode
-
Click
Product
->Clear Build Folder...
and build it again,
the100 warnings
about headers will disappear on macOS.
I have tried several times upon my own instructions on macOS
https://www.notion.so/frogcjn/Swift-with-Python-Step-by-Step-1984959764ca80999f25cf9897df83bc