mirror of
https://github.com/aaru-dps/libaaruformat.git
synced 2025-12-16 19:24:40 +00:00
Add slog logging support and update error handling in various modules
This commit is contained in:
@@ -122,7 +122,8 @@ add_library(aaruformat SHARED include/aaruformat/consts.h include/aaruformat/enu
|
||||
src/options.c
|
||||
src/create.c
|
||||
src/time.c
|
||||
src/write.c)
|
||||
src/write.c
|
||||
include/log.h)
|
||||
|
||||
include_directories(include include/aaruformat)
|
||||
|
||||
@@ -176,8 +177,19 @@ elseif(OpenSSL_FOUND)
|
||||
TARGET_LINK_LIBRARIES_WHOLE_ARCHIVE(aaruformat ${OPENSSL_CRYPTO_LIBRARY})
|
||||
endif()
|
||||
|
||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
|
||||
# Add slog submodule
|
||||
add_subdirectory(3rdparty/slog)
|
||||
|
||||
include_directories(include 3rdparty/uthash/src)
|
||||
|
||||
# Include slog headers
|
||||
include_directories(aaruformat 3rdparty/slog/src)
|
||||
|
||||
# Enable TRACE and slog output
|
||||
add_compile_definitions(aaruformat ENABLE_TRACE USE_SLOG)
|
||||
|
||||
include(CheckLibraryExists)
|
||||
|
||||
check_library_exists(m log "" HAVE_LIB_M)
|
||||
@@ -185,5 +197,8 @@ if(HAVE_LIB_M)
|
||||
TARGET_LINK_LIBRARIES_WHOLE_ARCHIVE(aaruformat m)
|
||||
endif()
|
||||
|
||||
# Link slog
|
||||
target_link_libraries(aaruformat slog)
|
||||
|
||||
add_subdirectory(tests)
|
||||
add_subdirectory(tool)
|
||||
Reference in New Issue
Block a user