llvm.org GIT mirror llvm / 0a6f053
Add CMake support for 'edis'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101177 91177308-0d34-0410-b5e6-96231b3b80d8 Ted Kremenek 9 years ago
4 changed file(s) with 44 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
3030 add_subdirectory(bugpoint)
3131 add_subdirectory(llvm-bcanalyzer)
3232 add_subdirectory(llvm-stub)
33 add_subdirectory(edis)
3334 add_subdirectory(llvmc)
3435
3536 if( EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/clang/CMakeLists.txt )
0 set(SHARED_LIBRARY TRUE)
1 set(LLVM_NO_RTTI 1)
2
3 add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/EDInfo.inc
4 COMMAND ${LLVM_TABLEGEN_EXE} -o ${CMAKE_CURRENT_BINARY_DIR}/EDInfo.inc
5 -gen-enhanced-disassembly-header ${CMAKE_CURRENT_SOURCE_DIR}/EDInfo.td
6 DEPENDS tblgen
7 COMMENT "Building enhanced disassembly semantic information header (EDInfo.inc)")
8 set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/EDInfo.inc PROPERTIES GENERATED 1)
9
10 include_directories(${CMAKE_CURRENT_BINARY_DIR})
11
12 add_llvm_library(EnhancedDisassembly
13 EDDisassembler.cpp
14 EDInst.cpp
15 EDMain.cpp
16 EDOperand.cpp
17 EDToken.cpp
18 ../../include/llvm-c/EnhancedDisassembly.h
19 ${CMAKE_CURRENT_BINARY_DIR}/EDInfo.inc
20 )
21
22 if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
23 # FIXME: Deal with EDIS version?
24 set_target_properties(EnhancedDisassembly
25 PROPERTIES
26 LINK_FLAGS "-avoid-version -Wl,-exported_symbols_list -Wl,${CMAKE_CURRENT_SOURCE_DIR}/EnhancedDisassembly.exports -Wl,-dead_strip -Wl"
27 )
28 endif()
29
30 if(MSVC)
31 # windows.h doesn't compile with /Za
32 get_target_property(NON_ANSI_COMPILE_FLAGS CIndex COMPILE_FLAGS)
33 string(REPLACE /Za "" NON_ANSI_COMPILE_FLAGS ${NON_ANSI_COMPILE_FLAGS})
34 set_target_properties(EnhancedDisassembly PROPERTIES COMPILE_FLAGS ${NON_ANSI_COMPILE_FLAGS})
35 endif(MSVC)
36
37 set_target_properties(EnhancedDisassembly
38 PROPERTIES
39 LINKER_LANGUAGE CXX)
40
0 // Intentionally empty.
0 set( LLVM_USED_LIBS EnhancedDisassembly)
1 set(LLVM_LINK_COMPONENTS ${LLVM_TARGETS_TO_BUILD} support MC MCParser)
12
23 add_llvm_tool(llvm-mc