Mercurial > molko
changeset 324:87ad3de308b6
cmake: fix libsqlite warnings
author | David Demelier <markand@malikania.fr> |
---|---|
date | Sat, 02 Oct 2021 08:33:39 +0200 |
parents | fbc748292c01 |
children | cd8b87ddd1e7 |
files | cmake/MlkLibrary.cmake extern/libsqlite/CMakeLists.txt |
diffstat | 2 files changed, 10 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/cmake/MlkLibrary.cmake Sat Oct 02 08:30:45 2021 +0200 +++ b/cmake/MlkLibrary.cmake Sat Oct 02 08:33:39 2021 +0200 @@ -22,7 +22,7 @@ function(mlk_library) set(options "") set(oneValueArgs "NAME;FOLDER;TYPE") - set(multiValueArgs "SOURCES;ASSETS;LANGS;LIBRARIES;INCLUDES;FLAGS") + set(multiValueArgs "SOURCES;ASSETS;LANGS;LIBRARIES;INCLUDES;FLAGS;OPTIONS") cmake_parse_arguments(LIB "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) @@ -55,6 +55,10 @@ target_compile_definitions(${LIB_NAME} ${LIB_FLAGS}) endif () + if (LIB_OPTIONS) + target_compile_options(${LIB_NAME} ${LIB_OPTIONS}) + endif () + if (LIB_LIBRARIES) target_link_libraries(${LIB_NAME} ${LIB_LIBRARIES}) endif ()
--- a/extern/libsqlite/CMakeLists.txt Sat Oct 02 08:30:45 2021 +0200 +++ b/extern/libsqlite/CMakeLists.txt Sat Oct 02 08:33:39 2021 +0200 @@ -24,10 +24,15 @@ ${libmlk-sqlite_SOURCE_DIR}/sqlite3.h ) +if (CMAKE_C_COMPILER_ID MATCHES "GNU|Clang") + list(APPEND OPTIONS -Wno-unused-parameter) +endif () + mlk_library( NAME libmlk-sqlite SOURCES ${SOURCES} FOLDER extern + OPTIONS PRIVATE ${OPTIONS} FLAGS PRIVATE SQLITE_THREADSAFE=0