-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
57 lines (48 loc) · 1.71 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
cmake_minimum_required(VERSION 3.17.0)
project(ppos VERSION 0.1.0)
set(CMAKE_CXX_CLANG_TIDY clang-tidy -checks=-*,readability-*,-header-filter=.*)
if (USE_SANITIZER STREQUAL "Address")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
elseif (USE_SANITIZER STREQUAL "Thread")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=thread")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=thread")
elseif (USE_SANITIZER STREQUAL "Undefined")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=undefined")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=undefined")
elseif (USE_SANITIZER STREQUAL "Leak")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=leak")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=leak")
elseif (USE_SANITIZER STREQUAL "Memory")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=memory")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=memory")
endif()
if(MSVC)
find_package(wxWidgets "3.1")
else()
find_package(wxWidgets "3.1" REQUIRED COMPONENTS net core base)
endif()
include(${wxWidgets_USE_FILE})
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
set(PPOS_SOURCE_LIST ppos sqlite mongoose )
add_subdirectory(sqlite)
add_subdirectory(mongoose)
if(MSVC)
add_executable(ppos WIN32 main.cpp minimal.cpp)
message(${wxWidgets_LIBRARIES})
target_link_libraries(
${PPOS_SOURCE_LIST}
${wxWidgets_LIB_DIR}/wxmsw31ud.lib
${wxWidgets_LIBRARIES}
)
else()
add_executable(ppos main.cpp minimal.cpp)
message(${wxWidgets_LIBRARIES})
target_link_libraries(
${PPOS_SOURCE_LIST}
${wxWidgets_LIBRARIES}
Threads::Threads
)
target_compile_features(ppos PUBLIC cxx_std_17)
endif()