From 20e619f8a68b29421463a76c87b767bdf4fd0414 Mon Sep 17 00:00:00 2001 From: Chun-wei Fan Date: Thu, 17 Apr 2014 10:52:19 +0800 Subject: [PATCH] Visual Studio Builds: Avoid Implicit Linking to SDL Cogl, when built with the SDL winsys, will include the SDL headers when Cogl-based programs are built, which causes the SDL's wrapper for main() to be used on Windows, causing an implicit requirement that all Cogl-based apps must link to SDL2.lib and SDL2main.lib. Avoid this behavior by defining SDL_MAIN_HANDLED in the CFLAGS of the sample and interactive test programs --- build/win32/vs10/clutter-build-defines.props | 8 ++++++-- build/win32/vs10/test-cogl-perf.vcxproj | 8 ++++---- build/win32/vs10/test-picking.vcxproj | 8 ++++---- build/win32/vs10/test-random-text.vcxproj | 8 ++++---- build/win32/vs10/test-text-perf.vcxproj | 8 ++++---- build/win32/vs10/test-text.vcxproj | 8 ++++---- build/win32/vs9/clutter-build-defines.vsprops | 8 ++++++-- build/win32/vs9/test-cogl-perf.vcproj | 8 ++++---- build/win32/vs9/test-picking.vcproj | 8 ++++---- build/win32/vs9/test-random-text.vcproj | 8 ++++---- build/win32/vs9/test-text-perf.vcproj | 8 ++++---- build/win32/vs9/test-text.vcproj | 8 ++++---- 12 files changed, 52 insertions(+), 44 deletions(-) diff --git a/build/win32/vs10/clutter-build-defines.props b/build/win32/vs10/clutter-build-defines.props index 6b93aa5ce..8fb7ae6ed 100644 --- a/build/win32/vs10/clutter-build-defines.props +++ b/build/win32/vs10/clutter-build-defines.props @@ -10,8 +10,9 @@ $(LibBuildDefines);G_DISABLE_ASSERT;G_DISABLE_CHECKS;G_DISABLE_CAST_CHECKS $(BaseWinBuildDef);G_LOG_DOMAIN="Clutter";CLUTTER_LOCALEDIR="../share/locale";CLUTTER_SYSCONFDIR="../etc";COGL_DISABLE_DEPRECATION_WARNINGS CLUTTER_DISABLE_DEPRECATION_WARNINGS;GLIB_DISABLE_DEPRECATION_WARNINGS - $(BaseWinBuildDef);PREFIXDIR="/some/dummy/dir";$(ClutterDisableDeprecationWarnings) - $(BaseWinBuildDef);TESTS_DATADIR="../share/clutter-$(ApiVersion)/data";TESTS_DATA_DIR="../share/clutter-$(ApiVersion)/data" + SDL_MAIN_HANDLED + $(BaseWinBuildDef);PREFIXDIR="/some/dummy/dir";$(ClutterDisableDeprecationWarnings);$(AvoidSDLMain) + $(BaseWinBuildDef);TESTS_DATADIR="../share/clutter-$(ApiVersion)/data";TESTS_DATA_DIR="../share/clutter-$(ApiVersion)/data";$(AvoidSDLMain) $(TestProgDef);$(ClutterDisableDeprecationWarnings) @@ -50,6 +51,9 @@ $(ClutterDisableDeprecationWarnings) + + $(AvoidSDLMain) + $(CallyTestDefs) diff --git a/build/win32/vs10/test-cogl-perf.vcxproj b/build/win32/vs10/test-cogl-perf.vcxproj index 4d37ce637..0017cf88a 100644 --- a/build/win32/vs10/test-cogl-perf.vcxproj +++ b/build/win32/vs10/test-cogl-perf.vcxproj @@ -75,7 +75,7 @@ Disabled - _DEBUG;$(BaseWinBuildDef);$(ClutterDisableDeprecationWarnings);%(PreprocessorDefinitions) + _DEBUG;$(BaseWinBuildDef);$(ClutterDisableDeprecationWarnings);$(AvoidSDLMain)%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL @@ -93,7 +93,7 @@ Disabled - _DEBUG;$(BaseWinBuildDef);$(ClutterDisableDeprecationWarnings);%(PreprocessorDefinitions) + _DEBUG;$(BaseWinBuildDef);$(ClutterDisableDeprecationWarnings);$(AvoidSDLMain)%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL @@ -117,7 +117,7 @@ MaxSpeed true - $(BaseWinBuildDef);$(ClutterDisableDeprecationWarnings);%(PreprocessorDefinitions) + $(BaseWinBuildDef);$(ClutterDisableDeprecationWarnings);$(AvoidSDLMain)%(PreprocessorDefinitions) MultiThreadedDLL true @@ -135,7 +135,7 @@ - $(BaseWinBuildDef);$(ClutterDisableDeprecationWarnings);%(PreprocessorDefinitions) + $(BaseWinBuildDef);$(ClutterDisableDeprecationWarnings);$(AvoidSDLMain)%(PreprocessorDefinitions) MultiThreadedDLL diff --git a/build/win32/vs10/test-picking.vcxproj b/build/win32/vs10/test-picking.vcxproj index d8a23c991..f33e9f50b 100644 --- a/build/win32/vs10/test-picking.vcxproj +++ b/build/win32/vs10/test-picking.vcxproj @@ -75,7 +75,7 @@ Disabled - _DEBUG;$(BaseWinBuildDef);$(ClutterDisableDeprecationWarnings);%(PreprocessorDefinitions) + _DEBUG;$(BaseWinBuildDef);$(ClutterDisableDeprecationWarnings);$(AvoidSDLMain)%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL @@ -94,7 +94,7 @@ Disabled - _DEBUG;$(BaseWinBuildDef);$(ClutterDisableDeprecationWarnings);%(PreprocessorDefinitions) + _DEBUG;$(BaseWinBuildDef);$(ClutterDisableDeprecationWarnings);$(AvoidSDLMain)%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL @@ -118,7 +118,7 @@ MaxSpeed true - $(BaseWinBuildDef);$(ClutterDisableDeprecationWarnings);%(PreprocessorDefinitions) + $(BaseWinBuildDef);$(ClutterDisableDeprecationWarnings);$(AvoidSDLMain)%(PreprocessorDefinitions) MultiThreadedDLL true @@ -136,7 +136,7 @@ - $(BaseWinBuildDef);$(ClutterDisableDeprecationWarnings);%(PreprocessorDefinitions) + $(BaseWinBuildDef);$(ClutterDisableDeprecationWarnings);$(AvoidSDLMain)%(PreprocessorDefinitions) MultiThreadedDLL diff --git a/build/win32/vs10/test-random-text.vcxproj b/build/win32/vs10/test-random-text.vcxproj index 98c4c6e06..50d58256f 100644 --- a/build/win32/vs10/test-random-text.vcxproj +++ b/build/win32/vs10/test-random-text.vcxproj @@ -75,7 +75,7 @@ Disabled - _DEBUG;$(BaseWinBuildDef);$(ClutterDisableDeprecationWarnings);%(PreprocessorDefinitions) + _DEBUG;$(BaseWinBuildDef);$(ClutterDisableDeprecationWarnings);$(AvoidSDLMain)%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL @@ -93,7 +93,7 @@ Disabled - _DEBUG;$(BaseWinBuildDef);$(ClutterDisableDeprecationWarnings);%(PreprocessorDefinitions) + _DEBUG;$(BaseWinBuildDef);$(ClutterDisableDeprecationWarnings);$(AvoidSDLMain)%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL @@ -117,7 +117,7 @@ MaxSpeed true - $(BaseWinBuildDef);$(ClutterDisableDeprecationWarnings);%(PreprocessorDefinitions) + $(BaseWinBuildDef);$(ClutterDisableDeprecationWarnings);$(AvoidSDLMain)%(PreprocessorDefinitions) MultiThreadedDLL true @@ -135,7 +135,7 @@ - $(BaseWinBuildDef);$(ClutterDisableDeprecationWarnings);%(PreprocessorDefinitions) + $(BaseWinBuildDef);$(ClutterDisableDeprecationWarnings);$(AvoidSDLMain)%(PreprocessorDefinitions) MultiThreadedDLL diff --git a/build/win32/vs10/test-text-perf.vcxproj b/build/win32/vs10/test-text-perf.vcxproj index de12d15dc..24160a747 100644 --- a/build/win32/vs10/test-text-perf.vcxproj +++ b/build/win32/vs10/test-text-perf.vcxproj @@ -75,7 +75,7 @@ Disabled - _DEBUG;$(BaseWinBuildDef);$(ClutterDisableDeprecationWarnings);%(PreprocessorDefinitions) + _DEBUG;$(BaseWinBuildDef);$(ClutterDisableDeprecationWarnings);$(AvoidSDLMain)%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL @@ -93,7 +93,7 @@ Disabled - _DEBUG;$(BaseWinBuildDef);$(ClutterDisableDeprecationWarnings);%(PreprocessorDefinitions) + _DEBUG;$(BaseWinBuildDef);$(ClutterDisableDeprecationWarnings);$(AvoidSDLMain)%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL @@ -117,7 +117,7 @@ MaxSpeed true - $(BaseWinBuildDef);$(ClutterDisableDeprecationWarnings);%(PreprocessorDefinitions) + $(BaseWinBuildDef);$(ClutterDisableDeprecationWarnings);$(AvoidSDLMain)%(PreprocessorDefinitions) MultiThreadedDLL true @@ -135,7 +135,7 @@ - $(BaseWinBuildDef);$(ClutterDisableDeprecationWarnings);%(PreprocessorDefinitions) + $(BaseWinBuildDef);$(ClutterDisableDeprecationWarnings);$(AvoidSDLMain)%(PreprocessorDefinitions) MultiThreadedDLL diff --git a/build/win32/vs10/test-text.vcxproj b/build/win32/vs10/test-text.vcxproj index 1583c55bf..3fad71277 100644 --- a/build/win32/vs10/test-text.vcxproj +++ b/build/win32/vs10/test-text.vcxproj @@ -75,7 +75,7 @@ Disabled - _DEBUG;$(BaseWinBuildDef);$(ClutterDisableDeprecationWarnings);%(PreprocessorDefinitions) + _DEBUG;$(BaseWinBuildDef);$(ClutterDisableDeprecationWarnings);$(AvoidSDLMain)%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL @@ -93,7 +93,7 @@ Disabled - _DEBUG;$(BaseWinBuildDef);$(ClutterDisableDeprecationWarnings);%(PreprocessorDefinitions) + _DEBUG;$(BaseWinBuildDef);$(ClutterDisableDeprecationWarnings);$(AvoidSDLMain)%(PreprocessorDefinitions) true EnableFastChecks MultiThreadedDebugDLL @@ -117,7 +117,7 @@ MaxSpeed true - $(BaseWinBuildDef);$(ClutterDisableDeprecationWarnings);%(PreprocessorDefinitions) + $(BaseWinBuildDef);$(ClutterDisableDeprecationWarnings);$(AvoidSDLMain)%(PreprocessorDefinitions) MultiThreadedDLL true @@ -135,7 +135,7 @@ - $(BaseWinBuildDef);$(ClutterDisableDeprecationWarnings);%(PreprocessorDefinitions) + $(BaseWinBuildDef);$(ClutterDisableDeprecationWarnings);$(AvoidSDLMain)%(PreprocessorDefinitions) MultiThreadedDLL diff --git a/build/win32/vs9/clutter-build-defines.vsprops b/build/win32/vs9/clutter-build-defines.vsprops index 3da652cbb..829161bc8 100644 --- a/build/win32/vs9/clutter-build-defines.vsprops +++ b/build/win32/vs9/clutter-build-defines.vsprops @@ -30,13 +30,17 @@ Name="ClutterDisableDeprecationWarnings" Value="CLUTTER_DISABLE_DEPRECATION_WARNINGS;GLIB_DISABLE_DEPRECATION_WARNINGS" /> +