|
1 | 1 | # See docs/CMake.html for instructions about how to build LLVM with CMake. |
2 | | -cmake_minimum_required(VERSION 2.8.12.2) |
| 2 | +cmake_minimum_required(VERSION 3.10) # HLSL Change - Require CMake 3.10. |
3 | 3 |
|
4 | 4 | if (NOT "${DXC_CMAKE_BEGINS_INCLUDE}" STREQUAL "") |
5 | 5 | include(${DXC_CMAKE_BEGINS_INCLUDE}) |
@@ -102,7 +102,7 @@ if ( HLSL_SUPPORT_QUERY_GIT_COMMIT_INFO ) |
102 | 102 | endif() |
103 | 103 |
|
104 | 104 | # adjust link option to enable debugging from kernel mode; not compatible with incremental linking |
105 | | -if(NOT CMAKE_VERSION VERSION_LESS "3.13" AND WIN32) |
| 105 | +if(NOT CMAKE_VERSION VERSION_LESS "3.13" AND WIN32 AND NOT CMAKE_C_COMPILER_ARCHITECTURE_ID STREQUAL "ARM64EC") |
106 | 106 | add_link_options(/DEBUGTYPE:CV,FIXUP,PDATA /INCREMENTAL:NO) |
107 | 107 | endif() |
108 | 108 |
|
@@ -408,6 +408,21 @@ if(CMAKE_CROSSCOMPILING OR (LLVM_OPTIMIZED_TABLEGEN AND LLVM_ENABLE_ASSERTIONS)) |
408 | 408 | set(LLVM_USE_HOST_TOOLS ON) |
409 | 409 | endif() |
410 | 410 |
|
| 411 | +if (LLVM_BUILD_INSTRUMENTED OR LLVM_BUILD_INSTRUMENTED_COVERAGE) |
| 412 | + if(NOT LLVM_PROFILE_MERGE_POOL_SIZE) |
| 413 | + # A pool size of 1-2 is probably sufficient on a SSD. 3-4 should be fine |
| 414 | + # for spining disks. Anything higher may only help on slower mediums. |
| 415 | + set(LLVM_PROFILE_MERGE_POOL_SIZE "4") |
| 416 | + endif() |
| 417 | + if(NOT LLVM_PROFILE_FILE_PATTERN) |
| 418 | + if(NOT LLVM_PROFILE_DATA_DIR) |
| 419 | + set(LLVM_PROFILE_FILE_PATTERN "%${LLVM_PROFILE_MERGE_POOL_SIZE}m.profraw") |
| 420 | + else() |
| 421 | + file(TO_NATIVE_PATH "${LLVM_PROFILE_DATA_DIR}/%${LLVM_PROFILE_MERGE_POOL_SIZE}m.profraw" LLVM_PROFILE_FILE_PATTERN) |
| 422 | + endif() |
| 423 | + endif() |
| 424 | +endif() |
| 425 | + |
411 | 426 | # All options referred to from HandleLLVMOptions have to be specified |
412 | 427 | # BEFORE this include, otherwise options will not be correctly set on |
413 | 428 | # first cmake run |
@@ -647,6 +662,12 @@ add_subdirectory(include/dxc) |
647 | 662 | # This over-specifies the dependency graph, but since generating these doesn't |
648 | 663 | # really depend on anything else in the build it is safe. |
649 | 664 | list(APPEND LLVM_COMMON_DEPENDS HCTGen) |
| 665 | + |
| 666 | +if(EXISTS "${LLVM_MAIN_SRC_DIR}/external") |
| 667 | + add_subdirectory(external) # SPIRV change |
| 668 | +endif() |
| 669 | +include_directories(AFTER ${DIRECTX_HEADER_INCLUDE_DIR}/directx ${DIRECTX_HEADER_INCLUDE_DIR}/wsl/stubs) |
| 670 | + |
650 | 671 | # HLSL - Change End |
651 | 672 |
|
652 | 673 | add_subdirectory(lib) |
@@ -687,10 +708,6 @@ if(WITH_POLLY) |
687 | 708 | endif() |
688 | 709 | endif(WITH_POLLY) |
689 | 710 |
|
690 | | -if(EXISTS "${LLVM_MAIN_SRC_DIR}/external") |
691 | | - add_subdirectory(external) # SPIRV change |
692 | | -endif() |
693 | | - |
694 | 711 | if( LLVM_INCLUDE_TOOLS ) |
695 | 712 | add_subdirectory(tools) |
696 | 713 | endif() |
@@ -722,6 +739,7 @@ if( LLVM_INCLUDE_TESTS ) |
722 | 739 | DEPENDS ${LLVM_LIT_DEPENDS} |
723 | 740 | ARGS ${LLVM_LIT_EXTRA_ARGS} |
724 | 741 | ) |
| 742 | + add_custom_target(test-depends DEPENDS ${LLVM_LIT_DEPENDS}) # HLSL Change |
725 | 743 | endif() |
726 | 744 |
|
727 | 745 | if (LLVM_INCLUDE_DOCS) |
@@ -768,6 +786,8 @@ if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY) |
768 | 786 | endif() |
769 | 787 | endif() |
770 | 788 |
|
| 789 | +include(CoverageReport) |
| 790 | + |
771 | 791 | # Disable regeneration target for official builds as they always fun a full clean build. |
772 | 792 | # This should eliminate the race-condition issue with "Cannot restore timestamp". |
773 | 793 | if (HLSL_OFFICIAL_BUILD) |
|
0 commit comments