-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathCMakeLists.txt
47 lines (39 loc) · 1.37 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
#
# > File Name: CMakeLists.txt
# > Author: Zeyuan Hu
# > Mail: [email protected]
# > Created Time: 8/25/18
# > Description:
#
# This file is used to compile .c files shipped inside the project.
cmake_minimum_required(VERSION 2.8)
project(rustfs)
# We enable the verbose output to help with debug building process
set( CMAKE_VERBOSE_MAKEFILE on )
# This project can use C11, but will gracefully decay down to C89.
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED OFF)
set(CMAKE_C_EXTENSIONS OFF)
# Let CMake know where to search for the commonly-used CMake macros
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/CMakeModules)
# SPDK_INSTALL_DIR should point to the install location of the SPDK library
set(SPDK_INSTALL_DIR $ENV{SPDK_INSTALL_DIR})
if (NOT SPDK_INSTALL_DIR)
message(SEND_ERROR "SPDK_INSTALL_DIR not found into the environment")
else ()
message(STATUS "SPDK_INSTALL_DIR = $ENV{SPDK_INSTALL_DIR}")
endif ()
# Setup the basic C Compiler flags
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} \
-Wall \
-Wextra \
-Wno-unused-parameter \
-Wno-missing-field-initializers \
-Wmissing-declarations \
-fno-strict-aliasing \
-Wformat \
-Wformat-security \
")
# include the SPDK API headers
include_directories(${SPDK_INSTALL_DIR}/include)
add_subdirectory(examples/hello_nvme_bdev)