-
Notifications
You must be signed in to change notification settings - Fork 6
/
CMakeLists.txt
48 lines (38 loc) · 1.23 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
cmake_minimum_required(VERSION 3.3)
project(scopehal-sigrok-bridge)
set(WARNINGS "-Wall -Wextra -Wuninitialized ")
set(WARNINGS "${WARNINGS} -Wshadow -Wunsafe-loop-optimizations -Wpedantic -Wcast-align -Wwrite-strings")
set(WARNINGS "${WARNINGS} -Wvla")
set(CMAKE_CXX_FLAGS "-g -fopenmp ${WARNINGS} --std=c++17 -mtune=native -ffast-math")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -fsanitize=address")
if(WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_USE_MATH_DEFINES -D_POSIX_THREAD_SAFE_FUNCTIONS")
endif()
list(APPEND PKGDEPS
"libsigrok4DSL >= 0.2.0"
"libusb-1.0 >= 1.0.16"
)
find_package(PkgConfig)
pkg_check_modules(PKGDEPS REQUIRED ${PKGDEPS})
include_directories(${PKGDEPS_INCLUDE_DIRS})
add_subdirectory("${PROJECT_SOURCE_DIR}/lib/log")
add_subdirectory("${PROJECT_SOURCE_DIR}/lib/scpi-server-tools")
add_subdirectory("${PROJECT_SOURCE_DIR}/lib/xptools")
add_executable(scopehal-sigrok-bridge
src/main.cpp
src/srbinding.cpp
src/server.cpp
src/SigrokSCPIServer.cpp
src/WaveformServerThread.cpp
)
link_directories(${PKGDEPS_LIBRARY_DIRS})
target_link_libraries(scopehal-sigrok-bridge
${PKGDEPS_LIBRARIES}
xptools
scpi-server-tools
log
)
target_include_directories(scopehal-sigrok-bridge PRIVATE
lib/
)