Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(58)

Side by Side Diff: tools/clang/plugins/CMakeLists.txt

Issue 1072203002: Build the Clang plugin on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: isInSystemHeader Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 add_llvm_loadable_module(libFindBadConstructs 1 set(plugin_sources
2 ChromeClassTester.cpp 2 ChromeClassTester.cpp
3 FindBadConstructsAction.cpp 3 FindBadConstructsAction.cpp
4 FindBadConstructsConsumer.cpp 4 FindBadConstructsConsumer.cpp)
5 )
6 5
7 add_dependencies(libFindBadConstructs clang) 6 if(WIN32)
7 # Clang doesn't support loadable modules on Windows. Unfortunately, building
8 # the plugin as a static library and linking clang against it doesn't work.
9 # Since clang doesn't reference any symbols in our static library, the linker
10 # strips it out completely.
11 # Instead, we rely on the fact that the SOURCES property of a target is no
12 # read-only after CMake 3.1 and use it to compile the plugin directly into
13 # clang...
14 cmake_minimum_required(VERSION 3.1)
15 # Paths must be absolute, since we're modifying a target in another directory.
16 set(absolute_sources "")
17 foreach(source ${plugin_sources})
18 list(APPEND absolute_sources ${CMAKE_CURRENT_SOURCE_DIR}/${source})
19 endforeach()
20 set_property(TARGET clang APPEND PROPERTY SOURCES ${absolute_sources})
21 else()
22 add_llvm_loadable_module(libFindBadConstructs ${plugin_sources})
23 add_dependencies(libFindBadConstructs clang)
8 24
9 cr_install(TARGETS libFindBadConstructs LIBRARY DESTINATION lib) 25 cr_install(TARGETS libFindBadConstructs LIBRARY DESTINATION lib)
10 26
11 cr_add_test(plugins_test 27 cr_add_test(plugins_test
Nico 2015/04/12 04:19:14 Should this get a "TODO: port script to python, ru
dcheng 2015/04/12 06:29:30 Done.
12 ${CMAKE_CURRENT_SOURCE_DIR}/tests/test.sh 28 ${CMAKE_CURRENT_SOURCE_DIR}/tests/test.sh
13 ${CMAKE_BINARY_DIR}/bin/clang 29 ${CMAKE_BINARY_DIR}/bin/clang
14 $<TARGET_FILE:libFindBadConstructs> 30 $<TARGET_FILE:libFindBadConstructs>
15 ) 31 )
32 endif()
OLDNEW
« no previous file with comments | « no previous file | tools/clang/plugins/ChromeClassTester.cpp » ('j') | tools/clang/plugins/ChromeClassTester.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698