From 99448eedca8f3759b8de44c356f3947dbd6e448b Mon Sep 17 00:00:00 2001 From: glx22 Date: Fri, 5 Feb 2021 22:31:33 +0100 Subject: [PATCH] Fix: [CMake] os/windows/openttd.manifest is not a generated file --- CMakeLists.txt | 5 +++++ cmake/CompileFlags.cmake | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1ac5be5bee..2fb7a2309a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -201,6 +201,11 @@ add_executable(openttd WIN32 ${GENERATED_SOURCE_FILES}) set_target_properties(openttd PROPERTIES OUTPUT_NAME "${BINARY_NAME}") # All other files are added via target_sources() +if(MSVC) + # Add DPI manifest to project; other WIN32 targets get this via ottdres.rc + target_sources(openttd PRIVATE "${CMAKE_SOURCE_DIR}/os/windows/openttd.manifest") +endif() + add_subdirectory(${CMAKE_SOURCE_DIR}/src) add_subdirectory(${CMAKE_SOURCE_DIR}/media/baseset) diff --git a/cmake/CompileFlags.cmake b/cmake/CompileFlags.cmake index 772041a42c..f4047b8396 100644 --- a/cmake/CompileFlags.cmake +++ b/cmake/CompileFlags.cmake @@ -27,9 +27,6 @@ macro(compile_flags) # Enable multi-threaded compilation. add_compile_options(/MP) endif() - - # Add DPI manifest to project; other WIN32 targets get this via ottdres.rc - list(APPEND GENERATED_SOURCE_FILES "${CMAKE_SOURCE_DIR}/os/windows/openttd.manifest") endif() # Add some -D flags for Debug builds. We cannot use add_definitions(), because