-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
92 lines (73 loc) · 2.2 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
cmake_minimum_required(VERSION 3.13)
include(cmake/options.cmake)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "")
set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64" CACHE STRING "")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
project(roc_vad CXX)
set(PROJECT_ROOT ${CMAKE_CURRENT_SOURCE_DIR})
set(COMMON_LIB "rocvad_common")
set(RPC_LIB "rocvad_rpc")
set(DRIVER_LIB "rocvad_driver")
set(TOOL_EXE "roc-vad")
set(TOOL_LIB "rocvad_tool")
set(TEST_EXE "rocvad_test")
set(DRIVER_BUNDLE_NAME "roc_vad" CACHE STRING "")
set(DRIVER_BUNDLE_ID "org.rocstreaming.rocvad" CACHE STRING "")
set(DRIVER_UUID "FE352D6E-B65E-4496-BD3D-ECBBB6750E8B" CACHE STRING "")
set(DRIVER_SOCKET "127.0.0.1:9712" CACHE STRING "")
set(DRIVER_MANUFACTURER "Roc Streaming" CACHE STRING "")
set(DRIVER_COPYRIGHT "Copyright (c) Roc Streaming authors" CACHE STRING "")
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release")
endif()
add_compile_options(
# enable warnings
"-Wall"
"-Wextra"
# disable warnings
"-Wno-unused-but-set-variable"
"-Wno-unused-parameter"
# enable assertions (even in release build)
"-UNDEBUG"
)
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
add_compile_options(
"-ggdb"
"-funwind-tables"
"-fno-omit-frame-pointer"
)
endif()
include_directories(
common
rpc
)
include(cmake/dependencies.cmake)
if(NOT BOOTSTRAP)
enable_testing()
add_subdirectory(common)
add_subdirectory(rpc)
add_subdirectory(driver)
add_subdirectory(tool)
add_subdirectory(test)
foreach(TARGET IN ITEMS ${COMMON_LIB} ${RPC_LIB} ${DRIVER_BUNDLE} ${TOOL_EXE} ${TEST_EXE})
add_dependencies(${TARGET}
${ALL_DEPENDENCIES}
)
endforeach()
add_custom_command(
COMMENT "Copying compile_commands.json to project root"
DEPENDS
${COMMON_LIB} ${RPC_LIB} ${DRIVER_BUNDLE} ${TOOL_EXE} ${TEST_EXE}
OUTPUT
${PROJECT_SOURCE_DIR}/compile_commands.json
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_BINARY_DIR}/compile_commands.json
${PROJECT_SOURCE_DIR}/compile_commands.json
)
add_custom_target(compile_commands ALL
DEPENDS ${PROJECT_SOURCE_DIR}/compile_commands.json
)
endif()