26 lines
543 B
CMake
26 lines
543 B
CMake
cmake_minimum_required(VERSION 3.20)
|
|
|
|
project(cieter C)
|
|
set(CMAKE_C_STANDARD 17)
|
|
|
|
find_package(LibArchive REQUIRED)
|
|
|
|
include_directories(include)
|
|
|
|
file(GLOB CIETER_SRCS src/cieter/**.c)
|
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL Release)
|
|
add_compile_options(-O3 -flto)
|
|
endif()
|
|
|
|
add_library(cieter SHARED ${CIETER_SRCS})
|
|
|
|
option(BUILD_CIETERD "Build cieterd binary" ON)
|
|
|
|
if (BUILD_CIETERD)
|
|
file(GLOB CIETERD_SRCS src/cieterd/**.c)
|
|
|
|
add_executable(cieterd ${CIETERD_SRCS})
|
|
target_link_libraries(cieterd cieter LibArchive::LibArchive)
|
|
endif()
|