浏览代码

Enable versioning for all tools (#2324)

Helena Kotas 6 年之前
父节点
当前提交
35fa5073b3

+ 14 - 15
cmake/modules/AddLLVM.cmake

@@ -305,6 +305,20 @@ function(set_windows_version_resource_properties name resource_file)
                "RC_INTERNAL_NAME=\"${name}\""
                "RC_PRODUCT_NAME=\"${ARG_PRODUCT_NAME}\""
                "RC_PRODUCT_VERSION=\"${ARG_VERSION_STRING}\"")
+
+  # HLSL change begin - set common version
+  if(${HLSL_EMBED_VERSION})
+    if (DEFINED resource_file)
+      add_dependencies(${name} hlsl_version_autogen)
+      set_property(SOURCE ${resource_file}
+                  PROPERTY COMPILE_DEFINITIONS
+                  "INCLUDE_HLSL_VERSION_FILE=1")
+      set_property(SOURCE ${resource_file}
+                  PROPERTY COMPILE_OPTIONS
+                  "/I" "${HLSL_VERSION_LOCATION}")
+    endif (DEFINED resource_file)
+  endif(${HLSL_EMBED_VERSION})
+  # HLSL change ends
 endfunction(set_windows_version_resource_properties)
 
 # llvm_add_library(name sources...
@@ -951,18 +965,3 @@ function(add_lit_testsuites project directory)
     endforeach()
   endif()
 endfunction()
-
-# HLSL Change Starts
-function(hlsl_update_product_ver RC_INTERNAL_NAME)
-  if(HLSL_EMBED_VERSION)
-    set_property(SOURCE ${windows_resource_file}
-                 PROPERTY COMPILE_DEFINITIONS
-                 "INCLUDE_HLSL_VERSION_FILE=1"
-                 "RC_INTERNAL_NAME=\"${RC_INTERNAL_NAME}\"")
-    set_property(SOURCE ${windows_resource_file}
-                 PROPERTY COMPILE_OPTIONS
-                 "/I" "${HLSL_VERSION_LOCATION}")
-    add_dependencies(${RC_INTERNAL_NAME} hlsl_version_autogen)
-  endif(HLSL_EMBED_VERSION)
-endfunction(hlsl_update_product_ver)
-# HLSL Change Ends

+ 0 - 1
tools/clang/tools/dxc/CMakeLists.txt

@@ -32,7 +32,6 @@ if(ENABLE_SPIRV_CODEGEN)
 endif()
 
 set_target_properties(dxc PROPERTIES VERSION ${CLANG_EXECUTABLE_VERSION})
-hlsl_update_product_ver("dxc")
 
 if (WIN32)
   include_directories(AFTER ${DIASDK_INCLUDE_DIRS})

+ 0 - 2
tools/clang/tools/dxcompiler/CMakeLists.txt

@@ -130,5 +130,3 @@ set_target_properties(dxcompiler
   OUTPUT_NAME "dxcompiler"
   VERSION ${LIBCLANG_LIBRARY_VERSION}
   DEFINE_SYMBOL _CINDEX_LIB_)
-
-hlsl_update_product_ver("dxcompiler")

+ 0 - 2
tools/clang/tools/dxrfallbackcompiler/CMakeLists.txt

@@ -67,5 +67,3 @@ set_target_properties(dxrfallbackcompiler
   OUTPUT_NAME "dxrfallbackcompiler"
   VERSION ${LIBCLANG_LIBRARY_VERSION}
   DEFINE_SYMBOL _CINDEX_LIB_)
-
-hlsl_update_product_ver("dxrfallbackcompiler")

+ 0 - 1
tools/clang/unittests/dxc_batch/CMakeLists.txt

@@ -28,7 +28,6 @@ target_link_libraries(dxc_batch
   )
 
 set_target_properties(dxc PROPERTIES VERSION ${CLANG_EXECUTABLE_VERSION})
-hlsl_update_product_ver("dxc_batch")
 
 include_directories(AFTER ${DIASDK_INCLUDE_DIRS})