From 449eee2d108589d2b8549d6682c8b5e792e659b8 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Tue, 11 Jun 2019 11:21:17 +0200 Subject: [PATCH] Don't add _LARGEFILE64_SOURCE define on Windows In qmake land, the largefile.prf feature is automatically loaded due to 'largefile' being added to CONFIG via the equivalent feature. The prf file is in the 'unix' subfolder though, which means that qmake doesn't load it on Windows. We need to do the same, otherwise we get build errors due to the define being checked in ZLIB headers, and selecting an invalid code branch on Windows. Change-Id: Ibe9202a639754927262bb8aaa28289934f2e23ef Reviewed-by: Simon Hausmann --- cmake/QtInternalTargets.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmake/QtInternalTargets.cmake b/cmake/QtInternalTargets.cmake index 7ca78fbbff..083be94ab4 100644 --- a/cmake/QtInternalTargets.cmake +++ b/cmake/QtInternalTargets.cmake @@ -72,8 +72,9 @@ if(WIN32) # It's set for every module being built, but it's not propagated to user apps. target_compile_definitions(PlatformModuleInternal INTERFACE _USE_MATH_DEFINES) endif() -if(FEATURE_largefile) - target_compile_definitions(PlatformModuleInternal INTERFACE "_LARGEFILE64_SOURCE;_LARGEFILE_SOURCE") +if(FEATURE_largefile AND UNIX) + target_compile_definitions(PlatformModuleInternal + INTERFACE "_LARGEFILE64_SOURCE;_LARGEFILE_SOURCE") endif() # We can't use the gold linker on android with the NDK, which is the default