| OLD | NEW |
| 1 cmake_minimum_required(VERSION 2.8.8) | |
| 2 project(BlinkGCPlugin) | |
| 3 | |
| 4 # This pugin is built using LLVM's build system, not Chromium's. | |
| 5 # It expects LLVM_SRC_DIR and LLVM_BUILD_DIR to be set. | |
| 6 # For example: | |
| 7 # | |
| 8 # cmake -GNinja \ | |
| 9 # -DLLVM_BUILD_DIR=$CHROMIUM_SRC_DIR/third_party/llvm-build/Release+Asserts \ | |
| 10 # -DLLVM_SRC_DIR=$CHROMIUM_SRC_DIR/third_party/llvm \ | |
| 11 # $CHROMIUM_SRC_DIR/tools/clang/blink_gc_plugin/ | |
| 12 # ninja | |
| 13 | |
| 14 | |
| 15 list(APPEND CMAKE_MODULE_PATH "${LLVM_BUILD_DIR}/share/llvm/cmake") | |
| 16 | |
| 17 include(LLVMConfig) | |
| 18 include(AddLLVM) | |
| 19 include(HandleLLVMOptions) | |
| 20 | |
| 21 # Use rpath to find the bundled standard C++ library. | |
| 22 set(CMAKE_BUILD_WITH_INSTALL_RPATH ON) | |
| 23 if (APPLE) | |
| 24 set(CMAKE_INSTALL_NAME_DIR "@rpath") | |
| 25 set(CMAKE_INSTALL_RPATH "@executable_path/../lib") | |
| 26 else(UNIX) | |
| 27 set(CMAKE_INSTALL_RPATH "\$ORIGIN/../lib") | |
| 28 endif() | |
| 29 | |
| 30 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") | |
| 32 | |
| 33 include_directories("${LLVM_SRC_DIR}/include" | |
| 34 "${LLVM_SRC_DIR}/tools/clang/include" | |
| 35 "${LLVM_BUILD_DIR}/include" | |
| 36 "${LLVM_BUILD_DIR}/tools/clang/include") | |
| 37 | |
| 38 # This line is read by update.sh and other scripts in tools/clang/scripts | 1 # This line is read by update.sh and other scripts in tools/clang/scripts |
| 39 # Note: The spaces are significant. | 2 # Note: The spaces are significant. |
| 40 set(LIBRARYNAME BlinkGCPlugin_12) | 3 set(LIBRARYNAME BlinkGCPlugin_12) |
| 41 | 4 |
| 42 add_llvm_loadable_module("lib${LIBRARYNAME}" | 5 add_llvm_loadable_module("lib${LIBRARYNAME}" |
| 43 BlinkGCPlugin.cpp | 6 BlinkGCPlugin.cpp |
| 44 Edge.cpp | 7 Edge.cpp |
| 45 RecordInfo.cpp | 8 RecordInfo.cpp |
| 46 ) | 9 ) |
| 10 |
| 11 install(TARGETS "lib${LIBRARYNAME}" LIBRARY DESTINATION lib) |
| 12 |
| 13 cr_add_test(blink_gc_plugin_test |
| 14 ${CMAKE_CURRENT_SOURCE_DIR}/tests/test.sh |
| 15 ${LLVM_BUILD_DIR}/bin/clang |
| 16 $<TARGET_FILE:lib${LIBRARYNAME}> |
| 17 ) |
| OLD | NEW |