From 5bf9fd8253ec804498c0f3339c4d706cab3673ea Mon Sep 17 00:00:00 2001 From: Patrick Gansterer Date: Fri, 30 Nov 2012 14:14:27 +0100 Subject: VS: Set the correct SubSystem when determinating the CompilerId Some WinCE linker only work when the subsystem is set to WINDOWSCE. --- Modules/CMakeDetermineCompilerId.cmake | 3 +++ Modules/CompilerId/VS-7.vcproj.in | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'Modules') diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 43469eaad9..40e4f5aaca 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -142,6 +142,9 @@ Id flags: ${testflags} endif() if(CMAKE_VS_WINCE_VERSION) set(id_definitions "ADD_MAINCRTSTARTUP") + set(id_subsystem 9) + else() + set(id_subsystem 1) endif() if("${CMAKE_MAKE_PROGRAM}" MATCHES "[Mm][Ss][Bb][Uu][Ii][Ll][Dd]") set(build /p:Configuration=Debug /p:Platform=@id_arch@ /p:VisualStudioVersion=${vs_version}.0) diff --git a/Modules/CompilerId/VS-7.vcproj.in b/Modules/CompilerId/VS-7.vcproj.in index b1449e4acd..5b68e86379 100644 --- a/Modules/CompilerId/VS-7.vcproj.in +++ b/Modules/CompilerId/VS-7.vcproj.in @@ -36,7 +36,7 @@ Name="VCLinkerTool" LinkIncremental="1" GenerateDebugInformation="false" - SubSystem="1" + SubSystem="@id_subsystem@" /> Date: Fri, 30 Nov 2012 15:15:06 +0100 Subject: VS: Add the entry point when compiling for WindowsCE Set the entry point to mainACRTStartup to make sure that main() can be found when linking the application to check the compiler. --- Modules/CMakeCCompilerId.c.in | 4 ---- Modules/CMakeCXXCompilerId.cpp.in | 4 ---- Modules/CMakeDetermineCompilerId.cmake | 2 +- Modules/CompilerId/VS-7.vcproj.in | 2 +- 4 files changed, 2 insertions(+), 10 deletions(-) (limited to 'Modules') diff --git a/Modules/CMakeCCompilerId.c.in b/Modules/CMakeCCompilerId.c.in index 3d1380c6db..2d76c7a348 100644 --- a/Modules/CMakeCCompilerId.c.in +++ b/Modules/CMakeCCompilerId.c.in @@ -228,7 +228,3 @@ int main(int argc, char* argv[]) return require; } #endif - -#ifdef ADD_MAINCRTSTARTUP -void mainCRTStartup() {} -#endif diff --git a/Modules/CMakeCXXCompilerId.cpp.in b/Modules/CMakeCXXCompilerId.cpp.in index 142a5c5ab5..5e70a4196d 100644 --- a/Modules/CMakeCXXCompilerId.cpp.in +++ b/Modules/CMakeCXXCompilerId.cpp.in @@ -210,7 +210,3 @@ int main(int argc, char* argv[]) (void)argv; return require; } - -#ifdef ADD_MAINCRTSTARTUP -extern "C" void mainCRTStartup() {} -#endif diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake index 40e4f5aaca..609f35bf70 100644 --- a/Modules/CMakeDetermineCompilerId.cmake +++ b/Modules/CMakeDetermineCompilerId.cmake @@ -141,7 +141,7 @@ Id flags: ${testflags} set(id_toolset "") endif() if(CMAKE_VS_WINCE_VERSION) - set(id_definitions "ADD_MAINCRTSTARTUP") + set(id_entrypoint "mainACRTStartup") set(id_subsystem 9) else() set(id_subsystem 1) diff --git a/Modules/CompilerId/VS-7.vcproj.in b/Modules/CompilerId/VS-7.vcproj.in index 5b68e86379..3e2b34a620 100644 --- a/Modules/CompilerId/VS-7.vcproj.in +++ b/Modules/CompilerId/VS-7.vcproj.in @@ -24,7 +24,6 @@ Date: Fri, 30 Nov 2012 15:17:50 +0100 Subject: VS: Ignore LIBC.lib when linking the CompilerId executables Some Windows CE linkers want to link against LIBC.lib, but can not find them. Since they are not required we can simply ignore it. --- Modules/CompilerId/VS-7.vcproj.in | 1 + 1 file changed, 1 insertion(+) (limited to 'Modules') diff --git a/Modules/CompilerId/VS-7.vcproj.in b/Modules/CompilerId/VS-7.vcproj.in index 3e2b34a620..fa48cadb3f 100644 --- a/Modules/CompilerId/VS-7.vcproj.in +++ b/Modules/CompilerId/VS-7.vcproj.in @@ -34,6 +34,7 @@