-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
36 lines (27 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
cmake_minimum_required(VERSION 3.15)
project(github_stat)
set(CMAKE_CXX_STANDARD 20)
include_directories(
cinatra/include
ormpp/include
ormpp/thirdparty/sqlite3
iguana
)
# --------------------- Gcc
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcoroutines")
#-ftree-slp-vectorize with coroutine cause link error. disable it util gcc fix.
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fno-tree-slp-vectorize")
endif()
# --------------------- Msvc
# Resolves C1128 complained by MSVC: number of sections exceeded object file format limit: compile with /bigobj.
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/bigobj>")
# Resolves C4737 complained by MSVC: C4737: Unable to perform required tail call. Performance may be degraded. "Release-Type only"
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/EHa>")
find_package(OpenSSL REQUIRED)
add_definitions(-DORMPP_ENABLE_SQLITE3)
add_definitions(-DCINATRA_ENABLE_SSL)
add_library(sqlite3 ormpp/thirdparty/sqlite3/shell.c ormpp/thirdparty/sqlite3/sqlite3.c)
target_link_libraries(sqlite3 pthread -ldl)
add_executable(github_stat main.cpp)
target_link_libraries(github_stat ${OPENSSL_LIBRARIES} pthread -ldl sqlite3)