diff --git a/CMakeLists.txt b/CMakeLists.txt index 1a378bfc..cbb1a48e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -495,7 +495,7 @@ if(NOT DEFINED MDBX_C_STANDARD) endif() endif() -if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows" AND EXISTS "${MDBX_SOURCE_DIR}/ntdll.def") +if(WIN32 AND EXISTS "${MDBX_SOURCE_DIR}/ntdll.def") if(MSVC) if(NOT MSVC_LIB_EXE) # Find lib.exe @@ -592,7 +592,7 @@ if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin" OR IOS) add_mdbx_option(MDBX_OSX_SPEED_INSTEADOF_DURABILITY "Disable use fcntl(F_FULLFSYNC) in favor of speed" OFF) mark_as_advanced(MDBX_OSX_SPEED_INSTEADOF_DURABILITY) endif() -if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") +if(WIN32) if(MDBX_NTDLL_EXTRA_IMPLIB) add_mdbx_option(MDBX_WITHOUT_MSVC_CRT "Avoid dependence from MSVC CRT and use ntdll.dll instead" OFF) endif() @@ -825,7 +825,7 @@ macro(libmdbx_setup_libs TARGET MODE) else() target_link_libraries(${TARGET} ${MODE} Threads::Threads) endif() - if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") + if(WIN32) target_link_libraries(${TARGET} ${MODE} ntdll user32 kernel32 advapi32 ole32) if(MDBX_NTDLL_EXTRA_IMPLIB AND MDBX_WITHOUT_MSVC_CRT) target_link_libraries(${TARGET} ${MODE} ntdll_extra) @@ -913,7 +913,7 @@ endif() # build mdbx-tools if(MDBX_BUILD_TOOLS) set(WINGETOPT_SRC "") - if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") + if(WIN32) set(WINGETOPT_SRC ${MDBX_SOURCE_DIR}/tools/wingetopt.c ${MDBX_SOURCE_DIR}/tools/wingetopt.h) endif() diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index f945255d..c5537f87 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -53,7 +53,7 @@ target_setup_options(mdbx_test) if(NOT MDBX_BUILD_CXX) target_compile_definitions(mdbx_test PRIVATE MDBX_BUILD_CXX=1) - if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") + if(WIN32) target_compile_definitions(mdbx_test PRIVATE MDBX_WITHOUT_MSVC_CRT=0) endif() endif() @@ -71,7 +71,7 @@ if(CMAKE_VERSION VERSION_LESS 3.1) else() target_link_libraries(mdbx_test ${TOOL_MDBX_LIB} ${LIB_MATH} Threads::Threads) endif() -if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") +if(WIN32) target_link_libraries(mdbx_test winmm.lib) endif()