Server-Root/TeaDNS/server/CMakeLists.txt
2019-11-22 20:51:52 +01:00

32 lines
907 B
CMake

cmake_minimum_required(VERSION 3.15)
project(TeaWebDNS)
set(CMAKE_CXX_STANDARD 17)
#Setup the compiler (Cant be done within a function!)
if (MSVC)
set(CompilerFlags
CMAKE_C_FLAGS_DEBUG
CMAKE_C_FLAGS_MINSIZEREL
CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_RELWITHDEBINFO
CMAKE_CXX_FLAGS_DEBUG
CMAKE_CXX_FLAGS_MINSIZEREL
CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_RELWITHDEBINFO
)
foreach(CompilerFlag ${CompilerFlags})
string(REPLACE "/MD" "/MT" ${CompilerFlag} "${${CompilerFlag}}")
endforeach()
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++17 -static-libgcc -static-libstdc++")
endif()
# Require libevent
find_package(Libevent REQUIRED)
include_directories(${LIBEVENT_INCLUDE_DIRS})
add_subdirectory(util)
add_executable(TeaWebDNS main.cpp server/src/server.cpp server/src/handler.cpp)
target_link_libraries(TeaWebDNS ${LIBEVENT_STATIC_LIBRARIES} pthread teadns__parser)