aboutsummaryrefslogtreecommitdiff
path: root/libcmix-crypto/ed25519/gcrypt/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'libcmix-crypto/ed25519/gcrypt/CMakeLists.txt')
-rw-r--r--libcmix-crypto/ed25519/gcrypt/CMakeLists.txt46
1 files changed, 46 insertions, 0 deletions
diff --git a/libcmix-crypto/ed25519/gcrypt/CMakeLists.txt b/libcmix-crypto/ed25519/gcrypt/CMakeLists.txt
new file mode 100644
index 0000000..d020e4b
--- /dev/null
+++ b/libcmix-crypto/ed25519/gcrypt/CMakeLists.txt
@@ -0,0 +1,46 @@
+include(get_target_name)
+
+get_target_name(target_name algo api)
+
+find_package(Gcrypt REQUIRED)
+
+option(trace_pointers "trace alloced pointers by gcrypt" OFF)
+
+add_library(${target_name} SHARED
+ gcrypt_ed25519.c
+)
+
+set_property(SOURCE gcrypt_ed25519.c PROPERTY COMPILE_DEFINITIONS
+ API=${api};ALGORITHM=${algo}
+)
+
+if(trace_pointers)
+ target_compile_definitions(${target_name}
+ PRIVATE "POINTER_TRACING"
+ )
+endif(trace_pointers)
+
+if(NOT Gcrypt_CFLAGS STREQUAL "")
+ IF(WIN32)
+ separate_arguments(flags WINDOWS_COMMAND ${Gcrypt_CFLAGS})
+ else(WIN32)
+ separate_arguments(flags UNIX_COMMAND ${Gcrypt_CFLAGS})
+ endif(WIN32)
+
+ foreach(flag ${flags})
+ target_compile_options(${target_name}
+ PUBLIC ${flag}
+ )
+ endforeach(flag)
+endif(NOT Gcrypt_CFLAGS STREQUAL "")
+
+if(UNIX)
+ target_link_libraries(${target_name}
+ PRIVATE m
+ )
+endif(UNIX)
+
+target_link_libraries(${target_name}
+ PRIVATE ed25519-interface
+ PUBLIC ${Gcrypt_LIBRARIES}
+)