Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Make CREADLINE_MAX_LINE_SIZE configurable from CMakeList #135

Merged
merged 1 commit into from
Aug 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ pkg_search_module(JSONC REQUIRED IMPORTED_TARGET json-c)

# create an object lib to avoid double compilation
add_library(japi_objs OBJECT ${SOURCES} ${HEADERS})
if(DEFINED CREADLINE_MAX_LINE_SIZE)
if(CREADLINE_MAX_LINE_SIZE LESS 1024)
message(FATAL_ERROR "Minimal linesize is CREADLINE_BLOCK_SIZE=1024 bytes")
endif()
target_compile_definitions(japi_objs PRIVATE CREADLINE_MAX_LINE_SIZE=${CREADLINE_MAX_LINE_SIZE})
endif()
target_compile_options(japi_objs PUBLIC "-pthread" "-D_POSIX_C_SOURCE=200809L")
target_include_directories(japi_objs PUBLIC include/ ${JSONC_INCLUDE_DIRS})
set_property(TARGET japi_objs PROPERTY POSITION_INDEPENDENT_CODE ON)
Expand Down