فهرست منبع

moves Dxil DIA support out of dxcompiler (#1772)

* moves Dxil DIA support out of dxcompiler

* fixing travis
John Porto 6 سال پیش
والد
کامیت
8e3fc02435
6فایلهای تغییر یافته به همراه349 افزوده شده و 314 حذف شده
  1. 3 0
      lib/CMakeLists.txt
  2. 18 0
      lib/DxilDia/CMakeLists.txt
  3. 16 0
      lib/DxilDia/LLVMBuild.txt
  4. 297 295
      lib/DxilDia/dxcdia.cpp
  5. 2 1
      lib/LLVMBuild.txt
  6. 13 18
      tools/clang/tools/dxcompiler/CMakeLists.txt

+ 3 - 0
lib/CMakeLists.txt

@@ -24,6 +24,9 @@ add_subdirectory(DxcSupport) # HLSL Change
 add_subdirectory(HLSL) # HLSL Change
 add_subdirectory(DXIL) # HLSL Change
 add_subdirectory(DxilContainer) # HLSL Change
+if(WIN32) # HLSL Change
+  add_subdirectory(DxilDia) # HLSL Change
+endif(WIN32) # HLSL Change
 add_subdirectory(DxilPIXPasses) # HLSL Change
 add_subdirectory(DxilRootSignature) # HLSL Change
 add_subdirectory(DxrFallback) # HLSL Change

+ 18 - 0
lib/DxilDia/CMakeLists.txt

@@ -0,0 +1,18 @@
+# Copyright (C) Microsoft Corporation. All rights reserved.
+# This file is distributed under the University of Illinois Open Source License. See LICENSE.TXT for details.
+
+if (WIN32)
+  find_package(DiaSDK REQUIRED) # Used for constants and declarations.
+endif (WIN32)
+
+add_llvm_library(LLVMDxilDia
+  dxcdia.cpp
+
+  ADDITIONAL_HEADER_DIRS
+  ${LLVM_MAIN_INCLUDE_DIR}/llvm/IR
+)
+
+if (WIN32)
+  target_link_libraries(LLVMDxilDia PRIVATE ${LIBRARIES} ${DIASDK_LIBRARIES})
+  include_directories(AFTER ${LLVM_INCLUDE_DIR}/dxc/Tracing ${DIASDK_INCLUDE_DIRS})
+endif (WIN32)

+ 16 - 0
lib/DxilDia/LLVMBuild.txt

@@ -0,0 +1,16 @@
+; Copyright (C) Microsoft Corporation. All rights reserved.
+; This file is distributed under the University of Illinois Open Source License. See LICENSE.TXT for details.
+;
+; This is an LLVMBuild description file for the components in this subdirectory.
+;
+; For more information on the LLVMBuild system, please see:
+;
+;   http://llvm.org/docs/LLVMBuild.html
+;
+;===------------------------------------------------------------------------===;
+
+[component_0]
+type = Library
+name = DxilDia
+parent = Libraries
+required_libraries = Core DxcSupport Support

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 297 - 295
lib/DxilDia/dxcdia.cpp


+ 2 - 1
lib/LLVMBuild.txt

@@ -41,10 +41,11 @@ subdirectories =
  HLSL
  DXIL
  DxilContainer
+ DxilDia
  DxrFallback
  DxilRootSignature
 
-; HLSL Change: remove LibDriver, LineEditor, add HLSL, DxrtFallback, DXIL, DxilContainer, DxilPIXPasses, DxilRootSignature
+; HLSL Change: remove LibDriver, LineEditor, add HLSL, DxrtFallback, DXIL, DxilContainer, DxilDia, DxilPIXPasses, DxilRootSignature
 
 [component_0]
 type = Group

+ 13 - 18
tools/clang/tools/dxcompiler/CMakeLists.txt

@@ -1,10 +1,6 @@
 # Copyright (C) Microsoft Corporation. All rights reserved.
 # This file is distributed under the University of Illinois Open Source License. See LICENSE.TXT for details.
 
-if (WIN32)
-  find_package(DiaSDK REQUIRED) # Used for constants and declarations.
-endif (WIN32)
-
 set(LLVM_LINK_COMPONENTS
   ${LLVM_TARGETS_TO_BUILD}
   analysis
@@ -48,7 +44,6 @@ if (WIN32)
 set(SOURCES
   dxcapi.cpp
   dxcassembler.cpp
-  dxcdia.cpp
   dxclibrary.cpp
   dxcompilerobj.cpp
   dxcvalidator.cpp
@@ -101,6 +96,12 @@ set(LIBRARIES
   libclang
   )
 
+if(WIN32)
+  set(LIBRARIES
+    ${LIBRARIES} 
+    LLVMDxilDia)
+endif(WIN32)
+
 set(GENERATED_HEADERS
   ClangAttrClasses
   ClangAttrList
@@ -114,20 +115,14 @@ set(GENERATED_HEADERS
 
 add_clang_library(dxcompiler SHARED ${SOURCES})
 if (WIN32)
-  target_link_libraries(dxcompiler PRIVATE ${LIBRARIES} ${DIASDK_LIBRARIES})
-  if (ENABLE_SPIRV_CODEGEN)
-    target_link_libraries(dxcompiler PRIVATE clangSPIRV)
-  endif (ENABLE_SPIRV_CODEGEN)
+  # No DxcEtw on non-Windows platforms.
   add_dependencies(dxcompiler DxcEtw)
-  include_directories(AFTER ${LLVM_INCLUDE_DIR}/dxc/Tracing ${DIASDK_INCLUDE_DIRS})
-else ()
-  # No DIASDK or DxcEtw on non-Windows platforms.
-  target_link_libraries(dxcompiler PRIVATE ${LIBRARIES})
-  if (ENABLE_SPIRV_CODEGEN)
-    target_link_libraries(dxcompiler PRIVATE clangSPIRV)
-  endif (ENABLE_SPIRV_CODEGEN)
-  include_directories(AFTER ${LLVM_INCLUDE_DIR}/dxc/Tracing)
-endif (WIN32)
+endif()
+target_link_libraries(dxcompiler PRIVATE ${LIBRARIES})
+if (ENABLE_SPIRV_CODEGEN)
+  target_link_libraries(dxcompiler PRIVATE clangSPIRV)
+endif (ENABLE_SPIRV_CODEGEN)
+include_directories(AFTER ${LLVM_INCLUDE_DIR}/dxc/Tracing)
 
 set_target_properties(dxcompiler
   PROPERTIES

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است