1 cmake_minimum_required(VERSION 2.8.8)
5 list(APPEND CMAKE_MODULE_PATH "${LLVM_BUILD_DIR}/share/llvm/cmake")
7 # These tools are built using LLVM's build system, not Chromium's.
8 # It expects LLVM_SRC_DIR and LLVM_BUILD_DIR to be set.
12 # -DLLVM_BUILD_DIR=$CHROMIUM_SRC_DIR/third_party/llvm-build/Release+Asserts \
13 # -DLLVM_SRC_DIR=$CHROMIUM_SRC_DIR/third_party/llvm \
14 # -DCHROMIUM_TOOLS=blink_gc_plugin;plugin \
15 # $CHROMIUM_SRC_DIR/tools/clang/
21 include(HandleLLVMOptions)
23 # Use rpath to find the bundled standard C++ library.
24 set(CMAKE_BUILD_WITH_INSTALL_RPATH ON)
26 set(CMAKE_INSTALL_NAME_DIR "@rpath")
27 set(CMAKE_INSTALL_RPATH "@executable_path/../lib")
29 set(CMAKE_INSTALL_RPATH "\$ORIGIN/../lib")
32 set(LLVM_RUNTIME_OUTPUT_INTDIR "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin")
33 set(LLVM_LIBRARY_OUTPUT_INTDIR "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib")
35 include_directories("${LLVM_SRC_DIR}/include"
36 "${LLVM_SRC_DIR}/tools/clang/include"
37 "${LLVM_BUILD_DIR}/include"
38 "${LLVM_BUILD_DIR}/tools/clang/include")
40 link_directories("${LLVM_SRC_DIR}/lib"
41 "${LLVM_SRC_DIR}/tools/clang/lib"
42 "${LLVM_BUILD_DIR}/lib"
43 "${LLVM_BUILD_DIR}/tools/clang/lib")
50 function(cr_add_test name testprog)
51 add_test(NAME ${name} COMMAND ${testprog} ${ARGN})
52 add_dependencies(check-all ${name})
53 endfunction(cr_add_test)
55 # Tests for all enabled tools can be run by building this target.
56 add_custom_target(check-all COMMAND ${CMAKE_CTEST_COMMAND} -V)
58 foreach(tool ${CHROMIUM_TOOLS})
59 add_subdirectory(${tool})