Skip to content

Commit 146c290

Browse files
committed
cmake: Add option to align ZMQ quirk with CSPv1
Introduce a new CMake option `CSP_FIXUP_V1_ZMQ_LITTLE_ENDIAN`. When enabled, this option applies a fixup to the ZMQ interface to match the libcsp v1 behavior, which incorrectly used host endianness instead of the expected big-endian format. This fixup ensures compatibility with systems using libcsp v1 while aligning with the behavior of libcsp v2. Signed-off-by: Yasushi SHOJI <[email protected]>
1 parent dddf647 commit 146c290

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ option(CSP_BUFFER_ZERO_CLEAR "Zero out the packet buffer upon allocation" ON)
3939
option(CSP_ENABLE_PYTHON3_BINDINGS "Build Python3 binding" OFF)
4040
option(CSP_BUILD_SAMPLES "Build samples and examples by default" OFF)
4141

42+
option(CSP_FIXUP_V1_ZMQ_LITTLE_ENDIAN "Use little-endian CSP ID for ZMQ with CSPv1" ON)
43+
4244
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
4345
set(CSP_POSIX 1)
4446
elseif(CMAKE_SYSTEM_NAME STREQUAL "Generic")

csp_autoconfig.h.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,5 @@
2525

2626
#cmakedefine01 CSP_HAVE_LIBSOCKETCAN
2727
#cmakedefine01 CSP_HAVE_LIBZMQ
28+
29+
#cmakedefine01 CSP_FIXUP_V1_ZMQ_LITTLE_ENDIAN

0 commit comments

Comments
 (0)