diff --git a/CMakeLists.txt b/CMakeLists.txt index 46b73f6349..4d3f151085 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -526,7 +526,11 @@ if(EXECUTORCH_BUILD_PYBIND) # compile options for pybind set(_pybind_compile_options -Wno-deprecated-declarations -fPIC -frtti - -fexceptions) + -fexceptions + # libtorch is built with the old ABI, so we need + # to do the same for any .cpp files that include + # torch, c10, or ATen targets. + -D_GLIBCXX_USE_CXX11_ABI=0) # util lib add_library( util