2016-02-14 14:39:11 +08:00
|
|
|
set(LLVM_LINK_COMPONENTS
|
|
|
|
support
|
|
|
|
)
|
|
|
|
|
2010-09-14 07:54:41 +08:00
|
|
|
add_clang_executable(c-index-test
|
|
|
|
c-index-test.c
|
2016-02-14 14:39:11 +08:00
|
|
|
core_main.cpp
|
2010-09-11 05:13:16 +08:00
|
|
|
)
|
|
|
|
|
2012-11-08 07:52:25 +08:00
|
|
|
if(NOT MSVC)
|
|
|
|
set_property(
|
|
|
|
SOURCE c-index-test.c
|
2014-01-08 19:44:42 +08:00
|
|
|
PROPERTY COMPILE_FLAGS "-std=gnu89"
|
2012-11-08 07:52:25 +08:00
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2014-11-05 22:04:25 +08:00
|
|
|
if (LLVM_BUILD_STATIC)
|
|
|
|
target_link_libraries(c-index-test
|
|
|
|
libclang_static
|
2016-02-14 14:39:11 +08:00
|
|
|
clangIndex
|
2012-06-21 09:30:21 +08:00
|
|
|
)
|
2014-11-05 22:04:25 +08:00
|
|
|
else()
|
|
|
|
target_link_libraries(c-index-test
|
|
|
|
libclang
|
2016-02-14 14:39:11 +08:00
|
|
|
clangIndex
|
2014-11-05 22:04:25 +08:00
|
|
|
)
|
|
|
|
endif()
|
2012-06-21 09:30:21 +08:00
|
|
|
|
2009-10-06 06:29:42 +08:00
|
|
|
set_target_properties(c-index-test
|
|
|
|
PROPERTIES
|
|
|
|
LINKER_LANGUAGE CXX)
|
2012-08-08 01:54:38 +08:00
|
|
|
|
|
|
|
# If libxml2 is available, make it available for c-index-test.
|
2012-12-15 02:30:20 +08:00
|
|
|
if (CLANG_HAVE_LIBXML)
|
2013-07-09 19:14:30 +08:00
|
|
|
include_directories(SYSTEM ${LIBXML2_INCLUDE_DIR})
|
2012-08-08 01:54:38 +08:00
|
|
|
target_link_libraries(c-index-test ${LIBXML2_LIBRARIES})
|
|
|
|
endif()
|
2015-11-12 08:46:57 +08:00
|
|
|
|
2015-11-14 06:41:14 +08:00
|
|
|
if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
|
|
|
|
if(INTERNAL_INSTALL_PREFIX)
|
|
|
|
set(INSTALL_DESTINATION "${INTERNAL_INSTALL_PREFIX}/bin")
|
|
|
|
else()
|
|
|
|
set(INSTALL_DESTINATION bin)
|
|
|
|
endif()
|
2015-11-13 09:46:18 +08:00
|
|
|
|
2015-11-14 06:41:14 +08:00
|
|
|
install(TARGETS c-index-test
|
|
|
|
RUNTIME DESTINATION "${INSTALL_DESTINATION}"
|
|
|
|
COMPONENT c-index-test)
|
2015-11-13 09:46:18 +08:00
|
|
|
|
2015-11-14 06:41:14 +08:00
|
|
|
if (NOT CMAKE_CONFIGURATION_TYPES) # don't add this for IDE's.
|
|
|
|
add_custom_target(install-c-index-test
|
|
|
|
DEPENDS c-index-test
|
|
|
|
COMMAND "${CMAKE_COMMAND}"
|
|
|
|
-DCMAKE_INSTALL_COMPONENT=c-index-test
|
|
|
|
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake")
|
|
|
|
endif()
|
2015-11-13 09:46:18 +08:00
|
|
|
endif()
|