mirror of
https://github.com/madler/zlib
synced 2025-03-28 21:13:15 +00:00
Use generated zconf.h in cmake build.
This restores the inclusion of the local zconf.h (double quoted) in normal usage.
This commit is contained in:
parent
7108497fda
commit
5a82f71ed1
@ -119,7 +119,6 @@ unset(CMAKE_COMPILE_FLAGS)
|
|||||||
set(ZLIB_PC ${zlib_BINARY_DIR}/zlib.pc)
|
set(ZLIB_PC ${zlib_BINARY_DIR}/zlib.pc)
|
||||||
configure_file(${zlib_SOURCE_DIR}/zlib.pc.cmakein ${ZLIB_PC} @ONLY)
|
configure_file(${zlib_SOURCE_DIR}/zlib.pc.cmakein ${ZLIB_PC} @ONLY)
|
||||||
configure_file(${zlib_BINARY_DIR}/zconf.h.cmakein ${zlib_BINARY_DIR}/zconf.h)
|
configure_file(${zlib_BINARY_DIR}/zconf.h.cmakein ${zlib_BINARY_DIR}/zconf.h)
|
||||||
include_directories(${zlib_BINARY_DIR} ${zlib_SOURCE_DIR})
|
|
||||||
|
|
||||||
# ============================================================================
|
# ============================================================================
|
||||||
# zlib
|
# zlib
|
||||||
@ -172,7 +171,8 @@ if(ZLIB_BUILD_SHARED)
|
|||||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
|
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
|
||||||
target_compile_definitions(
|
target_compile_definitions(
|
||||||
zlib
|
zlib
|
||||||
PRIVATE $<$<BOOL:NOT:${HAVE_FSEEKO}>:NO_FSEEKO>
|
PRIVATE ZLIB_BUILD
|
||||||
|
$<$<BOOL:NOT:${HAVE_FSEEKO}>:NO_FSEEKO>
|
||||||
$<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN>
|
$<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN>
|
||||||
$<$<BOOL:${MSVC}>:_CRT_SECURE_NO_DEPRECATE>
|
$<$<BOOL:${MSVC}>:_CRT_SECURE_NO_DEPRECATE>
|
||||||
$<$<BOOL:${MSVC}>:_CRT_NONSTDC_NO_DEPRECATE>
|
$<$<BOOL:${MSVC}>:_CRT_NONSTDC_NO_DEPRECATE>
|
||||||
@ -214,7 +214,8 @@ if(ZLIB_BUILD_STATIC)
|
|||||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
|
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
|
||||||
target_compile_definitions(
|
target_compile_definitions(
|
||||||
zlibstatic
|
zlibstatic
|
||||||
PRIVATE $<$<BOOL:NOT:${HAVE_FSEEKO}>:NO_FSEEKO>
|
PRIVATE ZLIB_BUILD
|
||||||
|
$<$<BOOL:NOT:${HAVE_FSEEKO}>:NO_FSEEKO>
|
||||||
$<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN>
|
$<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN>
|
||||||
$<$<BOOL:${MSVC}>:_CRT_SECURE_NO_DEPRECATE>
|
$<$<BOOL:${MSVC}>:_CRT_SECURE_NO_DEPRECATE>
|
||||||
$<$<BOOL:${MSVC}>:_CRT_NONSTDC_NO_DEPRECATE>
|
$<$<BOOL:${MSVC}>:_CRT_NONSTDC_NO_DEPRECATE>
|
||||||
|
@ -16,6 +16,7 @@ endfunction()
|
|||||||
if(ZLIB_BUILD_SHARED)
|
if(ZLIB_BUILD_SHARED)
|
||||||
add_executable(zlib_example example.c)
|
add_executable(zlib_example example.c)
|
||||||
target_link_libraries(zlib_example ZLIB::ZLIB)
|
target_link_libraries(zlib_example ZLIB::ZLIB)
|
||||||
|
target_compile_definitions(zlib_example PRIVATE ZLIB_BUILD)
|
||||||
add_test(NAME zlib_example COMMAND zlib_example)
|
add_test(NAME zlib_example COMMAND zlib_example)
|
||||||
|
|
||||||
add_executable(minigzip minigzip.c)
|
add_executable(minigzip minigzip.c)
|
||||||
@ -38,7 +39,7 @@ if(ZLIB_BUILD_SHARED)
|
|||||||
add_executable(zlib_example64 example.c)
|
add_executable(zlib_example64 example.c)
|
||||||
target_compile_definitions(
|
target_compile_definitions(
|
||||||
zlib_example64
|
zlib_example64
|
||||||
PRIVATE LARGEFILE64_SOURCE=1
|
PRIVATE ZLIB_BUILD
|
||||||
$<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN>)
|
$<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN>)
|
||||||
target_link_libraries(zlib_example64 ZLIB::ZLIB)
|
target_link_libraries(zlib_example64 ZLIB::ZLIB)
|
||||||
add_test(NAME zlib_example64 COMMAND zlib_example64)
|
add_test(NAME zlib_example64 COMMAND zlib_example64)
|
||||||
@ -61,7 +62,8 @@ if(ZLIB_BUILD_STATIC)
|
|||||||
target_link_libraries(zlib_static_example ZLIB::ZLIBSTATIC)
|
target_link_libraries(zlib_static_example ZLIB::ZLIBSTATIC)
|
||||||
target_compile_definitions(
|
target_compile_definitions(
|
||||||
zlib_static_example
|
zlib_static_example
|
||||||
PRIVATE $<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN>)
|
PRIVATE ZLIB_BUILD
|
||||||
|
$<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN>)
|
||||||
add_test(NAME zlib_static_example COMMAND zlib_static_example)
|
add_test(NAME zlib_static_example COMMAND zlib_static_example)
|
||||||
|
|
||||||
add_executable(static_minigzip minigzip.c)
|
add_executable(static_minigzip minigzip.c)
|
||||||
@ -116,7 +118,7 @@ if(ZLIB_BUILD_STATIC)
|
|||||||
add_executable(zlib_static_example64 example.c)
|
add_executable(zlib_static_example64 example.c)
|
||||||
target_compile_definitions(
|
target_compile_definitions(
|
||||||
zlib_static_example64
|
zlib_static_example64
|
||||||
PRIVATE LARGEFILE64_SOURCE=1
|
PRIVATE ZLIB_BUILD
|
||||||
$<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN>)
|
$<$<BOOL:${HAVE___ATTR__VIS_HIDDEN}>:HAVE_HIDDEN>)
|
||||||
target_link_libraries(zlib_static_example64 ZLIB::ZLIBSTATIC)
|
target_link_libraries(zlib_static_example64 ZLIB::ZLIBSTATIC)
|
||||||
add_test(NAME zlib_static_example64 COMMAND zlib_static_example64)
|
add_test(NAME zlib_static_example64 COMMAND zlib_static_example64)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user