diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 3a357e1321..cf516b9755 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -219,6 +219,12 @@ if(ENABLE_PYTORCH AND NOT DEEPMD_C_ROOT) set(OP_CXX_ABI ${CMAKE_MATCH_1}) add_definitions(-D_GLIBCXX_USE_CXX11_ABI=${OP_CXX_ABI}) endif() + else() + # Maybe in macos/windows + if(NOT DEFINED OP_CXX_ABI) + set(OP_CXX_ABI 0) + endif() + set(OP_CXX_ABI_PT "${OP_CXX_ABI}") endif() # get torch directory get the directory of the target "torch" get_target_property(_TORCH_LOCATION torch LOCATION)