• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Basic CMake setup
2cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
3project(custom_ops)
4
5if(USE_ROCM)
6include(utils)
7include(LoadHIP)
8endif()
9find_package(Torch REQUIRED)
10
11add_library(custom_ops SHARED op.cpp)
12set_property(TARGET custom_ops PROPERTY CXX_STANDARD 17)
13
14target_compile_features(custom_ops PUBLIC cxx_range_for)
15target_link_libraries(custom_ops "${TORCH_LIBRARIES}")
16target_compile_definitions(custom_ops PRIVATE custom_ops_EXPORTS)
17
18add_executable(test_custom_ops test_custom_ops.cpp)
19set_property(TARGET test_custom_ops PROPERTY CXX_STANDARD 17)
20target_link_libraries(test_custom_ops custom_ops)
21