File tree Expand file tree Collapse file tree 1 file changed +21
-9
lines changed Expand file tree Collapse file tree 1 file changed +21
-9
lines changed Original file line number Diff line number Diff line change @@ -716,15 +716,27 @@ if(EXECUTORCH_BUILD_PYBIND)
716716 endif()
717717
718718 # compile options for pybind
719- set(_pybind_compile_options
720- -Wno-deprecated-declarations
721- -fPIC
722- -frtti
723- -fexceptions
724- # libtorch is built with the old ABI, so we need to do the same for any
725- # .cpp files that include torch, c10, or ATen targets.
726- -D_GLIBCXX_USE_CXX11_ABI=0
727- )
719+ if(EXECUTORCH_DO_NOT_USE_CXX11_ABI)
720+ set(_pybind_compile_options
721+ -Wno-deprecated-declarations
722+ -fPIC
723+ -frtti
724+ -fexceptions
725+ # libtorch is built with the old ABI, so we need to do the same for any
726+ # .cpp files that include torch, c10, or ATen targets. Note that PyTorch
727+ # nightly binary is built with _GLIBCXX_USE_CXX11_ABI set to 0 while its
728+ # CI build sets this to 1 (default)
729+ -D_GLIBCXX_USE_CXX11_ABI=0
730+ )
731+ else()
732+ set(_pybind_compile_options
733+ -Wno-deprecated-declarations
734+ -fPIC
735+ -frtti
736+ -fexceptions
737+ )
738+ endif()
739+
728740 # util lib
729741 add_library(
730742 util ${CMAKE_CURRENT_SOURCE_DIR}/extension/evalue_util/print_evalue.cpp
You can’t perform that action at this time.
0 commit comments