-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
40 lines (30 loc) · 1.27 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
cmake_minimum_required(VERSION 3.11.0)
project(NaiveFS VERSION 0.0.1 LANGUAGES CXX)
# compiler
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
IF (NOT DEFINED NO_ASAN)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -fno-omit-frame-pointer -fsanitize-recover=address")
ENDIF()
IF (CMAKE_BUILD_TYPE STREQUAL Release)
add_compile_options("-Ofast")
ENDIF()
add_compile_options("-Wall" "-W" "-Wextra" "-fPIC" "-g3" "-D_FILE_OFFSET_BITS=64")
# outputs
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# pkg-config fuse
find_package(PkgConfig)
pkg_search_module(FUSE REQUIRED fuse3)
message(STATUS "Found fuse libraries " ${FUSE_LIBRARIES})
message(STATUS "Found fuse include directory " ${FUSE_INCLUDE_DIRS})
set(NAIVEFS_INCLUDE_DIR include)
file(GLOB_RECURSE NAIVEFS_SOURCE src/*)
add_executable(${PROJECT_NAME} ${NAIVEFS_SOURCE})
target_include_directories(${PROJECT_NAME} PUBLIC ${NAIVEFS_INCLUDE_DIR})
target_include_directories(${PROJECT_NAME} PUBLIC ${FUSE_INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} INTERFACE pthread)
target_link_libraries(${PROJECT_NAME} PUBLIC ${FUSE_LIBRARIES})
# set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake;${CMAKE_MODULE_PATH}")
# include(spdlog)
# target_link_libraries(${PROJECT_NAME} PRIVATE spdlog)