This commit is contained in:
Mayank 2018-02-26 20:57:02 +00:00 committed by GitHub
commit 7aa91c4b1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 5 deletions

View File

@ -28,10 +28,20 @@ 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)
target_compile_definitions(json-schema-validator
PRIVATE
-DJSON_SCHEMA_VALIDATOR_SHARED_LIB)
endif()
target_include_directories(json-schema-validator
PUBLIC

View File

@ -26,7 +26,7 @@
#ifndef NLOHMANN_JSON_SCHEMA_HPP__
#define NLOHMANN_JSON_SCHEMA_HPP__
#ifdef _WIN32
#if defined(_WIN32) && defined(JSON_SCHEMA_VALIDATOR_SHARED_LIB)
# ifdef JSON_SCHEMA_VALIDATOR_EXPORTS
# define JSON_SCHEMA_VALIDATOR_API __declspec(dllexport)
# else