|
7 | 7 |
|
8 | 8 | cmake_minimum_required(VERSION 3.12.1) |
9 | 9 |
|
| 10 | +# setting cache variables and options should never overwrite normal variables; |
| 11 | +# otherwise, user settings set before including rps as a subdirectory can be overwritten. |
| 12 | +cmake_policy(SET CMP0126 NEW) |
| 13 | +cmake_policy(SET CMP0077 NEW) |
| 14 | + |
10 | 15 | option( RpsBuildTests "Enable unit test targets" ON ) |
11 | 16 | option( RpsBuildTools "Enable tool targets" ON ) |
12 | 17 | option( RpsBuildExamples "Enable example targets" ON ) |
13 | 18 | option( RpsEnableVulkan "Enable Vulkan backend" ON ) |
14 | 19 | option( RpsEnableImGui "Enable ImGui" ON) |
15 | 20 | option( RpsEnableDXAgilitySDK "Enable DX12 Agility SDK" OFF ) |
| 21 | +option( RpsPackagingIncludeStaticLibs "Include prebuilt static libs during packaging" OFF ) |
16 | 22 | option( RpsEnableDefaultDeviceImpl "Enable default allocator & printer support" ON ) |
17 | 23 |
|
18 | 24 | if ( "${CMAKE_GENERATOR_PLATFORM}" STREQUAL "" ) |
@@ -228,16 +234,18 @@ function( CopyShaders TargetName ShaderFiles SrcFolder ) |
228 | 234 | endforeach() |
229 | 235 | endfunction() |
230 | 236 |
|
231 | | -FindSpirvTools( SPIRV_DXCOMPILER_DLL ) |
232 | | -CheckFindFile( SPIRV_DXCOMPILER_DLL ${SPIRV_DXCOMPILER_DLL} ) |
| 237 | +if ( RpsEnableVulkan ) |
| 238 | + FindSpirvTools( SPIRV_DXCOMPILER_DLL ) |
| 239 | + CheckFindFile( SPIRV_DXCOMPILER_DLL ${SPIRV_DXCOMPILER_DLL} ) |
233 | 240 |
|
234 | | -function( CopySpirvDXC TargetName ) |
235 | | - add_custom_command( |
236 | | - TARGET ${TargetName} POST_BUILD |
237 | | - COMMAND ${CMAKE_COMMAND} -E copy_if_different |
238 | | - ${SPIRV_DXCOMPILER_DLL} |
239 | | - $<TARGET_FILE_DIR:${TargetName}>/spirv_dxc/dxcompiler.dll) |
240 | | -endfunction() |
| 241 | + function( CopySpirvDXC TargetName ) |
| 242 | + add_custom_command( |
| 243 | + TARGET ${TargetName} POST_BUILD |
| 244 | + COMMAND ${CMAKE_COMMAND} -E copy_if_different |
| 245 | + ${SPIRV_DXCOMPILER_DLL} |
| 246 | + $<TARGET_FILE_DIR:${TargetName}>/spirv_dxc/dxcompiler.dll) |
| 247 | + endfunction() |
| 248 | +endif() |
241 | 249 |
|
242 | 250 | if ( WIN32 ) |
243 | 251 |
|
@@ -466,3 +474,7 @@ endif ( ) |
466 | 474 | if ( RpsBuildTools ) |
467 | 475 | add_subdirectory( tools ) |
468 | 476 | endif ( ) |
| 477 | + |
| 478 | +if ( RpsBuildExamples ) |
| 479 | + add_subdirectory( examples ) |
| 480 | +endif ( ) |
0 commit comments