[cogl/cogl-1.18] Visual Studio Builds: Avoid Implicit Link to SDL



commit 2e0989bbaf38f250f6847f667bafa23233e1f3b8
Author: Chun-wei Fan <fanchunwei src gnome org>
Date:   Thu Apr 17 10:33:55 2014 +0800

    Visual Studio Builds: Avoid Implicit Link to SDL
    
    Cogl, when built with the SDL winsys, includes the SDL headers in its
    headers, which causes main() to be defined to SDL's main() wrapper on
    Windows, which means that SDL2.lib and SDL2main.lib need to be linked to
    every single program that links to Cogl with the SDL winsys.
    
    Avoid this behavior by defining SDL_MAIN_HANDLED in the CFLAGS of the
    sample and test programs, and let people know that this is the case.

 build/win32/vs10/README.txt                      |    5 ++---
 build/win32/vs10/cogl-build-defines.props        |    4 ++++
 build/win32/vs10/cogl-crate.vcxproj              |    8 ++++----
 build/win32/vs10/cogl-hello.vcxproj              |    8 ++++----
 build/win32/vs10/cogl-info.vcxproj               |    8 ++++----
 build/win32/vs10/cogl-msaa.vcxproj               |    8 ++++----
 build/win32/vs10/test-conformance-cogl.vcxprojin |    8 ++++----
 build/win32/vs9/README.txt                       |    5 ++---
 build/win32/vs9/cogl-build-defines.vsprops       |    4 ++++
 build/win32/vs9/cogl-crate.vcproj                |    8 ++++----
 build/win32/vs9/cogl-hello.vcproj                |    8 ++++----
 build/win32/vs9/cogl-info.vcproj                 |    8 ++++----
 build/win32/vs9/cogl-msaa.vcproj                 |    8 ++++----
 build/win32/vs9/test-conformance-cogl.vcprojin   |    8 ++++----
 14 files changed, 52 insertions(+), 46 deletions(-)
---
diff --git a/build/win32/vs10/README.txt b/build/win32/vs10/README.txt
index 9f0a598..13303df 100644
--- a/build/win32/vs10/README.txt
+++ b/build/win32/vs10/README.txt
@@ -38,9 +38,8 @@ to support the build of the SDL2 winsys in place of the original SDL-1.3 winsys
 as SDL-2.x has been released for some time.  Please note, as builds with the SDL2
 winsys includes the SDL2 headers, main() will be defined to SDL2's special main()
 implementation on Windows, which will require linking to SDL2.lib and SDL2main.lib
-for all apps that link to Cogl, which means that the SDL2 DLL needs to be shipped with
-your application as well, even though SDL2 functionality is not used directly in the
-application.
+for all apps that link to Cogl, unless SDL_MAIN_HANDLED is defined in your
+"preprocessor definitions" options.
 
 The recommended build sequence of the dependencies are as follows (the non-GNOME
 packages that are not downloaded as binaries from ftp://ftp.gnome.org have
diff --git a/build/win32/vs10/cogl-build-defines.props b/build/win32/vs10/cogl-build-defines.props
index 27b2e4c..eefe1a6 100644
--- a/build/win32/vs10/cogl-build-defines.props
+++ b/build/win32/vs10/cogl-build-defines.props
@@ -11,6 +11,7 @@
     
<CoglBuildDefines>G_LOG_DOMAIN="Cogl";COGL_HAS_WIN32_SUPPORT;COGL_BUILD_EXP;COGL_GL_LIBNAME="";COGL_LOCALEDIR="/some/random/dir"</CoglBuildDefines>
     <CoglPathBuildDefines>G_LOG_DOMAIN="CoglPath"</CoglPathBuildDefines>
     <CoglPangoBuildDefines>G_LOG_DOMAIN="Cogl-Pango"</CoglPangoBuildDefines>
+    <CoglAppAvoidForcedSDLLinkingDefines>SDL_MAIN_HANDLED</CoglAppAvoidForcedSDLLinkingDefines>
   </PropertyGroup>
   <PropertyGroup>
     <_PropertySheetDisplayName>coglbuilddefinesprops</_PropertySheetDisplayName>
@@ -51,5 +52,8 @@
     <BuildMacro Include="CoglPangoBuildDefines">
       <Value>$(CoglPangoBuildDefines)</Value>
     </BuildMacro>
+    <BuildMacro Include="CoglAppAvoidForcedSDLLinkingDefines">
+      <Value>$(CoglAppAvoidForcedSDLLinkingDefines)</Value>
+    </BuildMacro>
   </ItemGroup>
 </Project>
diff --git a/build/win32/vs10/cogl-crate.vcxproj b/build/win32/vs10/cogl-crate.vcxproj
index a64e669..d99a487 100644
--- a/build/win32/vs10/cogl-crate.vcxproj
+++ b/build/win32/vs10/cogl-crate.vcxproj
@@ -75,7 +75,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      
<PreprocessorDefinitions>_DEBUG;COGL_ENABLE_EXPERIMENTAL_2_0_API;COGL_EXAMPLES_DATA="../share/cogl-$(ApiVersion)/examples-data/";$(BaseBuildDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      
<PreprocessorDefinitions>_DEBUG;COGL_ENABLE_EXPERIMENTAL_2_0_API;COGL_EXAMPLES_DATA="../share/cogl-$(ApiVersion)/examples-data/";$(BaseBuildDefines);$(CoglAppAvoidForcedSDLLinkingDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -94,7 +94,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      
<PreprocessorDefinitions>_DEBUG;COGL_ENABLE_EXPERIMENTAL_2_0_API;COGL_EXAMPLES_DATA="../share/cogl-$(ApiVersion)/examples-data/";$(BaseBuildDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      
<PreprocessorDefinitions>_DEBUG;COGL_ENABLE_EXPERIMENTAL_2_0_API;COGL_EXAMPLES_DATA="../share/cogl-$(ApiVersion)/examples-data/";$(BaseBuildDefines);$(CoglAppAvoidForcedSDLLinkingDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -118,7 +118,7 @@
     <ClCompile>
       <Optimization>MaxSpeed</Optimization>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      
<PreprocessorDefinitions>COGL_ENABLE_EXPERIMENTAL_2_0_API;COGL_EXAMPLES_DATA="../share/cogl-$(ApiVersion)/examples-data/";$(BaseBuildDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      
<PreprocessorDefinitions>COGL_ENABLE_EXPERIMENTAL_2_0_API;COGL_EXAMPLES_DATA="../share/cogl-$(ApiVersion)/examples-data/";$(BaseBuildDefines);$(CoglAppAvoidForcedSDLLinkingDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <PrecompiledHeader>
@@ -137,7 +137,7 @@
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <ClCompile>
-      
<PreprocessorDefinitions>COGL_ENABLE_EXPERIMENTAL_2_0_API;COGL_EXAMPLES_DATA="../share/cogl-$(ApiVersion)/examples-data/";$(BaseBuildDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      
<PreprocessorDefinitions>COGL_ENABLE_EXPERIMENTAL_2_0_API;COGL_EXAMPLES_DATA="../share/cogl-$(ApiVersion)/examples-data/";$(BaseBuildDefines);$(CoglAppAvoidForcedSDLLinkingDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <PrecompiledHeader>
       </PrecompiledHeader>
diff --git a/build/win32/vs10/cogl-hello.vcxproj b/build/win32/vs10/cogl-hello.vcxproj
index 4b6c732..a754c0d 100644
--- a/build/win32/vs10/cogl-hello.vcxproj
+++ b/build/win32/vs10/cogl-hello.vcxproj
@@ -75,7 +75,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      
<PreprocessorDefinitions>_DEBUG;COGL_ENABLE_EXPERIMENTAL_2_0_API;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      
<PreprocessorDefinitions>_DEBUG;COGL_ENABLE_EXPERIMENTAL_2_0_API;$(BaseBuildDefines);$(CoglAppAvoidForcedSDLLinkingDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -93,7 +93,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      
<PreprocessorDefinitions>_DEBUG;COGL_ENABLE_EXPERIMENTAL_2_0_API;$(BaseBuildDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      
<PreprocessorDefinitions>_DEBUG;COGL_ENABLE_EXPERIMENTAL_2_0_API;$(BaseBuildDefines);$(CoglAppAvoidForcedSDLLinkingDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <PrecompiledHeader>
@@ -110,7 +110,7 @@
     <ClCompile>
       <Optimization>MaxSpeed</Optimization>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      
<PreprocessorDefinitions>COGL_ENABLE_EXPERIMENTAL_2_0_API;$(BaseBuildDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      
<PreprocessorDefinitions>COGL_ENABLE_EXPERIMENTAL_2_0_API;$(BaseBuildDefines);$(CoglAppAvoidForcedSDLLinkingDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <PrecompiledHeader>
@@ -130,7 +130,7 @@
     <ClCompile>
       <Optimization>MaxSpeed</Optimization>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      
<PreprocessorDefinitions>COGL_ENABLE_EXPERIMENTAL_2_0_API;$(BaseBuildDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      
<PreprocessorDefinitions>COGL_ENABLE_EXPERIMENTAL_2_0_API;$(BaseBuildDefines);$(CoglAppAvoidForcedSDLLinkingDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <PrecompiledHeader>
diff --git a/build/win32/vs10/cogl-info.vcxproj b/build/win32/vs10/cogl-info.vcxproj
index 17b3ba8..45f75ff 100644
--- a/build/win32/vs10/cogl-info.vcxproj
+++ b/build/win32/vs10/cogl-info.vcxproj
@@ -75,7 +75,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      
<PreprocessorDefinitions>_DEBUG;COGL_ENABLE_EXPERIMENTAL_2_0_API;$(BaseBuildDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      
<PreprocessorDefinitions>_DEBUG;COGL_ENABLE_EXPERIMENTAL_2_0_API;$(BaseBuildDefines);$(CoglAppAvoidForcedSDLLinkingDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -93,7 +93,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      
<PreprocessorDefinitions>_DEBUG;COGL_ENABLE_EXPERIMENTAL_2_0_API;$(BaseBuildDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      
<PreprocessorDefinitions>_DEBUG;COGL_ENABLE_EXPERIMENTAL_2_0_API;$(BaseBuildDefines);$(CoglAppAvoidForcedSDLLinkingDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -116,7 +116,7 @@
     <ClCompile>
       <Optimization>MaxSpeed</Optimization>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      
<PreprocessorDefinitions>COGL_ENABLE_EXPERIMENTAL_2_0_API;$(BaseBuildDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      
<PreprocessorDefinitions>COGL_ENABLE_EXPERIMENTAL_2_0_API;$(BaseBuildDefines);$(CoglAppAvoidForcedSDLLinkingDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <PrecompiledHeader>
@@ -134,7 +134,7 @@
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <ClCompile>
-      
<PreprocessorDefinitions>COGL_ENABLE_EXPERIMENTAL_2_0_API;$(BaseBuildDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      
<PreprocessorDefinitions>COGL_ENABLE_EXPERIMENTAL_2_0_API;$(BaseBuildDefines);$(CoglAppAvoidForcedSDLLinkingDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <PrecompiledHeader>
       </PrecompiledHeader>
diff --git a/build/win32/vs10/cogl-msaa.vcxproj b/build/win32/vs10/cogl-msaa.vcxproj
index 4518872..28de260 100644
--- a/build/win32/vs10/cogl-msaa.vcxproj
+++ b/build/win32/vs10/cogl-msaa.vcxproj
@@ -75,7 +75,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      
<PreprocessorDefinitions>_DEBUG;COGL_ENABLE_EXPERIMENTAL_2_0_API;$(BaseBuildDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      
<PreprocessorDefinitions>_DEBUG;COGL_ENABLE_EXPERIMENTAL_2_0_API;$(BaseBuildDefines);$(CoglAppAvoidForcedSDLLinkingDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -93,7 +93,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
     <ClCompile>
       <Optimization>Disabled</Optimization>
-      
<PreprocessorDefinitions>_DEBUG;COGL_ENABLE_EXPERIMENTAL_2_0_API;$(BaseBuildDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      
<PreprocessorDefinitions>_DEBUG;COGL_ENABLE_EXPERIMENTAL_2_0_API;$(BaseBuildDefines);$(CoglAppAvoidForcedSDLLinkingDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -116,7 +116,7 @@
     <ClCompile>
       <Optimization>MaxSpeed</Optimization>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      
<PreprocessorDefinitions>COGL_ENABLE_EXPERIMENTAL_2_0_API;$(BaseBuildDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      
<PreprocessorDefinitions>COGL_ENABLE_EXPERIMENTAL_2_0_API;$(BaseBuildDefines);$(CoglAppAvoidForcedSDLLinkingDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <PrecompiledHeader>
@@ -134,7 +134,7 @@
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <ClCompile>
-      
<PreprocessorDefinitions>COGL_ENABLE_EXPERIMENTAL_2_0_API;$(BaseBuildDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      
<PreprocessorDefinitions>COGL_ENABLE_EXPERIMENTAL_2_0_API;$(BaseBuildDefines);$(CoglAppAvoidForcedSDLLinkingDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <PrecompiledHeader>
       </PrecompiledHeader>
diff --git a/build/win32/vs10/test-conformance-cogl.vcxprojin 
b/build/win32/vs10/test-conformance-cogl.vcxprojin
index 753a188..a4aded6 100644
--- a/build/win32/vs10/test-conformance-cogl.vcxprojin
+++ b/build/win32/vs10/test-conformance-cogl.vcxprojin
@@ -76,7 +76,7 @@
     <ClCompile>
       <Optimization>Disabled</Optimization>
       
<AdditionalIncludeDirectories>..\..\..\test-fixtures;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      
<PreprocessorDefinitions>_DEBUG;COGL_ENABLE_EXPERIMENTAL_API;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      
<PreprocessorDefinitions>_DEBUG;COGL_ENABLE_EXPERIMENTAL_API;$(CoglAppAvoidForcedSDLLinkingDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -96,7 +96,7 @@
     <ClCompile>
       <Optimization>Disabled</Optimization>
       
<AdditionalIncludeDirectories>..\..\..\test-fixtures;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      
<PreprocessorDefinitions>_DEBUG;COGL_ENABLE_EXPERIMENTAL_API;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      
<PreprocessorDefinitions>_DEBUG;COGL_ENABLE_EXPERIMENTAL_API;$(CoglAppAvoidForcedSDLLinkingDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@@ -121,7 +121,7 @@
       <Optimization>MaxSpeed</Optimization>
       
<AdditionalIncludeDirectories>..\..\..\test-fixtures;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
       <IntrinsicFunctions>true</IntrinsicFunctions>
-      
<PreprocessorDefinitions>COGL_ENABLE_EXPERIMENTAL_API;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      
<PreprocessorDefinitions>COGL_ENABLE_EXPERIMENTAL_API;$(CoglAppAvoidForcedSDLLinkingDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <FunctionLevelLinking>true</FunctionLevelLinking>
       <PrecompiledHeader>
@@ -141,7 +141,7 @@
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
     <ClCompile>
       
<AdditionalIncludeDirectories>..\..\..\test-fixtures;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      
<PreprocessorDefinitions>COGL_ENABLE_EXPERIMENTAL_API;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      
<PreprocessorDefinitions>COGL_ENABLE_EXPERIMENTAL_API;$(CoglAppAvoidForcedSDLLinkingDefines);%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
       <PrecompiledHeader>
       </PrecompiledHeader>
diff --git a/build/win32/vs9/README.txt b/build/win32/vs9/README.txt
index 3ccf893..f277f97 100644
--- a/build/win32/vs9/README.txt
+++ b/build/win32/vs9/README.txt
@@ -39,9 +39,8 @@ to support the build of the SDL2 winsys in place of the original SDL-1.3 winsys
 as SDL-2.x has been released for some time.  Please note, as builds with the SDL2
 winsys includes the SDL2 headers, main() will be defined to SDL2's special main()
 implementation on Windows, which will require linking to SDL2.lib and SDL2main.lib
-for all apps that link to Cogl, which means that the SDL2 DLL needs to be shipped with
-your application as well, even though SDL2 functionality is not used directly in the
-application.
+for all apps that link to Cogl, unless SDL_MAIN_HANDLED is defined in your
+"preprocessor definitions" options.
 
 Please see the README file in the root directory of this Cogl source package
 for the versions of the dependencies required.  See also
diff --git a/build/win32/vs9/cogl-build-defines.vsprops b/build/win32/vs9/cogl-build-defines.vsprops
index fc68d47..5fc6282 100644
--- a/build/win32/vs9/cogl-build-defines.vsprops
+++ b/build/win32/vs9/cogl-build-defines.vsprops
@@ -46,4 +46,8 @@
                Name="CoglPangoBuildDefines"
                Value="G_LOG_DOMAIN=\&quot;Cogl-Pango\&quot;"
        />
+       <UserMacro
+               Name="CoglAppAvoidForcedSDLLinkingDefines"
+               Value="SDL_MAIN_HANDLED"
+       />
 </VisualStudioPropertySheet>
diff --git a/build/win32/vs9/cogl-crate.vcproj b/build/win32/vs9/cogl-crate.vcproj
index 0fa2382..359289c 100644
--- a/build/win32/vs9/cogl-crate.vcproj
+++ b/build/win32/vs9/cogl-crate.vcproj
@@ -31,7 +31,7 @@
                        <Tool
                                Name="VCCLCompilerTool"
                                Optimization="0"
-                               
PreprocessorDefinitions="_DEBUG;COGL_ENABLE_EXPERIMENTAL_2_0_API;COGL_EXAMPLES_DATA=\&quot;../share/cogl-$(ApiVersion)/examples-data/\&quot;;$(BaseBuildDefines)"
+                               
PreprocessorDefinitions="_DEBUG;COGL_ENABLE_EXPERIMENTAL_2_0_API;COGL_EXAMPLES_DATA=\&quot;../share/cogl-$(ApiVersion)/examples-data/\&quot;;$(CoglAppAvoidForcedSDLLinkingDefines);$(BaseBuildDefines)"
                                MinimalRebuild="true"
                                BasicRuntimeChecks="3"
                                RuntimeLibrary="3"
@@ -60,7 +60,7 @@
                        <Tool
                                Name="VCCLCompilerTool"
                                Optimization="0"
-                               
PreprocessorDefinitions="_DEBUG;COGL_ENABLE_EXPERIMENTAL_2_0_API;COGL_EXAMPLES_DATA=\&quot;../share/cogl-$(ApiVersion)/examples-data/\&quot;;$(BaseBuildDefines)"
+                               
PreprocessorDefinitions="_DEBUG;COGL_ENABLE_EXPERIMENTAL_2_0_API;COGL_EXAMPLES_DATA=\&quot;../share/cogl-$(ApiVersion)/examples-data/\&quot;;$(CoglAppAvoidForcedSDLLinkingDefines);$(BaseBuildDefines)"
                                MinimalRebuild="true"
                                BasicRuntimeChecks="3"
                                RuntimeLibrary="3"
@@ -94,7 +94,7 @@
                                Name="VCCLCompilerTool"
                                Optimization="2"
                                EnableIntrinsicFunctions="true"
-                               
PreprocessorDefinitions="COGL_ENABLE_EXPERIMENTAL_2_0_API;COGL_EXAMPLES_DATA=\&quot;../share/cogl-$(ApiVersion)/examples-data/\&quot;;$(BaseBuildDefines)"
+                               
PreprocessorDefinitions="COGL_ENABLE_EXPERIMENTAL_2_0_API;COGL_EXAMPLES_DATA=\&quot;../share/cogl-$(ApiVersion)/examples-data/\&quot;;$(CoglAppAvoidForcedSDLLinkingDefines);$(BaseBuildDefines)"
                                RuntimeLibrary="2"
                                EnableFunctionLevelLinking="true"
                                UsePrecompiledHeader="0"
@@ -124,7 +124,7 @@
                        />
                        <Tool
                                Name="VCCLCompilerTool"
-                               
PreprocessorDefinitions="COGL_ENABLE_EXPERIMENTAL_2_0_API;COGL_EXAMPLES_DATA=\&quot;../share/cogl-$(ApiVersion)/examples-data/\&quot;;$(BaseBuildDefines)"
+                               
PreprocessorDefinitions="COGL_ENABLE_EXPERIMENTAL_2_0_API;COGL_EXAMPLES_DATA=\&quot;../share/cogl-$(ApiVersion)/examples-data/\&quot;;$(CoglAppAvoidForcedSDLLinkingDefines);$(BaseBuildDefines)"
                                RuntimeLibrary="2"
                                UsePrecompiledHeader="0"
                                WarningLevel="3"
diff --git a/build/win32/vs9/cogl-hello.vcproj b/build/win32/vs9/cogl-hello.vcproj
index cb3b039..cd850a5 100644
--- a/build/win32/vs9/cogl-hello.vcproj
+++ b/build/win32/vs9/cogl-hello.vcproj
@@ -31,7 +31,7 @@
                        <Tool
                                Name="VCCLCompilerTool"
                                Optimization="0"
-                               
PreprocessorDefinitions="_DEBUG;COGL_ENABLE_EXPERIMENTAL_2_0_API;$(BaseBuildDefines)"
+                               
PreprocessorDefinitions="_DEBUG;COGL_ENABLE_EXPERIMENTAL_2_0_API;$(CoglAppAvoidForcedSDLLinkingDefines);$(BaseBuildDefines)"
                                MinimalRebuild="true"
                                BasicRuntimeChecks="3"
                                RuntimeLibrary="3"
@@ -59,7 +59,7 @@
                        <Tool
                                Name="VCCLCompilerTool"
                                Optimization="0"
-                               
PreprocessorDefinitions="_DEBUG;COGL_ENABLE_EXPERIMENTAL_2_0_API;$(BaseBuildDefines)"
+                               
PreprocessorDefinitions="_DEBUG;COGL_ENABLE_EXPERIMENTAL_2_0_API;$(CoglAppAvoidForcedSDLLinkingDefines);$(BaseBuildDefines)"
                                MinimalRebuild="true"
                                BasicRuntimeChecks="3"
                                RuntimeLibrary="3"
@@ -92,7 +92,7 @@
                                Name="VCCLCompilerTool"
                                Optimization="2"
                                EnableIntrinsicFunctions="true"
-                               PreprocessorDefinitions="COGL_ENABLE_EXPERIMENTAL_2_0_API;$(BaseBuildDefines)"
+                               
PreprocessorDefinitions="COGL_ENABLE_EXPERIMENTAL_2_0_API;$(CoglAppAvoidForcedSDLLinkingDefines);$(BaseBuildDefines)"
                                RuntimeLibrary="2"
                                EnableFunctionLevelLinking="true"
                                UsePrecompiledHeader="0"
@@ -121,7 +121,7 @@
                        />
                        <Tool
                                Name="VCCLCompilerTool"
-                               PreprocessorDefinitions="COGL_ENABLE_EXPERIMENTAL_2_0_API;$(BaseBuildDefines)"
+                               
PreprocessorDefinitions="COGL_ENABLE_EXPERIMENTAL_2_0_API;$(CoglAppAvoidForcedSDLLinkingDefines);$(BaseBuildDefines)"
                                RuntimeLibrary="2"
                                UsePrecompiledHeader="0"
                                WarningLevel="3"
diff --git a/build/win32/vs9/cogl-info.vcproj b/build/win32/vs9/cogl-info.vcproj
index 680abc9..3c69e31 100644
--- a/build/win32/vs9/cogl-info.vcproj
+++ b/build/win32/vs9/cogl-info.vcproj
@@ -31,7 +31,7 @@
                        <Tool
                                Name="VCCLCompilerTool"
                                Optimization="0"
-                               
PreprocessorDefinitions="_DEBUG;COGL_ENABLE_EXPERIMENTAL_2_0_API;$(BaseBuildDefines)"
+                               
PreprocessorDefinitions="_DEBUG;COGL_ENABLE_EXPERIMENTAL_2_0_API;$(CoglAppAvoidForcedSDLLinkingDefines);$(BaseBuildDefines)"
                                MinimalRebuild="true"
                                BasicRuntimeChecks="3"
                                RuntimeLibrary="3"
@@ -59,7 +59,7 @@
                        <Tool
                                Name="VCCLCompilerTool"
                                Optimization="0"
-                               
PreprocessorDefinitions="_DEBUG;COGL_ENABLE_EXPERIMENTAL_2_0_API;$(BaseBuildDefines)"
+                               
PreprocessorDefinitions="_DEBUG;COGL_ENABLE_EXPERIMENTAL_2_0_API;$(CoglAppAvoidForcedSDLLinkingDefines);$(BaseBuildDefines)"
                                MinimalRebuild="true"
                                BasicRuntimeChecks="3"
                                RuntimeLibrary="3"
@@ -92,7 +92,7 @@
                                Name="VCCLCompilerTool"
                                Optimization="2"
                                EnableIntrinsicFunctions="true"
-                               PreprocessorDefinitions="COGL_ENABLE_EXPERIMENTAL_2_0_API;$(BaseBuildDefines)"
+                               
PreprocessorDefinitions="COGL_ENABLE_EXPERIMENTAL_2_0_API;$(CoglAppAvoidForcedSDLLinkingDefines);$(BaseBuildDefines)"
                                RuntimeLibrary="2"
                                EnableFunctionLevelLinking="true"
                                UsePrecompiledHeader="0"
@@ -121,7 +121,7 @@
                        />
                        <Tool
                                Name="VCCLCompilerTool"
-                               PreprocessorDefinitions="COGL_ENABLE_EXPERIMENTAL_2_0_API;$(BaseBuildDefines)"
+                               
PreprocessorDefinitions="COGL_ENABLE_EXPERIMENTAL_2_0_API;$(CoglAppAvoidForcedSDLLinkingDefines);$(BaseBuildDefines)"
                                RuntimeLibrary="2"
                                UsePrecompiledHeader="0"
                                WarningLevel="3"
diff --git a/build/win32/vs9/cogl-msaa.vcproj b/build/win32/vs9/cogl-msaa.vcproj
index ee65a83..d3fd6f1 100644
--- a/build/win32/vs9/cogl-msaa.vcproj
+++ b/build/win32/vs9/cogl-msaa.vcproj
@@ -31,7 +31,7 @@
                        <Tool
                                Name="VCCLCompilerTool"
                                Optimization="0"
-                               
PreprocessorDefinitions="_DEBUG;COGL_ENABLE_EXPERIMENTAL_2_0_API;$(BaseBuildDefines)"
+                               
PreprocessorDefinitions="_DEBUG;COGL_ENABLE_EXPERIMENTAL_2_0_API;$(CoglAppAvoidForcedSDLLinkingDefines);$(BaseBuildDefines)"
                                MinimalRebuild="true"
                                BasicRuntimeChecks="3"
                                RuntimeLibrary="3"
@@ -59,7 +59,7 @@
                        <Tool
                                Name="VCCLCompilerTool"
                                Optimization="0"
-                               
PreprocessorDefinitions="_DEBUG;COGL_ENABLE_EXPERIMENTAL_2_0_API;$(BaseBuildDefines)"
+                               
PreprocessorDefinitions="_DEBUG;COGL_ENABLE_EXPERIMENTAL_2_0_API;$(CoglAppAvoidForcedSDLLinkingDefines);$(BaseBuildDefines)"
                                MinimalRebuild="true"
                                BasicRuntimeChecks="3"
                                RuntimeLibrary="3"
@@ -92,7 +92,7 @@
                                Name="VCCLCompilerTool"
                                Optimization="2"
                                EnableIntrinsicFunctions="true"
-                               PreprocessorDefinitions="COGL_ENABLE_EXPERIMENTAL_2_0_API;$(BaseBuildDefines)"
+                               
PreprocessorDefinitions="COGL_ENABLE_EXPERIMENTAL_2_0_API;$(CoglAppAvoidForcedSDLLinkingDefines);$(BaseBuildDefines)"
                                RuntimeLibrary="2"
                                EnableFunctionLevelLinking="true"
                                UsePrecompiledHeader="0"
@@ -121,7 +121,7 @@
                        />
                        <Tool
                                Name="VCCLCompilerTool"
-                               PreprocessorDefinitions="COGL_ENABLE_EXPERIMENTAL_2_0_API;$(BaseBuildDefines)"
+                               
PreprocessorDefinitions="COGL_ENABLE_EXPERIMENTAL_2_0_API;$(CoglAppAvoidForcedSDLLinkingDefines);$(BaseBuildDefines)"
                                RuntimeLibrary="2"
                                UsePrecompiledHeader="0"
                                WarningLevel="3"
diff --git a/build/win32/vs9/test-conformance-cogl.vcprojin b/build/win32/vs9/test-conformance-cogl.vcprojin
index 98e7259..c664217 100644
--- a/build/win32/vs9/test-conformance-cogl.vcprojin
+++ b/build/win32/vs9/test-conformance-cogl.vcprojin
@@ -32,7 +32,7 @@
                                Name="VCCLCompilerTool"
                                AdditionalIncludeDirectories="..\..\..\test-fixtures"
                                Optimization="0"
-                               PreprocessorDefinitions="_DEBUG;COGL_ENABLE_EXPERIMENTAL_API"
+                               
PreprocessorDefinitions="_DEBUG;COGL_ENABLE_EXPERIMENTAL_API;$(CoglAppAvoidForcedSDLLinkingDefines)"
                                MinimalRebuild="true"
                                BasicRuntimeChecks="3"
                                RuntimeLibrary="3"
@@ -62,7 +62,7 @@
                                Name="VCCLCompilerTool"
                                AdditionalIncludeDirectories="..\..\..\test-fixtures"
                                Optimization="0"
-                               PreprocessorDefinitions="_DEBUG;COGL_ENABLE_EXPERIMENTAL_API"
+                               
PreprocessorDefinitions="_DEBUG;COGL_ENABLE_EXPERIMENTAL_API;$(CoglAppAvoidForcedSDLLinkingDefines)"
                                MinimalRebuild="true"
                                BasicRuntimeChecks="3"
                                RuntimeLibrary="3"
@@ -97,7 +97,7 @@
                                AdditionalIncludeDirectories="..\..\..\test-fixtures"
                                Optimization="2"
                                EnableIntrinsicFunctions="true"
-                               PreprocessorDefinitions="COGL_ENABLE_EXPERIMENTAL_API"
+                               
PreprocessorDefinitions="COGL_ENABLE_EXPERIMENTAL_API;$(CoglAppAvoidForcedSDLLinkingDefines)"
                                RuntimeLibrary="2"
                                EnableFunctionLevelLinking="true"
                                UsePrecompiledHeader="0"
@@ -128,7 +128,7 @@
                        <Tool
                                Name="VCCLCompilerTool"
                                AdditionalIncludeDirectories="..\..\..\test-fixtures"
-                               PreprocessorDefinitions="COGL_ENABLE_EXPERIMENTAL_API"
+                               
PreprocessorDefinitions="COGL_ENABLE_EXPERIMENTAL_API;$(CoglAppAvoidForcedSDLLinkingDefines)"
                                RuntimeLibrary="2"
                                UsePrecompiledHeader="0"
                                WarningLevel="3"


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]