mirror of
https://git.code.sf.net/p/libpng/code.git
synced 2025-07-10 18:04:09 +02:00
build: Mark the installed libpng headers as system headers in CMake
Modern compilers can disable the warnings that originate from system headers. This change allows them to do so with the libpng headers. Signed-off-by: Cosmin Truta <ctruta@gmail.com>
This commit is contained in:
parent
14a348ddc8
commit
7b888092b9
@ -714,10 +714,9 @@ if(PNG_SHARED)
|
|||||||
set_target_properties(png_shared PROPERTIES DEFINE_SYMBOL PNG_BUILD_DLL)
|
set_target_properties(png_shared PROPERTIES DEFINE_SYMBOL PNG_BUILD_DLL)
|
||||||
endif()
|
endif()
|
||||||
target_include_directories(png_shared
|
target_include_directories(png_shared
|
||||||
PUBLIC
|
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
|
||||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>
|
target_include_directories(png_shared SYSTEM
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>)
|
||||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
|
||||||
target_link_libraries(png_shared PUBLIC ZLIB::ZLIB ${M_LIBRARY})
|
target_link_libraries(png_shared PUBLIC ZLIB::ZLIB ${M_LIBRARY})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -729,10 +728,9 @@ if(PNG_STATIC)
|
|||||||
OUTPUT_NAME "${PNG_STATIC_OUTPUT_NAME}"
|
OUTPUT_NAME "${PNG_STATIC_OUTPUT_NAME}"
|
||||||
DEBUG_POSTFIX "${PNG_DEBUG_POSTFIX}")
|
DEBUG_POSTFIX "${PNG_DEBUG_POSTFIX}")
|
||||||
target_include_directories(png_static
|
target_include_directories(png_static
|
||||||
PUBLIC
|
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
|
||||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>
|
target_include_directories(png_static SYSTEM
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>)
|
||||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
|
||||||
target_link_libraries(png_static PUBLIC ZLIB::ZLIB ${M_LIBRARY})
|
target_link_libraries(png_static PUBLIC ZLIB::ZLIB ${M_LIBRARY})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
@ -759,10 +757,9 @@ if(PNG_FRAMEWORK)
|
|||||||
# Avoid CMake's implicit compile definition "-Dpng_framework_EXPORTS".
|
# Avoid CMake's implicit compile definition "-Dpng_framework_EXPORTS".
|
||||||
set_target_properties(png_framework PROPERTIES DEFINE_SYMBOL "")
|
set_target_properties(png_framework PROPERTIES DEFINE_SYMBOL "")
|
||||||
target_include_directories(png_framework
|
target_include_directories(png_framework
|
||||||
PUBLIC
|
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
|
||||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>
|
target_include_directories(png_framework SYSTEM
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
INTERFACE $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/libpng${PNGLIB_ABI_VERSION}>)
|
||||||
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
|
|
||||||
target_link_libraries(png_framework PUBLIC ZLIB::ZLIB ${M_LIBRARY})
|
target_link_libraries(png_framework PUBLIC ZLIB::ZLIB ${M_LIBRARY})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
@ -7,6 +7,7 @@ Author List
|
|||||||
* Alex Gaynor
|
* Alex Gaynor
|
||||||
* Andreas Franek
|
* Andreas Franek
|
||||||
* B. Scott Michel
|
* B. Scott Michel
|
||||||
|
* Benjamin Buch
|
||||||
* Cameron Cawley
|
* Cameron Cawley
|
||||||
* Christian Ehrlicher
|
* Christian Ehrlicher
|
||||||
* Christopher Sean Morrison
|
* Christopher Sean Morrison
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user