init
This commit is contained in:
commit
d2de39e108
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
.idea
|
||||||
|
cmake-build-*
|
47
CMakeLists.txt
Normal file
47
CMakeLists.txt
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.17 FATAL_ERROR)
|
||||||
|
project(GeminiServer CXX)
|
||||||
|
|
||||||
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||||
|
set(CMAKE_CXX_COMPILER_LAUNCHER ccache)
|
||||||
|
|
||||||
|
find_package(Boost REQUIRED COMPONENTS system)
|
||||||
|
find_package(OpenSSL REQUIRED)
|
||||||
|
include_directories(${Boost_INCLUDE_DIR} ${OpenSSL_INCLUDE_DIR})
|
||||||
|
|
||||||
|
set(COMPILE_FLAGS
|
||||||
|
-pipe
|
||||||
|
-march=skylake # change to native or your architecture.
|
||||||
|
-mtune=skylake # same as above
|
||||||
|
-mrdrnd
|
||||||
|
-Wall
|
||||||
|
-Wextra
|
||||||
|
-Wpessimizing-move
|
||||||
|
-Wredundant-move
|
||||||
|
-funroll-loops
|
||||||
|
-flto=thin -fwhole-program-vtables
|
||||||
|
-fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free
|
||||||
|
)
|
||||||
|
set(LINKER_OPTIONS
|
||||||
|
PRIVATE -Wl,--sort-common,--as-needed
|
||||||
|
-flto=thin
|
||||||
|
-fwhole-program-vtables
|
||||||
|
-fuse-ld=gold
|
||||||
|
)
|
||||||
|
|
||||||
|
set(LINKER_FLAGS
|
||||||
|
jemalloc
|
||||||
|
)
|
||||||
|
|
||||||
|
file(GLOB HEADERS includes/*.hpp)
|
||||||
|
|
||||||
|
set(FILES
|
||||||
|
main.cpp)
|
||||||
|
|
||||||
|
add_executable(GeminiServer ${FILES})
|
||||||
|
target_precompile_headers(GeminiServer PRIVATE ${HEADERS})
|
||||||
|
target_compile_definitions(GeminiServer PRIVATE _GLIBCXX_DEBUG)
|
||||||
|
target_compile_options(GeminiServer PRIVATE ${COMPILE_FLAGS})
|
||||||
|
target_link_options(GeminiServer ${LINKER_OPTIONS})
|
||||||
|
target_link_libraries(GeminiServer ${Boost_LIBRARIES} ${LINKER_FLAGS} OpenSSL::SSL)
|
Loading…
Reference in New Issue
Block a user