diff options
author | Ted Kremenek <kremenek@apple.com> | 2010-04-13 20:52:50 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2010-04-13 20:52:50 +0000 |
commit | 0a6f053732c7a654cb9fe3e501680a104c3381a1 (patch) | |
tree | 58b9a87f33cde9d14c2eccd15eecd6f2252391f1 | |
parent | 8a87ffb9252d6d66093dcd96f3b9a496dae4a439 (diff) |
Add CMake support for 'edis'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101177 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | tools/CMakeLists.txt | 1 | ||||
-rw-r--r-- | tools/edis/CMakeLists.txt | 41 | ||||
-rw-r--r-- | tools/edis/EDInfo.td | 1 | ||||
-rw-r--r-- | tools/llvm-mc/CMakeLists.txt | 1 |
4 files changed, 44 insertions, 0 deletions
diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 8b5d77e2c4..b9c77b1c8a 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -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 ) diff --git a/tools/edis/CMakeLists.txt b/tools/edis/CMakeLists.txt new file mode 100644 index 0000000000..5f11ab4798 --- /dev/null +++ b/tools/edis/CMakeLists.txt @@ -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) +
\ No newline at end of file diff --git a/tools/edis/EDInfo.td b/tools/edis/EDInfo.td new file mode 100644 index 0000000000..bd9ec079d8 --- /dev/null +++ b/tools/edis/EDInfo.td @@ -0,0 +1 @@ +// Intentionally empty. diff --git a/tools/llvm-mc/CMakeLists.txt b/tools/llvm-mc/CMakeLists.txt index 49c29324d4..8b61a4e8db 100644 --- a/tools/llvm-mc/CMakeLists.txt +++ b/tools/llvm-mc/CMakeLists.txt @@ -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 |