From 255136fc1dd040fd51b346b459d2d8fb8d1f895e Mon Sep 17 00:00:00 2001 From: Zachary DeVito Date: Tue, 5 Feb 2019 22:36:48 -0800 Subject: [PATCH] fix BUILD_CAFFE2_OPS Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/16783 Differential Revision: D13965061 Pulled By: zdevito fbshipit-source-id: 6fe710ca51e2f338873b56f23256668ca3fe2032 --- torch/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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