Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions cmake/scripts/std_modulemap_darwin_fix.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ def main():
output_path = sys.argv[1]
sdk = get_sdk_path()
cpp_modulemap = os.path.join(sdk, "usr/include/c++/v1/module.modulemap")
if not os.path.exists(cpp_modulemap):
# Try again if we are running a conda build. conda-forge ships the MacOS SDK stripped of libc++.
# Instead, the standard libraries are shipped as a separate package which must be declared as a build
# dependency and thus ends up in the $BUILD_PREFIX path. For explanation, see
# https://conda-forge.zulipchat.com/#narrow/channel/516932-compilers/topic/Organisation.20of.20libc.2B.2B.20and.20SDKs.20on.20MacOS
if (os.environ.get("CONDA_BUILD", "0") == "1") and (os.environ.get("BUILD_PREFIX", None) is not None):
cpp_modulemap = os.path.join(os.environ["BUILD_PREFIX"], "include/c++/v1/module.modulemap")

if not os.path.exists(cpp_modulemap):
raise FileNotFoundError(f"Cannot find libc++ modulemap at {cpp_modulemap}")
Expand Down
Loading