summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllen Winter <allen.winter@kdab.com>2021-11-06 16:30:26 -0400
committerAllen Winter <allen.winter@kdab.com>2021-11-06 16:30:26 -0400
commit485bb36c10bfda5d22068f1c3bf95be3548d0557 (patch)
treedfa0e38a789003c5488548d6dc8c184da74d9554
parent58f86d6c53f8f95ee31bd80d7451a006e29171c1 (diff)
downloadlibical-git-485bb36c10bfda5d22068f1c3bf95be3548d0557.tar.gz
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."
-rw-r--r--ConfigureChecks.cmake14
1 files 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 <windows.h>
-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 <windows.h>
+ set(CMAKE_REQUIRED_LIBRARIES ${_SAVE_RQL})
+endif()
include(CheckTypeSize)
check_type_size(intptr_t SIZEOF_INTPTR_T)