mirror of
				https://github.com/eledio-devices/thirdparty-miniz.git
				synced 2025-10-31 08:42:39 +01:00 
			
		
		
		
	Add include location tolerance and stop forcing _GNU_SOURCE.
_GNU_SOURCE will still be enabled if building static or shared library, but only as a PRIVATE compile definition. It will not leak into targets using miniz.
This commit is contained in:
		| @@ -64,8 +64,11 @@ if(AMALGAMATE_SOURCES) | |||||||
|     file(WRITE ${CMAKE_BINARY_DIR}/amalgamation/miniz.h "${AMAL_MINIZ_H}") |     file(WRITE ${CMAKE_BINARY_DIR}/amalgamation/miniz.h "${AMAL_MINIZ_H}") | ||||||
|     add_library(${PROJECT_NAME} INTERFACE) |     add_library(${PROJECT_NAME} INTERFACE) | ||||||
|      |      | ||||||
|     target_compile_definitions(${PROJECT_NAME}  |     # Might not be a good idea to force this on the library user | ||||||
|         INTERFACE $<$<C_COMPILER_ID:GNU>:_GNU_SOURCE>) |     # as it could bloat the global namespace | ||||||
|  |     # https://github.com/libevent/libevent/issues/460 | ||||||
|  |     # target_compile_definitions(${PROJECT_NAME}  | ||||||
|  |     #     INTERFACE $<$<C_COMPILER_ID:GNU>:_GNU_SOURCE>) | ||||||
|      |      | ||||||
|     set_property(TARGET ${PROJECT_NAME} APPEND  |     set_property(TARGET ${PROJECT_NAME} APPEND  | ||||||
|       PROPERTY INTERFACE_INCLUDE_DIRECTORIES |       PROPERTY INTERFACE_INCLUDE_DIRECTORIES | ||||||
| @@ -131,7 +134,8 @@ install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME}Targets | |||||||
|   RUNTIME  DESTINATION bin |   RUNTIME  DESTINATION bin | ||||||
|   ARCHIVE  DESTINATION lib |   ARCHIVE  DESTINATION lib | ||||||
|   LIBRARY  DESTINATION lib |   LIBRARY  DESTINATION lib | ||||||
|   INCLUDES DESTINATION include |   # users can use <miniz.h> or <miniz/miniz.h> | ||||||
|  |   INCLUDES DESTINATION include include/${PROJECT_NAME} | ||||||
|   ) |   ) | ||||||
|  |  | ||||||
| include(CMakePackageConfigHelpers) | include(CMakePackageConfigHelpers) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user