Add CMake support for 'edis'.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101177 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Ted Kremenek 2010-04-13 20:52:50 +00:00
parent 8a87ffb925
commit 0a6f053732
4 changed files with 44 additions and 0 deletions

View File

@ -31,6 +31,7 @@ add_subdirectory(llvm-extract)
add_subdirectory(bugpoint)
add_subdirectory(llvm-bcanalyzer)
add_subdirectory(llvm-stub)
add_subdirectory(edis)
add_subdirectory(llvmc)
if( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/clang/CMakeLists.txt )

41
tools/edis/CMakeLists.txt Normal file
View File

@ -0,0 +1,41 @@
set(SHARED_LIBRARY TRUE)
set(LLVM_NO_RTTI 1)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/EDInfo.inc
COMMAND ${LLVM_TABLEGEN_EXE} -o ${CMAKE_CURRENT_BINARY_DIR}/EDInfo.inc
-gen-enhanced-disassembly-header ${CMAKE_CURRENT_SOURCE_DIR}/EDInfo.td
DEPENDS tblgen
COMMENT "Building enhanced disassembly semantic information header (EDInfo.inc)")
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/EDInfo.inc PROPERTIES GENERATED 1)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_llvm_library(EnhancedDisassembly
EDDisassembler.cpp
EDInst.cpp
EDMain.cpp
EDOperand.cpp
EDToken.cpp
../../include/llvm-c/EnhancedDisassembly.h
${CMAKE_CURRENT_BINARY_DIR}/EDInfo.inc
)
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
# FIXME: Deal with EDIS version?
set_target_properties(EnhancedDisassembly
PROPERTIES
LINK_FLAGS "-avoid-version -Wl,-exported_symbols_list -Wl,${CMAKE_CURRENT_SOURCE_DIR}/EnhancedDisassembly.exports -Wl,-dead_strip -Wl"
)
endif()
if(MSVC)
# windows.h doesn't compile with /Za
get_target_property(NON_ANSI_COMPILE_FLAGS CIndex COMPILE_FLAGS)
string(REPLACE /Za "" NON_ANSI_COMPILE_FLAGS ${NON_ANSI_COMPILE_FLAGS})
set_target_properties(EnhancedDisassembly PROPERTIES COMPILE_FLAGS ${NON_ANSI_COMPILE_FLAGS})
endif(MSVC)
set_target_properties(EnhancedDisassembly
PROPERTIES
LINKER_LANGUAGE CXX)

1
tools/edis/EDInfo.td Normal file
View File

@ -0,0 +1 @@
// Intentionally empty.

View File

@ -1,3 +1,4 @@
set( LLVM_USED_LIBS EnhancedDisassembly)
set(LLVM_LINK_COMPONENTS ${LLVM_TARGETS_TO_BUILD} support MC MCParser)
add_llvm_tool(llvm-mc