From acfb54bb2f07072fab4adaa365fd7bdcdf83468a Mon Sep 17 00:00:00 2001 From: Raul Tambre Date: Wed, 23 Dec 2020 12:39:09 +0200 Subject: Clang: Support WIN32_EXECUTABLE Fixes #21613. --- Help/release/dev/clang-win32-subsystem.rst | 4 ++++ Modules/Platform/Windows-Clang.cmake | 3 +++ 2 files changed, 7 insertions(+) create mode 100644 Help/release/dev/clang-win32-subsystem.rst diff --git a/Help/release/dev/clang-win32-subsystem.rst b/Help/release/dev/clang-win32-subsystem.rst new file mode 100644 index 0000000..c970f53 --- /dev/null +++ b/Help/release/dev/clang-win32-subsystem.rst @@ -0,0 +1,4 @@ +clang-win32-subsystem +--------------------- + +* :prop_tgt:`WIN32_EXECUTABLE` now works on Windows with Clang. 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 " -fuse-ld=lld-link -nostartfiles -nostdlib -o -Xlinker /implib: -Xlinker /pdb: -Xlinker /version:. ${CMAKE_GNULD_IMAGE_VERSION} ") + 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) -- cgit v0.12