Skip to content

Commit

Permalink
Merge pull request #135 from Fraunhofer-IIS/130-make-line-buffer-size…
Browse files Browse the repository at this point in the history
…-configurable

Make CREADLINE_MAX_LINE_SIZE configurable from CMakeList
  • Loading branch information
vornkat-iis authored Aug 12, 2024
2 parents 3e0c627 + cfe0f19 commit 431bec7
Showing 1 changed file with 6 additions and 0 deletions.
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

0 comments on commit 431bec7

Please sign in to comment.