mirror of
https://github.com/tristanpenman/valijson.git
synced 2024-12-12 18:20:27 +01:00
Make VALIJSON_USE_EXCEPTIONS interface definition
This commit is contained in:
parent
c5dac2bc0b
commit
50010fd959
@ -34,6 +34,10 @@ target_include_directories(valijson INTERFACE
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
|
||||
|
||||
if(valijson_USE_EXCEPTIONS)
|
||||
target_compile_definitions(valijson INTERFACE -DVALIJSON_USE_EXCEPTIONS=1)
|
||||
endif()
|
||||
|
||||
install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|
||||
|
||||
install(TARGETS valijson
|
||||
|
@ -65,6 +65,7 @@ Note that Valijson's `SchemaParser` and `Validator` classes expect you to pass i
|
||||
### Exceptions
|
||||
|
||||
By default, Valijson classes will not throw exceptions (e.g. when failing to parse a schema). To enable exceptions for these cases, `VALIJSON_USE_EXCEPTIONS` must be defined.
|
||||
However note that `VALIJSON_USE_EXCEPTIONS` is defined as interface compile definition of the cmake target, and the definition populates all the targets linking Valijson with cmake.
|
||||
|
||||
### Strong vs Weak Types
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user