Skip to content

Commit 995db0d

Browse files
zzl0facebook-github-bot
authored andcommitted
pycext: add 'stdlib' flag for macOS
Summary: this diff fixes below error: ``` running: "clang++" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "--target=x86_64-apple-darwin" "-mmacosx-version-min=10.7" "-I" "/usr/local/opt/[email protected]/Frameworks/Python.framework/Versions/3.11/include/python3.11" "-Wall" "-Wextra" "-std=c++11" "-Wno-unused-function" "-fno-common" "-dynamic" "-DNDEBUG" "-g" "-fwrapv" "-O3" "-isysroot" "/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk" "-isysroot" "/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk" "-o" "/private/tmp/sapling-20231113-5024-krmhw6/eden/scm/build/cargo-target/x86_64-apple-darwin/release/build/pycext-4bf2458160d01796/out/713ff949e19e1a67-traceprofimpl.o" "-c" "../../../../sapling/cext/../ext/extlib/traceprofimpl.cpp" cargo:warning=clang: warning: include path for libstdc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found] cargo:warning=../../../../sapling/cext/../ext/extlib/traceprofimpl.cpp:16:10: fatal error: 'algorithm' file not found cargo:warning=#include <algorithm> cargo:warning= ^~~~~~~~~~~ cargo:warning=1 error generated. ``` Reviewed By: quark-zju Differential Revision: D51282333 fbshipit-source-id: 55adf8870b14d2c0d7897e342f99d6dfed3db4ad
1 parent 3143b7c commit 995db0d

File tree

1 file changed

+3
-0
lines changed
  • eden/scm/saplingnative/bindings/modules/pycext

1 file changed

+3
-0
lines changed

eden/scm/saplingnative/bindings/modules/pycext/build.rs

+3
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ fn main() {
9999
if !cfg!(windows) {
100100
c.flag("-std=c++11").flag("-Wno-unused-function");
101101
}
102+
if cfg!(target_os = "macos") {
103+
c.flag("-stdlib=libc++");
104+
}
102105
config.add_python_flags(&mut c);
103106
c.compile("traceprofimpl");
104107

0 commit comments

Comments
 (0)