aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/siphash/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/siphash/CMakeLists.txt')
-rw-r--r--contrib/siphash/CMakeLists.txt12
1 files changed, 12 insertions, 0 deletions
diff --git a/contrib/siphash/CMakeLists.txt b/contrib/siphash/CMakeLists.txt
new file mode 100644
index 000000000..85a16e82a
--- /dev/null
+++ b/contrib/siphash/CMakeLists.txt
@@ -0,0 +1,12 @@
+cmake_minimum_required(VERSION 2.6)
+
+set(SIPHASH_SRC siphash.c)
+if ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" OR "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3")
+endif ()
+add_library(siphash STATIC "${SIPHASH_SRC}")
+
+add_executable(siphash-test EXCLUDE_FROM_ALL "siphash_test.c")
+target_link_libraries(siphash-test siphash)
+add_custom_target(check DEPENDS siphash-test)
+add_custom_target(run-test COMMAND siphash-test DEPENDS siphash-test)