Added the option to disable dynamic library and build static instead

It's useful for some platform (e.g. iOS) to build the validator as a static lib instead of dynamic.
This commit is contained in:
Mayank 2018-01-12 10:32:31 -05:00 committed by GitHub
parent 378105024e
commit f29d88d3bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,10 +26,17 @@ if(NOT TARGET json-hpp)
endif()
# and one for the validator
add_library(json-schema-validator SHARED
src/json-schema-draft4.json.cpp
src/json-uri.cpp
src/json-validator.cpp)
if (JSON_SCHEMA_VALIDATOR_DISABLE_SHARED)
add_library(json-schema-validator STATIC
src/json-schema-draft4.json.cpp
src/json-uri.cpp
src/json-validator.cpp)
else()
add_library(json-schema-validator SHARED
src/json-schema-draft4.json.cpp
src/json-uri.cpp
src/json-validator.cpp)
endif()
target_include_directories(json-schema-validator
PUBLIC