]> www.wagner.pp.ru Git - openssl-gost/engine.git/blobdiff - CMakeLists.txt
Also build gost-engine in library form
[openssl-gost/engine.git] / CMakeLists.txt
index c7c3ec98b9a52d49d2b89907e3c1b315e0537dbb..ed2d44f33fd724ebd9251e89692c636c4d858fd3 100644 (file)
@@ -275,10 +275,23 @@ 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_target_properties(gost_engine PROPERTIES PREFIX "" OUTPUT_NAME "gost")
+# Set the suffix explicitly to adapt to OpenSSL's idea of what a
+# module suffix should be
+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
         )