mirror of
https://gitlab.gnome.org/GNOME/libxml2
synced 2025-03-28 21:33:13 +00:00
cmake: Enable GCC compiler warnings
This commit is contained in:
parent
81621b1fe4
commit
202b8e1954
@ -73,7 +73,7 @@ clang:msan:
|
||||
.cmake:linux:
|
||||
image: registry.gitlab.gnome.org/gnome/libxml2
|
||||
script:
|
||||
- cmake -DBUILD_SHARED_LIBS=$BUILD_SHARED_LIBS -DCMAKE_INSTALL_PREFIX=libxml2-install -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLIBXML2_XMLCONF_WORKING_DIR=/tests -S . -B libxml2-build
|
||||
- cmake -DBUILD_SHARED_LIBS=$BUILD_SHARED_LIBS -DCMAKE_INSTALL_PREFIX=libxml2-install -DCMAKE_C_FLAGS='-Werror' -DCMAKE_BUILD_TYPE=RelWithDebInfo -DLIBXML2_XMLCONF_WORKING_DIR=/tests -S . -B libxml2-build
|
||||
- cmake --build libxml2-build --target install
|
||||
- mkdir -p libxml2-install/share/libxml2
|
||||
- cp Copyright libxml2-install/share/libxml2
|
||||
@ -147,7 +147,7 @@ cmake:linux:clang:static:
|
||||
.\7za.exe x xmlts20080827.tar.gz -olibxml2-build
|
||||
}
|
||||
script:
|
||||
- cmake -G Ninja -DBUILD_SHARED_LIBS="$Env:BUILD_SHARED_LIBS" -DCMAKE_INSTALL_PREFIX=libxml2-install -DCMAKE_BUILD_TYPE=RelWithDebInfo -S . -B libxml2-build
|
||||
- cmake -G Ninja -DBUILD_SHARED_LIBS="$Env:BUILD_SHARED_LIBS" -DCMAKE_INSTALL_PREFIX=libxml2-install -DCMAKE_C_FLAGS='-Werror' -DCMAKE_BUILD_TYPE=RelWithDebInfo -S . -B libxml2-build
|
||||
- cmake --build libxml2-build --target install
|
||||
- New-Item -ItemType Directory libxml2-install\share\libxml2
|
||||
- Copy-Item Copyright libxml2-install\share\libxml2
|
||||
|
@ -359,8 +359,13 @@ if(NOT BUILD_SHARED_LIBS)
|
||||
set(XML_CFLAGS "-DLIBXML_STATIC")
|
||||
endif()
|
||||
|
||||
if(BUILD_SHARED_LIBS AND UNIX AND NOT APPLE)
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
if(CMAKE_C_COMPILER_ID MATCHES "Clang" OR CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wall -Wextra -Wshadow \
|
||||
-Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return \
|
||||
-Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline \
|
||||
-Wredundant-decls -Wno-long-long -Wno-format-extra-args")
|
||||
|
||||
if(BUILD_SHARED_LIBS AND UNIX AND NOT APPLE)
|
||||
target_link_options(LibXml2 PRIVATE "-Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libxml2.syms")
|
||||
endif()
|
||||
endif()
|
||||
|
Loading…
x
Reference in New Issue
Block a user