From 16a7990037edc68a963f30011fac2e28be71b5a7 Mon Sep 17 00:00:00 2001 From: Wang Yang Date: Wed, 10 Jul 2024 01:32:13 +0800 Subject: [PATCH] enable '/mt' on windows --- CMakeLists.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1e7d9bf..c406cfd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -69,6 +69,17 @@ if (USE_LIBPNG_AND_ZLIB) file(RENAME ${EGE_ZLIB_SOURCE_DIR}/zconf.h.included ${EGE_ZLIB_SOURCE_DIR}/zconf.h) endif () + if (MSVC) + target_compile_options(png_static PUBLIC + /MP + "$<$:/MTd>" + "$<$:/MT>") + target_compile_options(zlibstatic PUBLIC + /MP + "$<$:/MTd>" + "$<$:/MT>") + endif() + target_include_directories(xege PRIVATE ${EGE_ZLIB_BINARY_DIR} PRIVATE ${EGE_ZLIB_SOURCE_DIR} @@ -77,6 +88,7 @@ if (USE_LIBPNG_AND_ZLIB) PRIVATE ${EGE_LIBPNG_BINARY_DIR} PRIVATE ${EGE_LIBPNG_SOURCE_DIR} ) + target_sources(xege PRIVATE $ PRIVATE $ @@ -111,6 +123,10 @@ endif () # 打印编译器信息 if (MSVC) message(STATUS "${TARGET_BITS}bit MSVC target: MSVC ${MSVC_VERSION}") + target_compile_options(xege PUBLIC + /MP + "$<$:/MTd>" + "$<$:/MT>") elseif (CMAKE_CXX_COMPILER_ID MATCHES "GNU") message(STATUS "${TARGET_BITS}bit GNU target: GCC ${CMAKE_C_COMPILER_VERSION}") else ()