summaryrefslogtreecommitdiffstats
path: root/Modules/Platform/Windows-Clang.cmake
diff options
context:
space:
mode:
authorRaul Tambre <raul@tambre.ee>2020-12-23 10:39:09 (GMT)
committerRaul Tambre <raul@tambre.ee>2020-12-23 10:39:09 (GMT)
commitacfb54bb2f07072fab4adaa365fd7bdcdf83468a (patch)
tree1371f31afd53879f4cbee97f3d59ed76ed7c1e7a /Modules/Platform/Windows-Clang.cmake
parent8c9c338e5e297020df0b5cdf9443beef245513de (diff)
downloadCMake-acfb54bb2f07072fab4adaa365fd7bdcdf83468a.zip
CMake-acfb54bb2f07072fab4adaa365fd7bdcdf83468a.tar.gz
CMake-acfb54bb2f07072fab4adaa365fd7bdcdf83468a.tar.bz2
Clang: Support WIN32_EXECUTABLE
Fixes #21613.
Diffstat (limited to 'Modules/Platform/Windows-Clang.cmake')
-rw-r--r--Modules/Platform/Windows-Clang.cmake3
1 files changed, 3 insertions, 0 deletions
diff --git a/Modules/Platform/Windows-Clang.cmake b/Modules/Platform/Windows-Clang.cmake
index 51e9e81..dc41572 100644
--- a/Modules/Platform/Windows-Clang.cmake
+++ b/Modules/Platform/Windows-Clang.cmake
@@ -71,6 +71,9 @@ macro(__windows_compiler_clang_gnu lang)
set(CMAKE_${lang}_LINK_EXECUTABLE
"<CMAKE_${lang}_COMPILER> -fuse-ld=lld-link -nostartfiles -nostdlib <FLAGS> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> -Xlinker /implib:<TARGET_IMPLIB> -Xlinker /pdb:<TARGET_PDB> -Xlinker /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> ${CMAKE_GNULD_IMAGE_VERSION} <LINK_LIBRARIES>")
+ set(CMAKE_CREATE_WIN32_EXE "-Xlinker /subsystem:windows")
+ set(CMAKE_CREATE_CONSOLE_EXE "-Xlinker /subsystem:console")
+
if(NOT "${lang}" STREQUAL "ASM")
set(CMAKE_${lang}_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreaded -Xclang -flto-visibility-public-std -D_MT -Xclang --dependent-lib=libcmt)
set(CMAKE_${lang}_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDLL -D_DLL -D_MT -Xclang --dependent-lib=msvcrt)