From dbb5a7ee315948b4f16e5c6a549db090e266e51d Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 5 Aug 2014 14:44:12 -0400 Subject: CMakeDetermineCompilerId: Fix detection for VS ARM platform Add WindowsSDKDesktopARMSupport to the compiler id .vcxproj to avoid 'error MSB8022: Compiling Desktop applications for the ARM platform is not supported.' from VS. Inspired-by: Minmin Gong Inspired-by: Gilles Khouzam --- Modules/CMakeDetermineCompilerId.cmake | 5 +++++ Modules/CompilerId/VS-10.vcxproj.in | 1 + 2 files changed, 6 insertions(+) diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index a780fa6..1fca55d 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -180,6 +180,11 @@ Id flags: ${testflags} else() set(id_system_version "") endif() + if(id_platform STREQUAL ARM) + set(id_WindowsSDKDesktopARMSupport "true") + else() + set(id_WindowsSDKDesktopARMSupport "") + endif() if(CMAKE_VS_WINCE_VERSION) set(id_entrypoint "mainACRTStartup") if("${vs_version}" VERSION_LESS 9) diff --git a/Modules/CompilerId/VS-10.vcxproj.in b/Modules/CompilerId/VS-10.vcxproj.in index bacbca4..a17d03d 100644 --- a/Modules/CompilerId/VS-10.vcxproj.in +++ b/Modules/CompilerId/VS-10.vcxproj.in @@ -12,6 +12,7 @@ Win32Proj @id_system@ @id_system_version@ + @id_WindowsSDKDesktopARMSupport@ -- cgit v0.12 From 2dfcf0ed079119cb25f6520100083270873503f5 Mon Sep 17 00:00:00 2001 From: Gilles Khouzam Date: Tue, 5 Aug 2014 15:00:09 -0400 Subject: VS: Fix generation of desktop applications for ARM Add WindowsSDKDesktopARMSupport to the .vcxproj to avoid 'error MSB8022: Compiling Desktop applications for the ARM platform is not supported.' from VS. --- Source/cmVisualStudio10TargetGenerator.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 291827a..1e9e8e8 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -2133,4 +2133,9 @@ void cmVisualStudio10TargetGenerator::WriteApplicationTypeSettings() "\n", 2); } } + if (this->Platform == "ARM") + { + this->WriteString("true" + "", 2); + } } -- cgit v0.12 From 2b20110f681d180f12f4c200df1489eeb242d1b2 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 5 Aug 2014 15:02:49 -0400 Subject: MSVC: Select default standard libraries for ARM platform For Windows ARM targets, only kernel32.lib and user32.lib are standard. --- Modules/Platform/Windows-MSVC.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Modules/Platform/Windows-MSVC.cmake b/Modules/Platform/Windows-MSVC.cmake index 9d4aca2..0c2e21b 100644 --- a/Modules/Platform/Windows-MSVC.cmake +++ b/Modules/Platform/Windows-MSVC.cmake @@ -167,13 +167,17 @@ elseif(WINDOWS_PHONE OR WINDOWS_STORE) set(_FLAGS_CXX " /DUNICODE /D_UNICODE /GR /EHsc") if(WINDOWS_PHONE) set(CMAKE_C_STANDARD_LIBRARIES_INIT "WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib") + elseif(MSVC_C_ARCHITECTURE_ID STREQUAL ARM OR MSVC_CXX_ARCHITECTURE_ID STREQUAL ARM) + set(CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib") else() set(CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib") endif() else() set(_PLATFORM_DEFINES "/DWIN32") - if(MSVC_VERSION GREATER 1310) + if(MSVC_C_ARCHITECTURE_ID STREQUAL ARM OR MSVC_CXX_ARCHITECTURE_ID STREQUAL ARM) + set(CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib") + elseif(MSVC_VERSION GREATER 1310) set(_RTC1 "/RTC1") set(_FLAGS_CXX " /GR /EHsc") set(CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib") -- cgit v0.12