Skip to content

Commit

Permalink
Refactor llvm_libs setup
Browse files Browse the repository at this point in the history
  • Loading branch information
benquike committed Feb 28, 2021
1 parent 3314caf commit ae359f4
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 20 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ if(NOT COMMAND add_llvm_library)
add_definitions(${LLVM_DEFINITIONS})
include_directories(SYSTEM ${LLVM_INCLUDE_DIRS})

if (LLVM_LINK_LLVM_DYLIB)
set(llvm_libs LLVM)
else()
llvm_map_components_to_libnames(llvm_libs bitwriter core ipo irreader instcombine instrumentation target linker analysis scalaropts support transformutils)
endif()

else()
message(FATAL_ERROR "\
WARNING: The LLVM_DIR var was not set (required for an out-of-source build)!\n\
Expand Down
5 changes: 0 additions & 5 deletions tools/DDA/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ if(DEFINED IN_SOURCE_BUILD)
set(LLVM_LINK_COMPONENTS BitWriter Core IPO IrReader InstCombine Instrumentation Target Linker Analysis ScalarOpts Support Svf Cudd)
add_llvm_tool( dvf dda.cpp )
else()
if (LLVM_LINK_LLVM_DYLIB)
set(llvm_libs LLVM)
else()
llvm_map_components_to_libnames(llvm_libs BitWriter Core IPO IrReader InstCombine Instrumentation Target Linker Analysis ScalarOpts Support TransformUtils)
endif()
add_executable( dvf dda.cpp )

target_link_libraries( dvf Svf Cudd ${llvm_libs} )
Expand Down
5 changes: 0 additions & 5 deletions tools/Example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ if(DEFINED IN_SOURCE_BUILD)
set(LLVM_LINK_COMPONENTS BitWriter Core IPO IrReader InstCombine Instrumentation Target Linker Analysis ScalarOpts Support Svf Cudd)
add_llvm_tool( svf-ex svf-ex.cpp )
else()
if (LLVM_LINK_LLVM_DYLIB)
set(llvm_libs LLVM)
else()
llvm_map_components_to_libnames(llvm_libs BitWriter Core IPO IrReader InstCombine Instrumentation Target Linker Analysis ScalarOpts Support TransformUtils)
endif()
add_executable( svf-ex svf-ex.cpp )

target_link_libraries( svf-ex Svf Cudd ${llvm_libs} )
Expand Down
5 changes: 0 additions & 5 deletions tools/SABER/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ if(DEFINED IN_SOURCE_BUILD)
set(LLVM_LINK_COMPONENTS BitWriter Core IPO IrReader InstCombine Instrumentation Target Linker Analysis ScalarOpts Support Svf Cudd)
add_llvm_tool( saber saber.cpp )
else()
if (LLVM_LINK_LLVM_DYLIB)
set(llvm_libs LLVM)
else()
llvm_map_components_to_libnames(llvm_libs BitWriter Core IPO IrReader InstCombine Instrumentation Target Linker Analysis ScalarOpts Support TransformUtils)
endif()
add_executable( saber saber.cpp )

target_link_libraries( saber Svf Cudd ${llvm_libs})
Expand Down
5 changes: 0 additions & 5 deletions tools/WPA/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,6 @@ if(DEFINED IN_SOURCE_BUILD)
set(LLVM_LINK_COMPONENTS BitWriter Core IPO IrReader InstCombine Instrumentation Target Linker Analysis ScalarOpts Support Svf Cudd)
add_llvm_tool( wpa wpa.cpp )
else()
if (LLVM_LINK_LLVM_DYLIB)
set(llvm_libs LLVM)
else()
llvm_map_components_to_libnames(llvm_libs bitwriter core ipo irreader instcombine instrumentation target linker analysis scalaropts support transformutils)
endif()
add_executable( wpa wpa.cpp )

target_link_libraries( wpa Svf Cudd ${llvm_libs} )
Expand Down

0 comments on commit ae359f4

Please sign in to comment.