https://git.reactos.org/?p=reactos.git;a=commitdiff;h=5c25e816bfff056baad76…
commit 5c25e816bfff056baad76346cbd49835fc914ddd
Author: Jérôme Gardou <jerome.gardou(a)reactos.org>
AuthorDate: Thu Oct 22 15:12:49 2020 +0200
Commit: Jérôme Gardou <zefklop(a)users.noreply.github.com>
CommitDate: Thu Oct 22 18:07:27 2020 +0200
[CMAKE] Only link msvcrtex to win32cui, win32gui, win32dll, win32ocx and cpl modules
---
sdk/cmake/CMakeMacros.cmake | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sdk/cmake/CMakeMacros.cmake b/sdk/cmake/CMakeMacros.cmake
index 26337a0713e..f4d7cb1f1b1 100644
--- a/sdk/cmake/CMakeMacros.cmake
+++ b/sdk/cmake/CMakeMacros.cmake
@@ -533,7 +533,8 @@ function(add_importlibs _module)
foreach(LIB ${ARGN})
if("${LIB}" MATCHES "msvcrt")
target_compile_definitions(${_module} PRIVATE _DLL __USE_CRTIMP)
- target_link_libraries(${_module} msvcrtex)
+ # set_module_type might not have been called at this point, so use a
generator expression
+ target_link_libraries(${_module}
"$<$<IN_LIST:$<TARGET_PROPERTY:${_module},REACTOS_MODULE_TYPE>,win32gui;win32cui;win32dll;win32ocx;cpl>:msvcrtex>")
endif()
target_link_libraries(${_module} lib${LIB})
add_dependencies(${_module} lib${LIB})