From 7e1283e48c54424b38444f78c983fc32a287ee80 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 10 Jul 2014 15:06:19 -0400 Subject: MSVC: Fix linking of DLLs on WinCE (#15013) On WinCE we must link both shared libraries and executables with the /subsystem:windowsce flag. Teach Platform/Windows-MSVC to pass it to the linker in both cases. Suggested-by: Gunnar Roth --- Modules/Platform/Windows-MSVC.cmake | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake index e29aaf4..cfef536 100644 --- a/Modules/Platform/Windows-MSVC.cmake +++ b/Modules/Platform/Windows-MSVC.cmake @@ -39,12 +39,14 @@ endif() set(WIN32 1) if(CMAKE_SYSTEM_NAME MATCHES "WindowsCE") - set(CMAKE_CREATE_WIN32_EXE "/subsystem:windowsce /entry:WinMainCRTStartup") - set(CMAKE_CREATE_CONSOLE_EXE "/subsystem:windowsce /entry:mainACRTStartup") + set(CMAKE_CREATE_WIN32_EXE "/entry:WinMainCRTStartup") + set(CMAKE_CREATE_CONSOLE_EXE "/entry:mainACRTStartup") + set(_PLATFORM_LINK_FLAGS " /subsystem:windowsce") set(WINCE 1) else() set(CMAKE_CREATE_WIN32_EXE "/subsystem:windows") set(CMAKE_CREATE_CONSOLE_EXE "/subsystem:console") + set(_PLATFORM_LINK_FLAGS "") endif() if(CMAKE_GENERATOR MATCHES "Visual Studio 6") @@ -235,7 +237,7 @@ macro(__windows_compiler_msvc lang) set(_CMAKE_VS_LINK_EXE " -E vs_link_exe ") endif() set(CMAKE_${lang}_CREATE_SHARED_LIBRARY - "${_CMAKE_VS_LINK_DLL} ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /out: /implib: /pdb: /dll /version:. ${CMAKE_END_TEMP_FILE}") + "${_CMAKE_VS_LINK_DLL} ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /out: /implib: /pdb: /dll /version:.${_PLATFORM_LINK_FLAGS} ${CMAKE_END_TEMP_FILE}") set(CMAKE_${lang}_CREATE_SHARED_MODULE ${CMAKE_${lang}_CREATE_SHARED_LIBRARY}) set(CMAKE_${lang}_CREATE_STATIC_LIBRARY " /lib ${CMAKE_CL_NOLOGO} /out: ") @@ -249,7 +251,7 @@ macro(__windows_compiler_msvc lang) set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 1) set(CMAKE_${lang}_LINK_EXECUTABLE - "${_CMAKE_VS_LINK_EXE} ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /out: /implib: /pdb: /version:. ${CMAKE_END_TEMP_FILE}") + "${_CMAKE_VS_LINK_EXE} ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /out: /implib: /pdb: /version:.${_PLATFORM_LINK_FLAGS} ${CMAKE_END_TEMP_FILE}") set(CMAKE_${lang}_FLAGS_INIT "${_PLATFORM_DEFINES}${_PLATFORM_DEFINES_${lang}} /D_WINDOWS /W3${_FLAGS_${lang}}") set(CMAKE_${lang}_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od ${_RTC1}") -- cgit v0.12