From 2a61133a9ec6dc2425955667fb92038d1dcd149e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Hrdli=C4=8Dka?= Date: Thu, 23 Dec 2021 22:01:26 +0100 Subject: [PATCH] Fix manifest inclusion on CMake <3.22 --- src/win/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/win/CMakeLists.txt b/src/win/CMakeLists.txt index ff59612ce..36c3dc9ac 100644 --- a/src/win/CMakeLists.txt +++ b/src/win/CMakeLists.txt @@ -27,13 +27,17 @@ if(NOT CPPTHREADS) target_sources(plat PRIVATE win_thread.c) endif() -if(NOT MINGW) +# CMake 3.22 messed this up for clang/clang++ +# See https://gitlab.kitware.com/cmake/cmake/-/issues/22611 +if(MSVC OR (NOT MINGW AND CMAKE_VERSION VERSION_GREATER_EQUAL 3.22)) # MSVC linker adds its own manifest to the executable, which fails if # we include ours in 86Box.rc. We therefore need to pass the manifest # directly as as a source file, so the linker can use that instead. set_property(SOURCE 86Box.rc PROPERTY COMPILE_DEFINITIONS NO_INCLUDE_MANIFEST) target_sources(86Box PRIVATE 86Box.manifest) +endif() +if(NOT MINGW) # Append null to resource strings (fixes file dialogs) set_property(SOURCE 86Box.rc PROPERTY COMPILE_FLAGS -n)