-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
28 lines (24 loc) · 1013 Bytes
/
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
cmake_minimum_required(VERSION 2.8.12)
project(lindorm-tsdb-contest-cpp)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# We use g++-12 to compile, so that we recommend you to use the same compiler to test for better compatibility.
set(CMAKE_CXX_STANDARD 17)
message("Build Type: ${CMAKE_BUILD_TYPE} ${CMAKE_CXX_FLAGS}")
if( CMAKE_BUILD_TYPE STREQUAL "Debug" )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -Wall -Wno-unused-variable")
else( CMAKE_BUILD_TYPE STREQUAL "Release" )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3")
endif( CMAKE_BUILD_TYPE STREQUAL "Debug" )
message("Your OS: ${CMAKE_HOST_SYSTEM_NAME}")
if (CMAKE_HOST_SYSTEM_NAME MATCHES "Darwin")
set(CMAKE_C_COMPILER "gcc-12")
set(CMAKE_CXX_COMPILER "g++-12")
elseif (MAKE_HOST_SYSTEM_NAME MATCHES "Windows")
# Add w64devkit\bin to PATH.
else ()
set(CMAKE_C_COMPILER "gcc")
set(CMAKE_CXX_COMPILER "g++")
endif ()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread")
include_directories(${PROJECT_SOURCE_DIR}/include)
add_subdirectory(test)