33 lines
715 B
CMake
33 lines
715 B
CMake
cmake_minimum_required(VERSION 3.20)
|
|
|
|
project(cieter C)
|
|
set(CMAKE_C_STANDARD 17)
|
|
|
|
find_package(LibArchive REQUIRED)
|
|
|
|
add_subdirectory(vendor/unity)
|
|
include_directories(include vendor/unity/src)
|
|
|
|
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})
|
|
target_link_libraries(cieter LibArchive::LibArchive)
|
|
|
|
if(CMAKE_BUILD_TYPE MATCHES "^Test")
|
|
enable_testing()
|
|
add_subdirectory(test)
|
|
endif()
|
|
|
|
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)
|
|
endif()
|