From caf30362747c6c258f7ec47f236b702061ee21e2 Mon Sep 17 00:00:00 2001 From: gangatp Date: Wed, 6 Dec 2023 18:23:05 +0530 Subject: [PATCH] checking mingw and unix build --- CMakeLists.txt | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) 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)