diff --git a/CMakeLists.txt b/CMakeLists.txt index 2faf44162..3dd255359 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -131,13 +131,20 @@ target_include_directories(${PROJECT_NAME} PRIVATE ${LIBS_INCLUDE}) if (USE_INCLUDED_LIBZIP) target_compile_options(${PROJECT_NAME} PRIVATE "-DZIP_STATIC") target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/Libraries/libzip/Include) + if(MSVC) + target_compile_definitions(${PROJECT_NAME} PRIVATE _CRT_SECURE_NO_WARNINGS) + target_compile_definitions(${PROJECT_NAME} PRIVATE _CRT_NONSTDC_NO_DEPRECATE) + endif() if(WIN32) - if(MSVC) - target_compile_definitions(${PROJECT_NAME} PRIVATE _CRT_SECURE_NO_WARNINGS) - target_compile_definitions(${PROJECT_NAME} PRIVATE _CRT_NONSTDC_NO_DEPRECATE) - endif() target_link_libraries(${PROJECT_NAME} PRIVATE advapi32) endif() + if (UNIX OR MINGW) + target_compile_options(${PROJECT_NAME} PRIVATE "-DHAVE_FSEEKO") + target_compile_options(${PROJECT_NAME} PRIVATE "-DHAVE_FTELLO") + target_compile_options(${PROJECT_NAME} PRIVATE "-DHAVE_STRCASECMP") + target_compile_options(${PROJECT_NAME} PRIVATE "-DHAVE_UNISTD_H") + endif() + else() find_package(PkgConfig REQUIRED) pkg_check_modules(LIBZIP REQUIRED libzip)