From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: nrudenko <nikita.rudenko@intel.com>
Date: Thu, 11 Jun 2020 15:58:34 +0300
Subject: [PATCH 4/7] Remove LLVMSPIRVLib from targets Rename tool llvm-spirv
 to llvm-spirv-vc

---
 lib/SPIRV/CMakeLists.txt        | 21 ---------------------
 test/CMakeLists.txt             | 12 ------------
 tools/llvm-spirv/CMakeLists.txt |  8 ++------
 3 files changed, 2 insertions(+), 39 deletions(-)

diff --git a/lib/SPIRV/CMakeLists.txt b/lib/SPIRV/CMakeLists.txt
index 0000000..0000000 100755
--- a/lib/SPIRV/CMakeLists.txt
+++ b/lib/SPIRV/CMakeLists.txt
@@ -37,18 +37,6 @@ set(SPIRV_SOURCES
   libSPIRV/SPIRVValue.cpp
 )
 
-add_llvm_library(LLVMSPIRVLib
-  ${SPIRV_SOURCES}
-  LINK_COMPONENTS
-    Analysis
-    BitWriter
-    Core
-    Support
-    TransformUtils
-  DEPENDS
-    intrinsics_gen
-)
-
 # --- mock: add_llvm_library(SPIRVDLL MODULE ---
 # unfortunately this do not work for llvm build system as is so some magic below
 
@@ -74,15 +62,6 @@ set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS SPIRVDLL)
 
 # --- end mock ---
 
-target_include_directories(LLVMSPIRVLib
-  PRIVATE
-    ${LLVM_INCLUDE_DIRS}
-    ${LLVM_SPIRV_INCLUDE_DIRS}
-    ${CMAKE_CURRENT_SOURCE_DIR}
-    ${CMAKE_CURRENT_SOURCE_DIR}/libSPIRV
-    ${CMAKE_CURRENT_SOURCE_DIR}/Mangler
-)
-
 target_include_directories(SPIRVDLL
   PRIVATE
     ${LLVM_INCLUDE_DIRS}
diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 0000000..0000000 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -66,14 +66,6 @@ if(NOT LLVM_SPIRV_BUILD_EXTERNAL)
 endif(NOT LLVM_SPIRV_BUILD_EXTERNAL)
 
 
-add_lit_testsuite(check-llvm-spirv "Running the LLVM-SPIRV regression tests"
-  ${CMAKE_CURRENT_BINARY_DIR}
-  ARGS
-    --verbose
-  DEPENDS
-    ${LLVM_SPIRV_TEST_DEPS}
-    llvm-spirv
-)
 
 # to enable a custom test target on cmake below 3.11
 # starting with 3.11 "test" is only reserved if ENABLE_TESTING(ON)
@@ -82,9 +74,5 @@ if(LLVM_SPIRV_BUILD_EXTERNAL)
   if(POLICY CMP0037 AND ${CMAKE_VERSION} VERSION_LESS "3.11.0")
     cmake_policy(SET CMP0037 OLD)
   endif(POLICY CMP0037 AND ${CMAKE_VERSION} VERSION_LESS "3.11.0")
-  add_custom_target(test
-    DEPENDS
-      check-llvm-spirv
-  )
   cmake_policy(POP)
 endif(LLVM_SPIRV_BUILD_EXTERNAL)
diff --git a/tools/llvm-spirv/CMakeLists.txt b/tools/llvm-spirv/CMakeLists.txt
index 0000000..0000000 100644
--- a/tools/llvm-spirv/CMakeLists.txt
+++ b/tools/llvm-spirv/CMakeLists.txt
@@ -8,17 +8,13 @@ set(LLVM_LINK_COMPONENTS
   TransformUtils
 )
 
-add_llvm_tool(llvm-spirv
+add_llvm_tool(llvm-spirv-vc
   llvm-spirv.cpp
   # llvm_setup_rpath messes with the rpath making llvm-spirv not executable from the build directory
   NO_INSTALL_RPATH
 )
 
-if (LLVM_SPIRV_BUILD_EXTERNAL)
-  target_link_libraries(llvm-spirv PRIVATE LLVMSPIRVLib)
-endif()
-
-target_include_directories(llvm-spirv
+target_include_directories(llvm-spirv-vc
   PRIVATE
     ${LLVM_INCLUDE_DIRS}
     ${LLVM_SPIRV_INCLUDE_DIRS}
-- 
2.17.1

