CMake: Fix build without double-conversion on macOS
Change-Id: I5102e93141eec95044df44884dcf6ecd1b9e8dd0 Reviewed-by: Mikhail Svetkin <mikhail.svetkin@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
parent
ca1113728e
commit
885494c50f
@ -1,5 +1,15 @@
|
|||||||
include(CheckCXXSourceCompiles)
|
include(CheckCXXSourceCompiles)
|
||||||
|
|
||||||
|
add_library(WrapDoubleConversion INTERFACE)
|
||||||
|
|
||||||
|
find_package(double-conversion)
|
||||||
|
if (double-conversion_FOUND)
|
||||||
|
set_package_properties(double-conversion PROPERTIES TYPE REQUIRED)
|
||||||
|
target_link_libraries(WrapDoubleConversion INTERFACE double-conversion::double-conversion)
|
||||||
|
set(WrapDoubleConversion_FOUND 1)
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
check_cxx_source_compiles("
|
check_cxx_source_compiles("
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
@ -25,12 +35,9 @@ int main(int argc, char *argv[]) {
|
|||||||
return 0;
|
return 0;
|
||||||
}" HAVE_SPRINTF_L)
|
}" HAVE_SPRINTF_L)
|
||||||
|
|
||||||
add_library(WrapDoubleConversion INTERFACE)
|
if (HAVE__SPRINTF_L OR HAVE_SPRINTF_L)
|
||||||
if (NOT HAVE__SPRINTF_L AND NOT HAVE_SPRINTF_L)
|
target_compile_definitions(WrapDoubleConversion INTERFACE QT_NO_DOUBLECONVERSION)
|
||||||
find_package(double-conversion)
|
set(WrapDoubleConversion_FOUND 1)
|
||||||
set_package_properties(double-conversion PROPERTIES TYPE REQUIRED)
|
else()
|
||||||
target_link_libraries(WrapDoubleConversion INTERFACE double-conversion::double-conversion)
|
set(WrapDoubleConversion_FOUND 0)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(WrapDoubleConversion_FOUND 1)
|
|
||||||
|
|
||||||
|
@ -1,6 +1,11 @@
|
|||||||
find_package(Threads)
|
find_package(Threads)
|
||||||
find_package(WrapDoubleConversion REQUIRED)
|
find_package(WrapDoubleConversion REQUIRED)
|
||||||
|
|
||||||
|
if (NOT WrapDoubleConversion_FOUND)
|
||||||
|
message(FATAL_ERROR "Your C library does not provide sscanf_l/snprintf_l _snprintf_l/_sscanf_l. \
|
||||||
|
You need to use libdouble-conversion for double/string conversion.")
|
||||||
|
endif()
|
||||||
|
|
||||||
find_library(FWAppKit AppKit)
|
find_library(FWAppKit AppKit)
|
||||||
find_library(FWApplicationServices ApplicationServices)
|
find_library(FWApplicationServices ApplicationServices)
|
||||||
find_library(FWCoreFoundation CoreFoundation)
|
find_library(FWCoreFoundation CoreFoundation)
|
||||||
|
@ -50,7 +50,7 @@ def map_library(lib: str) -> Union[str, LibraryMapping, List[str]]:
|
|||||||
'atspi': 'ATSPI2',
|
'atspi': 'ATSPI2',
|
||||||
'corewlan': None, # Framework
|
'corewlan': None, # Framework
|
||||||
'cups': 'Cups',
|
'cups': 'Cups',
|
||||||
'double-conversion': 'WrapDoubleConversion',
|
'double-conversion': None,
|
||||||
'drm': 'Libdrm',
|
'drm': 'Libdrm',
|
||||||
'egl': 'EGL',
|
'egl': 'EGL',
|
||||||
'fontconfig': LibraryMapping(package='Fontconfig', resultVariable="FONTCONFIG"),
|
'fontconfig': LibraryMapping(package='Fontconfig', resultVariable="FONTCONFIG"),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user