-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
38 lines (28 loc) · 1.17 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
# SPDX-FileCopyrightText: 2021 Daniel Vrátil <[email protected]>
#
# SPDX-License-Identifier: MIT
cmake_minimum_required(VERSION 3.12)
project(corosqlite LANGUAGES CXX VERSION 0.1)
set(CMAKE_CXX_STANDARD 20)
# ---------------------------------------------------- #
# Compiler flags
# ---------------------------------------------------- #
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wpedantic -Werror")
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcoroutines")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcoroutines-ts -stdlib=libc++")
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /await")
else()
message(FATAL_ERROR "Compiler ${CMAKE_CXX_COMPILER_ID} is not supported (yet).")
endif()
# ---------------------------------------------------- #
# Dependencies
# ---------------------------------------------------- #
find_package(SQLite3 REQUIRED)
find_package(benchmark REQUIRED)
# ---------------------------------------------------- #
# Subdirectories
# ---------------------------------------------------- #
add_subdirectory(corosqlite)