Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions src/note-c/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,5 @@ settings.json
CMakeFiles/
CMakeCache.txt
cppcheck_output.txt

.claude/
18 changes: 18 additions & 0 deletions src/note-c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ option(NOTE_C_BUILD_TESTS "Build tests." ON)
option(NOTE_C_COVERAGE "Compile for test NOTE_C_COVERAGE reporting." OFF)
option(NOTE_C_LOW_MEM "Build the library tailored for low memory usage." OFF)
option(NOTE_C_MEM_CHECK "Run tests with Valgrind." OFF)
option(NOTE_NODEBUG "Build the library without debug information." OFF)
option(NOTE_C_NO_LIBC "Build the library without linking against libc, generating errors for any undefined symbols." OFF)
option(NOTE_C_SHOW_MALLOC "Build the library with flags required to log memory usage." OFF)
option(NOTE_C_SINGLE_PRECISION "Use single precision for JSON floating point numbers." OFF)
option(NOTE_C_HEARTBEAT_CALLBACK "Enable heartbeat callback support." OFF)

set(NOTE_C_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR})
add_library(note_c SHARED)
Expand Down Expand Up @@ -104,6 +106,14 @@ if(NOTE_C_NO_LIBC)
)
endif()

if(NOTE_NODEBUG)
target_compile_definitions(
note_c
PUBLIC
NOTE_NODEBUG
)
endif()

if(NOTE_C_SHOW_MALLOC)
target_compile_definitions(
note_c
Expand All @@ -120,6 +130,14 @@ if(NOTE_C_SINGLE_PRECISION)
)
endif()

if(NOTE_C_HEARTBEAT_CALLBACK)
target_compile_definitions(
note_c
PUBLIC
NOTE_C_HEARTBEAT_CALLBACK
)
endif()

if(NOTE_C_BUILD_TESTS)
# Including CTest here rather than in test/CMakeLists.txt allows us to run
# ctest from the root build directory (e.g. build/ instead of build/test/).
Expand Down
Loading
Loading