pytorch/tools/code_analyzer/CMakeLists.txt
Jiakai Liu e0a5b443d6 [pytorch] remove unused flags from code analyzer & move format support to python (#37393)
Summary:
Pull Request resolved: https://github.com/pytorch/pytorch/pull/37393

Simplify the code analyzer by removing some unused flags and moving the
different format printer logic to python script. It's easier to add other
post processing logic to adapt to different BUCK build configs.

Test Plan: Imported from OSS

Differential Revision: D21280836

Pulled By: ljk53

fbshipit-source-id: 0d66d5891d850f012c4ab4f39eabbd9aecc1caa9
2020-04-28 17:16:55 -07:00

22 lines
510 B
CMake

cmake_minimum_required(VERSION 3.1)
project(code_analyzer)
set(CMAKE_CXX_STANDARD 14)
find_package(LLVM REQUIRED CONFIG)
add_definitions(${LLVM_DEFINITIONS})
include_directories(${LLVM_INCLUDE_DIRS})
link_directories(${LLVM_LIBRARY_DIRS})
# Main executable
add_executable(analyzer
analyzer.cpp
op_deps_pass.cpp
)
set_target_properties(analyzer PROPERTIES
COMPILE_FLAGS "-fno-rtti -O3")
llvm_map_components_to_libnames(llvm_libs core irreader support)
target_link_libraries(analyzer ${llvm_libs})