-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
70 lines (54 loc) · 1.91 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project(libminisketch-wasm)
set(CMAKE_CXX_STANDARD 14)
enable_language(C)
enable_language(CXX)
if(CMAKE_CXX_COMPILER_ID MATCHES GNU)
set(CMAKE_CXX_FLAGS "-Wall -Wno-unknown-pragmas -Wno-sign-compare -Woverloaded-virtual -Wwrite-strings -Wno-unused")
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g3")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
endif()
include_directories(
${PROJECT_SOURCE_DIR}/binding
${PROJECT_SOURCE_DIR}/minisketch/src
${PROJECT_SOURCE_DIR}/minisketch/.libs
${PROJECT_SOURCE_DIR}/minisketch/include
)
add_library(
libminisketch-wasm
binding/minisketchwrapper.cc
)
set(GOOGLETEST_ROOT tests/googletest/googletest CACHE STRING "Google Test source root")
set(GOOGLEMOCK_ROOT tests/googletest/googlemock CACHE STRING "Google Mock source root")
include_directories(
${PROJECT_SOURCE_DIR}/${GOOGLETEST_ROOT}
${PROJECT_SOURCE_DIR}/${GOOGLETEST_ROOT}/include
${PROJECT_SOURCE_DIR}/${GOOGLEMOCK_ROOT}
${PROJECT_SOURCE_DIR}/${GOOGLEMOCK_ROOT}/include
)
set(GOOGLETEST_SOURCES
${PROJECT_SOURCE_DIR}/${GOOGLETEST_ROOT}/src/gtest-all.cc
${PROJECT_SOURCE_DIR}/${GOOGLETEST_ROOT}/src/gtest_main.cc
${PROJECT_SOURCE_DIR}/${GOOGLEMOCK_ROOT}/src/gmock-all.cc
${PROJECT_SOURCE_DIR}/${GOOGLEMOCK_ROOT}/src/gmock_main.cc
)
foreach(_source ${GOOGLETEST_SOURCES})
set_source_files_properties(${_source} PROPERTIES GENERATED 1)
endforeach()
add_library(googletest ${GOOGLETEST_SOURCES})
add_executable(
bindings-test
tests/bindings-test.cpp
)
add_dependencies(bindings-test googletest)
target_link_libraries(
bindings-test
googletest
${PROJECT_SOURCE_DIR}/minisketch/.libs/libminisketch.a
libminisketch-wasm
pthread
)
include(CTest)
enable_testing()
add_test(unit ${PROJECT_BINARY_DIR}/bindings-test)