deps/reftable: wire up library with CMake

Wire up the reftable library with CMake. At the current point in time
the library is not yet plugged into libgit2 itself.
This commit is contained in:
Patrick Steinhardt
2025-07-04 07:52:15 +02:00
parent 9e3b00acfb
commit 641a43c90d

27
deps/reftable/CMakeLists.txt vendored Normal file
View File

@@ -0,0 +1,27 @@
add_library(reftable OBJECT ${SRC_REFTABLE})
file(GLOB SRC_REFTABLE "*.c" "*.h")
list(SORT SRC_REFTABLE)
set_property(TARGET reftable PROPERTY C_STANDARD 99)
target_sources(reftable PRIVATE ${SRC_REFTABLE})
target_include_directories(reftable PRIVATE
include
"${PROJECT_BINARY_DIR}/src/util"
"${PROJECT_BINARY_DIR}/include"
"${PROJECT_SOURCE_DIR}/src/util"
"${PROJECT_SOURCE_DIR}/include"
${LIBGIT2_DEPENDENCY_INCLUDES}
${LIBGIT2_SYSTEM_INCLUDES}
)
# The reftable library is not warning-free, so we disable turning warnings into
# errors.
if(MSVC)
set_source_files_properties(block.c PROPERTIES COMPILE_FLAGS -WX-)
set_source_files_properties(blocksource.c PROPERTIES COMPILE_FLAGS -WX-)
set_source_files_properties(record.c PROPERTIES COMPILE_FLAGS -WX-)
set_source_files_properties(stack.c PROPERTIES COMPILE_FLAGS -WX-)
set_source_files_properties(table.c PROPERTIES COMPILE_FLAGS -WX-)
set_source_files_properties(writer.c PROPERTIES COMPILE_FLAGS -WX-)
endif()