CMake: Add support for building with clang-cl
qmake had support for building with clang-cl as the win32-clang-msvc mkspec. Task-number: QTBUG-89642 Task-number: QTBUG-88081 Change-Id: I0709c289f90fedb121620d1e67ef841602219816 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
This commit is contained in:
parent
6d82d0c532
commit
20b3eb0fd8
@ -285,7 +285,9 @@ if(WIN32)
|
|||||||
list(APPEND QT_DEFAULT_PLATFORM_DEFINITIONS WIN64 _WIN64)
|
list(APPEND QT_DEFAULT_PLATFORM_DEFINITIONS WIN64 _WIN64)
|
||||||
endif()
|
endif()
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
|
if (CLANG)
|
||||||
|
set(QT_DEFAULT_MKSPEC win32-clang-msvc)
|
||||||
|
elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64")
|
||||||
set(QT_DEFAULT_MKSPEC win32-arm64-msvc)
|
set(QT_DEFAULT_MKSPEC win32-arm64-msvc)
|
||||||
else()
|
else()
|
||||||
set(QT_DEFAULT_MKSPEC win32-msvc)
|
set(QT_DEFAULT_MKSPEC win32-msvc)
|
||||||
|
@ -235,7 +235,7 @@ endfunction()
|
|||||||
function(qt_set_msvc_cplusplus_options target visibility)
|
function(qt_set_msvc_cplusplus_options target visibility)
|
||||||
# For MSVC we need to explicitly pass -Zc:__cplusplus to get correct __cplusplus.
|
# For MSVC we need to explicitly pass -Zc:__cplusplus to get correct __cplusplus.
|
||||||
# Check qt_config_compile_test for more info.
|
# Check qt_config_compile_test for more info.
|
||||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" AND MSVC_VERSION GREATER_EQUAL 1913)
|
if(MSVC AND MSVC_VERSION GREATER_EQUAL 1913)
|
||||||
target_compile_options("${target}" ${visibility} "-Zc:__cplusplus" "-permissive-")
|
target_compile_options("${target}" ${visibility} "-Zc:__cplusplus" "-permissive-")
|
||||||
endif()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
@ -271,6 +271,26 @@ qt_internal_add_module(Core
|
|||||||
# special case end
|
# special case end
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if (MSVC AND CLANG)
|
||||||
|
foreach(subarch sse4_1 rdrnd rdseed)
|
||||||
|
if (TEST_subarch_${subarch})
|
||||||
|
qt_internal_add_simd_part(Core SIMD ${subarch}
|
||||||
|
SOURCES
|
||||||
|
global/qsimd.cpp
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
foreach(subarch sse4_1 aesni)
|
||||||
|
if (TEST_subarch_${subarch})
|
||||||
|
qt_internal_add_simd_part(Core SIMD ${subarch}
|
||||||
|
SOURCES
|
||||||
|
tools/qhash.cpp
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
endif()
|
||||||
|
|
||||||
qt_update_ignore_pch_source(Core kernel/qmetatype.cpp )
|
qt_update_ignore_pch_source(Core kernel/qmetatype.cpp )
|
||||||
|
|
||||||
# special case begin
|
# special case begin
|
||||||
|
@ -62,19 +62,24 @@
|
|||||||
# define _POSIX_
|
# define _POSIX_
|
||||||
# include <limits.h>
|
# include <limits.h>
|
||||||
# undef _POSIX_
|
# undef _POSIX_
|
||||||
#endif
|
# if defined(Q_CC_CLANG) && defined(Q_CC_MSVC)
|
||||||
#include <qcoreapplication.h>
|
// See https://bugs.llvm.org/show_bug.cgi?id=41226
|
||||||
#include <qcoreevent.h>
|
# include <wchar.h>
|
||||||
#include <qiodevice.h>
|
__declspec(selectany) auto *__wmemchr_symbol_loader_value = wmemchr(L"", L'0', 0);
|
||||||
#include <qlist.h>
|
# endif
|
||||||
#include <qvariant.h> /* All moc genereated code has this include */
|
# endif
|
||||||
#include <qobject.h>
|
# include <qcoreapplication.h>
|
||||||
#if QT_CONFIG(regularexpression)
|
# include <qcoreevent.h>
|
||||||
# include <qregularexpression.h>
|
# include <qiodevice.h>
|
||||||
#endif
|
# include <qlist.h>
|
||||||
#include <qscopedpointer.h>
|
# include <qvariant.h> /* All moc genereated code has this include */
|
||||||
#include <qshareddata.h>
|
# include <qobject.h>
|
||||||
#include <qstring.h>
|
# if QT_CONFIG(regularexpression)
|
||||||
#include <qstringlist.h>
|
# include <qregularexpression.h>
|
||||||
#include <qtimer.h>
|
# endif
|
||||||
|
# include <qscopedpointer.h>
|
||||||
|
# include <qshareddata.h>
|
||||||
|
# include <qstring.h>
|
||||||
|
# include <qstringlist.h>
|
||||||
|
# include <qtimer.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -577,6 +577,15 @@ if(NOT ANDROID)
|
|||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if (MSVC AND CLANG AND TEST_subarch_sse4_1)
|
||||||
|
qt_internal_add_simd_part(Gui SIMD sse4_1
|
||||||
|
SOURCES
|
||||||
|
painting/qdrawhelper.cpp
|
||||||
|
painting/qdrawhelper_sse2.cpp
|
||||||
|
painting/qdrawhelper_ssse3.cpp
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
qt_internal_add_simd_part(Gui SIMD ssse3
|
qt_internal_add_simd_part(Gui SIMD ssse3
|
||||||
SOURCES
|
SOURCES
|
||||||
image/qimage_ssse3.cpp
|
image/qimage_ssse3.cpp
|
||||||
|
Loading…
x
Reference in New Issue
Block a user