From 485bb36c10bfda5d22068f1c3bf95be3548d0557 Mon Sep 17 00:00:00 2001 From: Allen Winter Date: Sat, 6 Nov 2021 16:30:26 -0400 Subject: ConfigureChecks.cmake - Look for GetNumberFormat on Windows only Thanks to paweljonskim "Resolve GetNumberFormat only on windows GetNumberFormat is not implemented on wine correctly (https://forum.winehq.org/viewtopic.php?t=27809) which results in error when building. That means - if any linux user has installed wine, the build of libical will fail." --- ConfigureChecks.cmake | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index bba33fa9..ddb64604 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -61,10 +61,16 @@ if(MSVC_VERSION GREATER 1899) set(HAVE_SNPRINTF true) endif() -set(_SAVE_RQL ${CMAKE_REQUIRED_LIBRARIES}) -set(CMAKE_REQUIRED_LIBRARIES kernel32.lib) -check_function_exists(GetNumberFormat HAVE_GETNUMBERFORMAT) #Windows -set(CMAKE_REQUIRED_LIBRARIES ${_SAVE_RQL}) +#GetNumberFormat is not implemented on wine correctly +#(see https://forum.winehq.org/viewtopic.php?t=27809) which results in +#error when building. That means if linux user has installed wine, +#the build of libical will fail. +if(WIN32) + set(_SAVE_RQL ${CMAKE_REQUIRED_LIBRARIES}) + set(CMAKE_REQUIRED_LIBRARIES kernel32.lib) + check_function_exists(GetNumberFormat HAVE_GETNUMBERFORMAT) #Windows + set(CMAKE_REQUIRED_LIBRARIES ${_SAVE_RQL}) +endif() include(CheckTypeSize) check_type_size(intptr_t SIZEOF_INTPTR_T) -- cgit v1.2.1