This repository has been archived by the owner on Nov 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
42 lines (32 loc) · 1.49 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
cmake_minimum_required(VERSION 3.20)
project(MiniSQL VERSION 1.0)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -lpthread -msse4.2")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Og -D_DEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -march=native")
OPTION(ParallelWrite "Use new threads for writing blocks" ON)
if (ParallelWrite)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DParallelWrite")
message("ParallelWrite set")
endif()
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/API)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/BufferManager)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/CatalogManager)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/IndexManager)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/Interpreter)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/RecordManager)
message("-- Compiler flags:")
message(" C++ Compiler ID: ${CMAKE_CXX_COMPILER_ID}")
message(" C++ compilation flags: ${CMAKE_CXX_FLAGS}")
message("-- Build type: ${CMAKE_BUILD_TYPE}")
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
message(" C++ debug flags: ${CMAKE_CXX_FLAGS_DEBUG}")
endif()
if ("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
message(" C++ release flags: ${CMAKE_CXX_FLAGS_RELEASE}")
endif()
add_executable(MiniSQL ${SOURCE_FILES})