OLD | NEW |
1 cmake_minimum_required(VERSION 2.8.8) | 1 cmake_minimum_required(VERSION 2.8.8) |
2 project(BlinkGCPlugin) | 2 project(ChromeExtras) |
| 3 enable_testing() |
3 | 4 |
4 # This pugin is built using LLVM's build system, not Chromium's. | 5 list(APPEND CMAKE_MODULE_PATH "${LLVM_BUILD_DIR}/share/llvm/cmake") |
| 6 |
| 7 # These tools are built using LLVM's build system, not Chromium's. |
5 # It expects LLVM_SRC_DIR and LLVM_BUILD_DIR to be set. | 8 # It expects LLVM_SRC_DIR and LLVM_BUILD_DIR to be set. |
6 # For example: | 9 # For example: |
7 # | 10 # |
8 # cmake -GNinja \ | 11 # cmake -GNinja \ |
9 # -DLLVM_BUILD_DIR=$CHROMIUM_SRC_DIR/third_party/llvm-build/Release+Asserts \ | 12 # -DLLVM_BUILD_DIR=$CHROMIUM_SRC_DIR/third_party/llvm-build/Release+Asserts \ |
10 # -DLLVM_SRC_DIR=$CHROMIUM_SRC_DIR/third_party/llvm \ | 13 # -DLLVM_SRC_DIR=$CHROMIUM_SRC_DIR/third_party/llvm \ |
11 # $CHROMIUM_SRC_DIR/tools/clang/blink_gc_plugin/ | 14 # -DCHROMIUM_TOOLS=blink_gc_plugin;plugin \ |
| 15 # $CHROMIUM_SRC_DIR/tools/clang/ |
12 # ninja | 16 # ninja |
13 | 17 |
14 | 18 |
15 list(APPEND CMAKE_MODULE_PATH "${LLVM_BUILD_DIR}/share/llvm/cmake") | |
16 | |
17 include(LLVMConfig) | 19 include(LLVMConfig) |
18 include(AddLLVM) | 20 include(AddLLVM) |
19 include(HandleLLVMOptions) | 21 include(HandleLLVMOptions) |
20 | 22 |
21 # Use rpath to find the bundled standard C++ library. | 23 # Use rpath to find the bundled standard C++ library. |
22 set(CMAKE_BUILD_WITH_INSTALL_RPATH ON) | 24 set(CMAKE_BUILD_WITH_INSTALL_RPATH ON) |
23 if (APPLE) | 25 if (APPLE) |
24 set(CMAKE_INSTALL_NAME_DIR "@rpath") | 26 set(CMAKE_INSTALL_NAME_DIR "@rpath") |
25 set(CMAKE_INSTALL_RPATH "@executable_path/../lib") | 27 set(CMAKE_INSTALL_RPATH "@executable_path/../lib") |
26 else(UNIX) | 28 else(UNIX) |
27 set(CMAKE_INSTALL_RPATH "\$ORIGIN/../lib") | 29 set(CMAKE_INSTALL_RPATH "\$ORIGIN/../lib") |
28 endif() | 30 endif() |
29 | 31 |
30 set(LLVM_RUNTIME_OUTPUT_INTDIR "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin") | 32 set(LLVM_RUNTIME_OUTPUT_INTDIR "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/bin") |
31 set(LLVM_LIBRARY_OUTPUT_INTDIR "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib") | 33 set(LLVM_LIBRARY_OUTPUT_INTDIR "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib") |
32 | 34 |
33 include_directories("${LLVM_SRC_DIR}/include" | 35 include_directories("${LLVM_SRC_DIR}/include" |
34 "${LLVM_SRC_DIR}/tools/clang/include" | 36 "${LLVM_SRC_DIR}/tools/clang/include" |
35 "${LLVM_BUILD_DIR}/include" | 37 "${LLVM_BUILD_DIR}/include" |
36 "${LLVM_BUILD_DIR}/tools/clang/include") | 38 "${LLVM_BUILD_DIR}/tools/clang/include") |
37 | 39 |
38 # This line is read by update.sh and other scripts in tools/clang/scripts | 40 link_directories("${LLVM_SRC_DIR}/lib" |
39 # Note: The spaces are significant. | 41 "${LLVM_SRC_DIR}/tools/clang/lib" |
40 set(LIBRARYNAME BlinkGCPlugin_12) | 42 "${LLVM_BUILD_DIR}/lib" |
| 43 "${LLVM_BUILD_DIR}/tools/clang/lib") |
41 | 44 |
42 add_llvm_loadable_module("lib${LIBRARYNAME}" | 45 # cr_add_test( |
43 BlinkGCPlugin.cpp | 46 # name |
44 Edge.cpp | 47 # testprog |
45 RecordInfo.cpp | 48 # arguments... |
46 ) | 49 # ) |
| 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) |
| 54 |
| 55 # Tests for all enabled tools can be run by building this target. |
| 56 add_custom_target(check-all COMMAND ${CMAKE_CTEST_COMMAND} -V) |
| 57 |
| 58 foreach(tool ${CHROMIUM_TOOLS}) |
| 59 add_subdirectory(${tool}) |
| 60 endforeach(tool) |
OLD | NEW |