diff options
author | Allen Winter <allen.winter@kdab.com> | 2022-02-18 17:10:04 -0500 |
---|---|---|
committer | Allen Winter <allen.winter@kdab.com> | 2022-02-18 17:10:04 -0500 |
commit | 5e1cc0394ba4e18ab9d9f57599316bd1e8c53e26 (patch) | |
tree | 0522e41285cb60cc945c66da80b5fcd2e7099c61 /CMakeLists.txt | |
parent | 8f135b184a0a5395dccf484dd9555d3cb4e7e57c (diff) | |
download | libical-git-5e1cc0394ba4e18ab9d9f57599316bd1e8c53e26.tar.gz |
buildsystem - entire project can be built with memory consistency
Introduce a new CMake option LIBICAL_DEVMODE_MEMORY_CONSISTENCY
that allows all the project libraries to be built with the
memory consistency functions.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 82b14260..3f726faa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -78,6 +78,14 @@ # Build for the abi-dumper (requires gcc) # Default=false # +# -DLIBICAL_DEVMODE_MEMORY_CONSISTENCY=[true|false] +# Build using special memory consistency versions of malloc(), realloc() and free() +# that perform some extra verifications. Most notably they ensure that memory allocated +# with icalmemory_new_buffer() is freed using icalmemory_free() rather than using free() +# directly and vice versa. Failing to do so would cause the test to fail with assertions +# or access violations. +# Default=false +# # -DADDRESS_SANITIZER=[true|false] # Build with the address sanitizer (requires gcc or clang) # Default=false @@ -537,6 +545,12 @@ if(ABI_DUMPER) endif() endif() +libical_option(LIBICAL_DEVMODE_MEMORY_CONSISTENCY "(Developer-only) Build with memory consistency functions." False) +if(LIBICAL_DEVMODE_MEMORY_CONSISTENCY) + add_definitions(-DMEMORY_CONSISTENCY) +endif() +mark_as_advanced(LIBICAL_DEVMODE_MEMORY_CONSISTENCY) + libical_option(ADDRESS_SANITIZER "(Developer-only) Build with the address sanitizer." False) mark_as_advanced(ADDRESS_SANITIZER) if(ADDRESS_SANITIZER) |