forked from MengRao/fmtlog
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
34 lines (28 loc) · 849 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
29
30
31
32
33
34
cmake_minimum_required(VERSION 3.15)
project(fmtlog CXX)
if(MSVC)
add_compile_options(/std:c++latest)
else()
add_compile_options(-Wall -O3 -std=c++17)
#add_compile_options(-Wall -Ofast -std=c++2a -march=skylake -flto -fno-exceptions -fno-rtti -fno-unwind-tables -fno-asynchronous-unwind-tables -DFMTLOG_NO_CHECK_LEVEL=1)
#SET(CMAKE_AR "gcc-ar")
#SET(CMAKE_RANLIB "gcc-ranlib")
link_libraries(pthread)
endif()
link_directories(.)
include_directories(fmt/include)
add_library(fmtlog-shared SHARED fmtlog.cc)
if(MSVC)
target_link_libraries(fmtlog-shared fmt)
endif()
install(TARGETS fmtlog-shared)
add_library(fmtlog-static fmtlog.cc)
if(MSVC)
target_link_libraries(fmtlog-static fmt)
endif()
install(TARGETS fmtlog-static)
add_subdirectory(fmt)
add_subdirectory(test)
if(NOT MSVC)
add_subdirectory(bench)
endif()