always disable zlib shared target

This commit is contained in:
Elias Bachaalany
2025-01-17 06:36:33 -08:00
parent bc7b9bc915
commit 1ce56e163b
2 changed files with 10 additions and 11 deletions

10
deps/zlib.cmake vendored
View File

@@ -1,4 +1,12 @@
set(ZLIB_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
add_subdirectory(zlib)
target_compile_definitions(zlibstatic PUBLIC ZLIB_CONST=1)
target_include_directories(zlibstatic PUBLIC ${zlib_SOURCE_DIR} ${zlib_BINARY_DIR})
target_include_directories(zlibstatic PUBLIC ${zlib_SOURCE_DIR} ${zlib_BINARY_DIR})
if (TARGET zlib)
# Remove all properties and dependencies from the zlib shared lib target
# (this will keep the zlibstatic target)
set_target_properties(zlib PROPERTIES EXCLUDE_FROM_ALL TRUE)
set_target_properties(zlib PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD TRUE)
message(STATUS "Target 'zlib' has been disabled.")
endif()

View File

@@ -2,16 +2,7 @@ add_subdirectory(common)
add_subdirectory(emulator)
add_subdirectory(unicorn-emulator)
add_subdirectory(windows-emulator)
if (MOMO_BUILD_AS_LIBRARY)
if (TARGET zlib)
# Remove all properties and dependencies from the zlib shared lib target
# (this will keep the zlibstatic target)
set_target_properties(zlib PROPERTIES EXCLUDE_FROM_ALL TRUE)
set_target_properties(zlib PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD TRUE)
message(STATUS "Target 'zlib' has been disabled in emulator-lib mode.")
endif()
else()
if (NOT MOMO_BUILD_AS_LIBRARY)
add_subdirectory(analyzer)
add_subdirectory(fuzzing-engine)
add_subdirectory(fuzzer)