From 54f2fe5ee5293df7c5cd30ede9d7d0ebd632c190 Mon Sep 17 00:00:00 2001 From: mcuee Date: Sat, 28 Oct 2023 12:47:42 +0800 Subject: [PATCH] To support MinGW cross compiler This is the same as avrdude-packing patch. https://github.com/arduino/avrdude-packing/blob/main/patches/0007-Cmake-fix-build-not-working-with-mingw-toolchain.patch --- src/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6be05e1a4..ce6131bee 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -50,7 +50,7 @@ endif() include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) add_compile_definitions(CONFIG_DIR=\"${CONFIG_DIR}\") -if(WIN32) +if(WIN32 OR MINGW) set(EXTRA_WINDOWS_RESOURCES "${PROJECT_BINARY_DIR}/src/windows.rc") set(EXTRA_WINDOWS_LIBRARIES setupapi hid ws2_32) endif() @@ -112,7 +112,7 @@ endif() configure_file(cmake_config.h.in ac_cfg.h) configure_file(avrdude.spec.in avrdude.spec) -if(WIN32) +if(WIN32 OR MINGW) configure_file(windows.rc.in windows.rc) endif()