From 9d7070ab1abe1db5c151a54fb301f284fdf84483 Mon Sep 17 00:00:00 2001 From: Hoe Hao Cheng Date: Sun, 19 Feb 2023 03:21:39 +0800 Subject: [PATCH 1/2] fix MinGW compilation --- src/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1e7b71a..e4af020 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -274,6 +274,10 @@ compile_shader(realesrgan_postproc_tta.comp) add_custom_target(generate-spirv DEPENDS ${SHADER_SPV_HEX_FILES}) +if(MINGW) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -municode") +endif() + add_executable(realesrgan-ncnn-vulkan main.cpp realesrgan.cpp) add_dependencies(realesrgan-ncnn-vulkan generate-spirv) From d8d3a9dc7a7ce5f0fb6d9decf2ac5dbd8d3e2bac Mon Sep 17 00:00:00 2001 From: Hoe Hao Cheng Date: Sun, 19 Feb 2023 04:28:48 +0800 Subject: [PATCH 2/2] fix path string on MinGW --- src/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index ebe0e62..e939368 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -700,12 +700,12 @@ int main(int argc, char** argv) if (modelname == PATHSTR("realesr-animevideov3")) { - swprintf(parampath, 256, L"%s/%s-x%s.param", model.c_str(), modelname.c_str(), std::to_string(scale)); - swprintf(modelpath, 256, L"%s/%s-x%s.bin", model.c_str(), modelname.c_str(), std::to_string(scale)); + swprintf(parampath, 256, L"%ls/%ls-x%d.param", model.c_str(), modelname.c_str(), scale); + swprintf(modelpath, 256, L"%ls/%ls-x%d.bin", model.c_str(), modelname.c_str(), scale); } else{ - swprintf(parampath, 256, L"%s/%s.param", model.c_str(), modelname.c_str()); - swprintf(modelpath, 256, L"%s/%s.bin", model.c_str(), modelname.c_str()); + swprintf(parampath, 256, L"%ls/%ls.param", model.c_str(), modelname.c_str()); + swprintf(modelpath, 256, L"%ls/%ls.bin", model.c_str(), modelname.c_str()); } #else