diff options
author | Richard Levitte <richard@levitte.org> | 2021-02-17 19:01:19 +0100 |
---|---|---|
committer | Dmitry Belyavskiy <beldmit@users.noreply.github.com> | 2021-02-22 09:11:38 +0100 |
commit | d9a2b2973a1174baa4cecbffc6809764b63de2eb (patch) | |
tree | 93884f648433e54938d0a3463d253a7b6ac707a9 /CMakeLists.txt | |
parent | cfe735d6ed59489b434ffe6e92181211800e626b (diff) | |
download | gost-engine-d9a2b2973a1174baa4cecbffc6809764b63de2eb.zip gost-engine-d9a2b2973a1174baa4cecbffc6809764b63de2eb.tar.gz gost-engine-d9a2b2973a1174baa4cecbffc6809764b63de2eb.tar.bz2 |
Also build gost-engine in library form
In this form, the GOST engine isn't loadable through OpenSSL's dynamic
ENGINE loader, but directly as its own function, ENGINE_load_gost().
After making that call, the engine functionality can be used as usual.
This includes a public header file called gost-engine.h, which declares
that functions.
This also rearranges the code in gost_eng.c, as the binding
functionality was spread around in the file. Now, it's all nicely
tucked at the end.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c32b90f..ed2d44f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -275,6 +275,7 @@ set_property(TARGET ${BINARY_TESTS_TARGETS} APPEND PROPERTY COMPILE_DEFINITIONS add_library(gost_core STATIC ${GOST_LIB_SOURCE_FILES}) set_target_properties(gost_core PROPERTIES POSITION_INDEPENDENT_CODE ON) +# The GOST engine in module form add_library(gost_engine MODULE ${GOST_ENGINE_SOURCE_FILES}) # Set the suffix explicitly to adapt to OpenSSL's idea of what a # module suffix should be @@ -282,6 +283,15 @@ set_target_properties(gost_engine PROPERTIES PREFIX "" OUTPUT_NAME "gost" SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX}) target_link_libraries(gost_engine gost_core ${OPENSSL_CRYPTO_LIBRARY}) +# The GOST engine in library form +add_library(lib_gost_engine SHARED ${GOST_ENGINE_SOURCE_FILES}) +set_target_properties(lib_gost_engine PROPERTIES + COMPILE_DEFINITIONS "BUILDING_ENGINE_AS_LIBRARY" + PUBLIC_HEADER gost-engine.h + OUTPUT_NAME "gost") +target_link_libraries(lib_gost_engine gost_core ${OPENSSL_CRYPTO_LIBRARY}) + + set(GOST_SUM_SOURCE_FILES gostsum.c ) |