diff --git a/torch/CMakeLists.txt b/torch/CMakeLists.txt index 347cb3d58ce..d7678e452be 100644 --- a/torch/CMakeLists.txt +++ b/torch/CMakeLists.txt @@ -135,7 +135,6 @@ set(TORCH_SRCS ${TORCH_SRC_DIR}/csrc/jit/ir.cpp ${TORCH_SRC_DIR}/csrc/jit/operator.cpp ${TORCH_SRC_DIR}/csrc/jit/caffe2_operator.cpp - ${TORCH_SRC_DIR}/csrc/jit/register_caffe2_ops.cpp ${TORCH_SRC_DIR}/csrc/jit/symbolic_script.cpp ${TORCH_SRC_DIR}/csrc/jit/passes/alias_analysis.cpp ${TORCH_SRC_DIR}/csrc/jit/passes/batch_mm.cpp @@ -191,6 +190,11 @@ set(TORCH_SRCS ${TORCH_ROOT}/test/cpp/jit/no-gtest.cpp ) +if (BUILD_CAFFE2_OPS) + list(APPEND TORCH_SRCS + ${TORCH_SRC_DIR}/csrc/jit/register_caffe2_ops.cpp) +endif() + if (WIN32) list(APPEND TORCH_SRCS ${TORCH_SRC_DIR}/csrc/jit/fuser/cpu/dynamic_library_win.cpp