diff options
author | Jonathan Roelofs <jonathan@codesourcery.com> | 2015-11-09 16:12:56 +0000 |
---|---|---|
committer | Jonathan Roelofs <jonathan@codesourcery.com> | 2015-11-09 16:12:56 +0000 |
commit | e961432ae7e1c9152ecb936f7bf3b450ef35012b (patch) | |
tree | 3435496f84d7ccbf469a7cc47c782e146d74ceac /clang/tools/scan-view | |
parent | cc87e3bdc2ec2e12c2f278f2ae6e049ea875f8be (diff) | |
download | bcm5719-llvm-e961432ae7e1c9152ecb936f7bf3b450ef35012b.tar.gz bcm5719-llvm-e961432ae7e1c9152ecb936f7bf3b450ef35012b.zip |
Create install targets for scan-build and scan-view
http://reviews.llvm.org/D14403
llvm-svn: 252474
Diffstat (limited to 'clang/tools/scan-view')
-rw-r--r-- | clang/tools/scan-view/CMakeLists.txt | 33 | ||||
-rw-r--r-- | clang/tools/scan-view/Makefile | 37 | ||||
-rw-r--r-- | clang/tools/scan-view/Reporter.py | 4 | ||||
-rw-r--r-- | clang/tools/scan-view/ScanView.py | 2 |
4 files changed, 73 insertions, 3 deletions
diff --git a/clang/tools/scan-view/CMakeLists.txt b/clang/tools/scan-view/CMakeLists.txt new file mode 100644 index 00000000000..bfff39d11fc --- /dev/null +++ b/clang/tools/scan-view/CMakeLists.txt @@ -0,0 +1,33 @@ +add_custom_target(scan-view ALL) + +option(CLANG_INSTALL_SCANVIEW "Install the scan-view tool" ON) + +set(BinFiles + Reporter.py + ScanView.py + scan-view + startfile.py) + +file(GLOB ResourceFiles Resources/*) + +if(CLANG_INSTALL_SCANVIEW) + foreach(BinFile ${BinFiles}) + add_custom_command(TARGET scan-view PRE_BUILD + COMMAND ${CMAKE_COMMAND} -E make_directory + ${CMAKE_BINARY_DIR}/bin + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_SOURCE_DIR}/${BinFile} + ${CMAKE_BINARY_DIR}/bin/) + install(PROGRAMS ${BinFile} DESTINATION bin) + endforeach() + + foreach(ResourceFile ${ResourceFiles}) + add_custom_command(TARGET scan-view PRE_BUILD + COMMAND ${CMAKE_COMMAND} -E make_directory + ${CMAKE_BINARY_DIR}/share/scan-view + COMMAND ${CMAKE_COMMAND} -E copy + ${ResourceFile} + ${CMAKE_BINARY_DIR}/share/scan-view/) + install(FILES ${ResourceFile} DESTINATION share/scan-view) + endforeach() +endif() diff --git a/clang/tools/scan-view/Makefile b/clang/tools/scan-view/Makefile new file mode 100644 index 00000000000..c2ca453cc98 --- /dev/null +++ b/clang/tools/scan-view/Makefile @@ -0,0 +1,37 @@ +##===- tools/scan-view/Makefile ----------------------------*- Makefile -*-===## +# +# The LLVM Compiler Infrastructure +# +# This file is distributed under the University of Illinois Open Source +# License. See LICENSE.TXT for details. +# +##===----------------------------------------------------------------------===## + +CLANG_LEVEL := ../.. + +include $(CLANG_LEVEL)/../../Makefile.config +include $(CLANG_LEVEL)/Makefile + +CLANG_INSTALL_SCANVIEW ?= 1 + +ifeq ($(CLANG_INSTALL_SCANVIEW), 1) + InstallTargets := $(ToolDir)/Reporter.py \ + $(ToolDir)/ScanView.py \ + $(ToolDir)/scan-view \ + $(ToolDir)/startfile.py \ + $(ShareDir)/scan-view/FileRadar.scpt \ + $(ShareDir)/scan-view/GetRadarVersion.scpt \ + $(ShareDir)/scan-view/bugcatcher.ico +endif + +all:: $(InstallTargets) + +$(ToolDir)/%: % Makefile $(ToolDir)/.dir + $(Echo) "Copying $(notdir $<) to the 'bin' directory..." + $(Verb)cp $< $@ + $(Verb)chmod +x $@ + +$(ShareDir)/scan-view/%: Resources/% Makefile $(ShareDir)/scan-view/.dir + $(Echo) "Copying $(notdir $<) to the 'share' directory..." + $(Verb)cp $< $@ + diff --git a/clang/tools/scan-view/Reporter.py b/clang/tools/scan-view/Reporter.py index 9560fc1aabb..294e05b44c2 100644 --- a/clang/tools/scan-view/Reporter.py +++ b/clang/tools/scan-view/Reporter.py @@ -175,7 +175,7 @@ class RadarReporter: @staticmethod def isAvailable(): # FIXME: Find this .scpt better - path = os.path.join(os.path.dirname(__file__),'Resources/GetRadarVersion.scpt') + path = os.path.join(os.path.dirname(__file__),'../share/scan-view/GetRadarVersion.scpt') try: p = subprocess.Popen(['osascript',path], stdout=subprocess.PIPE, stderr=subprocess.PIPE) @@ -206,7 +206,7 @@ class RadarReporter: if not componentVersion.strip(): componentVersion = 'X' - script = os.path.join(os.path.dirname(__file__),'Resources/FileRadar.scpt') + script = os.path.join(os.path.dirname(__file__),'../share/scan-view/FileRadar.scpt') args = ['osascript', script, component, componentVersion, classification, personID, report.title, report.description, diagnosis, config] + map(os.path.abspath, report.files) # print >>sys.stderr, args diff --git a/clang/tools/scan-view/ScanView.py b/clang/tools/scan-view/ScanView.py index ee08baa8bad..2336b090d96 100644 --- a/clang/tools/scan-view/ScanView.py +++ b/clang/tools/scan-view/ScanView.py @@ -73,7 +73,7 @@ kReportReplacements.append((re.compile('<!-- REPORTSUMMARYEXTRA -->'), ### # Other simple parameters -kResources = posixpath.join(posixpath.dirname(__file__), 'Resources') +kResources = posixpath.join(posixpath.dirname(__file__), '../share/scan-view') kConfigPath = os.path.expanduser('~/.scanview.cfg') ### |