|
23 | 23 | # |
24 | 24 | ####################################################################################################################### |
25 | 25 |
|
26 | | -# Settings required for a standalone LLPC build that would otherwise be inherited from the driver. |
| 26 | +macro(llpc_standalone_pre_project_setup) |
| 27 | +endmacro() |
27 | 28 |
|
28 | | -if(COMMAND cmake_policy) |
29 | | - cmake_policy(SET CMP0003 NEW) |
30 | | -endif(COMMAND cmake_policy) |
| 29 | +macro(llpc_standalone_post_project_setup) |
| 30 | + # Settings required for a standalone LLPC build that would otherwise be inherited from the driver. |
31 | 31 |
|
32 | | -if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../pal) |
33 | | - set(PAL_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../pal) |
34 | | -elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../../imported/pal) |
35 | | - set(PAL_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../imported/pal) |
36 | | -endif() |
| 32 | + if(COMMAND cmake_policy) |
| 33 | + cmake_policy(SET CMP0003 NEW) |
| 34 | + endif(COMMAND cmake_policy) |
37 | 35 |
|
38 | | -if(EXISTS ${PROJECT_SOURCE_DIR}/../third_party) |
39 | | - set(THIRD_PARTY ${PROJECT_SOURCE_DIR}/../third_party) |
40 | | -elseif(EXISTS ${PROJECT_SOURCE_DIR}/../../../../third_party) |
41 | | - set(THIRD_PARTY ${PROJECT_SOURCE_DIR}/../../../../third_party) |
42 | | -endif() |
43 | | -if (THIRD_PARTY) |
44 | | - set(XGL_METROHASH_PATH ${THIRD_PARTY}/metrohash CACHE PATH "The path of metrohash.") |
45 | | - set(XGL_CWPACK_PATH ${THIRD_PARTY}/cwpack CACHE PATH "The path of cwpack.") |
46 | | - add_subdirectory(${XGL_METROHASH_PATH} ${PROJECT_BINARY_DIR}/metrohash) |
47 | | - add_subdirectory(${XGL_CWPACK_PATH} ${PROJECT_BINARY_DIR}/cwpack) |
48 | | -endif() |
| 36 | + set(LLPC_STANDALONE_BUILD ON) |
| 37 | + set(LLPC_BUILD_TESTS ON) |
49 | 38 |
|
50 | | -# Enable LLPC if we found its prerequisites (and it is not explicitly disabled). |
51 | | -if (NOT DEFINED ICD_BUILD_LLPC) |
52 | | - if (THIRD_PARTY AND PAL_SOURCE_DIR) |
53 | | - set(ICD_BUILD_LLPC ON) |
54 | | - else() |
55 | | - message(STATUS "Vulkan-LLPC prerequisites not found; disabling") |
| 39 | + if(NOT PAL_SOURCE_DIR) |
| 40 | + if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../pal) |
| 41 | + set(PAL_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../pal) |
| 42 | + elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../../imported/pal) |
| 43 | + set(PAL_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../imported/pal) |
| 44 | + endif() |
| 45 | + endif() |
| 46 | + |
| 47 | + if(NOT GPURT_SOURCE_DIR) |
| 48 | + if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../gpurt) |
| 49 | + set(GPURT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../gpurt) |
| 50 | + elseif(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../../imported/gpurt) |
| 51 | + set(GPURT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/../../imported/gpurt) |
| 52 | + endif() |
56 | 53 | endif() |
57 | | -endif() |
58 | | -if (ICD_BUILD_LLPC) |
59 | | - set(LLPC_BUILD_TESTS ON) |
60 | | - set(LLPC_BUILD_TOOLS ON) |
61 | 54 |
|
62 | | - # External Vulkan headers path |
63 | | - if(EXISTS ${PROJECT_SOURCE_DIR}/../Vulkan-Headers) |
64 | | - set(VULKAN_HEADERS_PATH ${PROJECT_SOURCE_DIR}/../Vulkan-Headers CACHE PATH "The path of Vulkan headers.") |
| 55 | + if(EXISTS ${PROJECT_SOURCE_DIR}/../third_party) |
| 56 | + set(THIRD_PARTY ${PROJECT_SOURCE_DIR}/../third_party) |
| 57 | + elseif(EXISTS ${PROJECT_SOURCE_DIR}/../../../../third_party) |
| 58 | + set(THIRD_PARTY ${PROJECT_SOURCE_DIR}/../../../../third_party) |
| 59 | + endif() |
| 60 | + if (THIRD_PARTY) |
| 61 | + set(XGL_METROHASH_PATH ${THIRD_PARTY}/metrohash CACHE PATH "The path of metrohash.") |
| 62 | + set(XGL_CWPACK_PATH ${THIRD_PARTY}/cwpack CACHE PATH "The path of cwpack.") |
| 63 | + add_subdirectory(${XGL_METROHASH_PATH} ${PROJECT_BINARY_DIR}/metrohash) |
| 64 | + add_subdirectory(${XGL_CWPACK_PATH} ${PROJECT_BINARY_DIR}/cwpack) |
65 | 65 | endif() |
66 | 66 |
|
67 | | - ### Khronos Interface |
68 | | - add_library(khronos_vulkan_interface INTERFACE) |
69 | | - if(EXISTS ${VULKAN_HEADERS_PATH}) |
70 | | - target_include_directories(khronos_vulkan_interface INTERFACE ${VULKAN_HEADERS_PATH}/include) |
71 | | - target_compile_definitions(khronos_vulkan_interface INTERFACE EXTERNAL_VULKAN_HEADERS=1) |
| 67 | + # Enable LLPC if we found its prerequisites (and it is not explicitly disabled). |
| 68 | + if (NOT DEFINED ICD_BUILD_LLPC) |
| 69 | + if (THIRD_PARTY AND PAL_SOURCE_DIR) |
| 70 | + set(ICD_BUILD_LLPC ON) |
| 71 | + else() |
| 72 | + message(STATUS "Vulkan-LLPC prerequisites not found; disabling") |
| 73 | + endif() |
72 | 74 | endif() |
73 | | - if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../xgl) |
74 | | - target_include_directories(khronos_vulkan_interface INTERFACE ../xgl/icd/api/include/khronos) |
75 | | - else() |
76 | | - target_include_directories(khronos_vulkan_interface INTERFACE ../../../icd/api/include/khronos) |
| 75 | + if (ICD_BUILD_LLPC) |
| 76 | + set(LLPC_BUILD_TOOLS ON) |
| 77 | + |
| 78 | + # External Vulkan headers path |
| 79 | + if(EXISTS ${PROJECT_SOURCE_DIR}/../Vulkan-Headers) |
| 80 | + set(VULKAN_HEADERS_PATH ${PROJECT_SOURCE_DIR}/../Vulkan-Headers CACHE PATH "The path of Vulkan headers.") |
| 81 | + endif() |
| 82 | + |
| 83 | + ### Khronos Interface |
| 84 | + add_library(khronos_vulkan_interface INTERFACE) |
| 85 | + if(EXISTS ${VULKAN_HEADERS_PATH}) |
| 86 | + target_include_directories(khronos_vulkan_interface INTERFACE ${VULKAN_HEADERS_PATH}/include) |
| 87 | + target_compile_definitions(khronos_vulkan_interface INTERFACE EXTERNAL_VULKAN_HEADERS=1) |
| 88 | + endif() |
| 89 | + if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../xgl) |
| 90 | + target_include_directories(khronos_vulkan_interface INTERFACE ../xgl/icd/api/include/khronos) |
| 91 | + else() |
| 92 | + target_include_directories(khronos_vulkan_interface INTERFACE ../../../icd/api/include/khronos) |
| 93 | + endif() |
77 | 94 | endif() |
78 | | -endif() |
79 | 95 |
|
80 | | -set(GPURT_CLIENT_INTERFACE_MAJOR_VERSION 999999) |
81 | | -set(LLPC_CLIENT_INTERFACE_MAJOR_VERSION 999999) |
82 | | -set(PAL_CLIENT_INTERFACE_MAJOR_VERSION 999999) |
| 96 | + set(GPURT_CLIENT_INTERFACE_MAJOR_VERSION 999999) |
| 97 | + set(LLPC_CLIENT_INTERFACE_MAJOR_VERSION 999999) |
| 98 | + set(PAL_CLIENT_INTERFACE_MAJOR_VERSION 999999) |
| 99 | + |
| 100 | +endmacro() |
0 commit comments