Support supplying extra definitions via CMAKE variable

This commit is contained in:
Lei Zhang 2017-08-16 16:42:50 -04:00
parent 17d941af4f
commit 768d9b42d3
2 changed files with 9 additions and 0 deletions

View File

@ -98,6 +98,10 @@ if(${SPIRV_LOG_DEBUG})
add_definitions(-DSPIRV_LOG_DEBUG)
endif()
if (DEFINED SPIRV_TOOLS_EXTRA_DEFINITIONS)
add_definitions(${SPIRV_TOOLS_EXTRA_DEFINITIONS})
endif()
function(spvtools_default_compile_options TARGET)
target_compile_options(${TARGET} PRIVATE ${SPIRV_WARNINGS})

View File

@ -206,6 +206,11 @@ The following CMake options are supported:
warnings encountered by enabling the compiler-specific compiler front-end
option.
Additionally, you can pass additional C preprocessor definitions to SPIRV-Tools
via setting `SPIRV_TOOLS_EXTRA_DEFINITIONS`. For example, by setting it to
`/D_ITERATOR_DEBUG_LEVEL=0` on Windows, you can disable checked iterators and
iterator debugging.
## Library
### Usage