Visual Studio Builds: Don't Generate a .def File

Clutter, like GTK+ and GLib, has recently switched to a visibility-based
method of exporting symbols, so update the Visual Studio build files to
do likewise, by using __declspec (dllexport). This eliminats the need to
use a .def file to export the symbols.  The pre-configured
config.h.win32.in is also updated accordingly for this purpose.  The
clutter.symbols file can be dropped if it is not being used otherwise.
This commit is contained in:
Chun-wei Fan 2014-03-20 08:57:06 +08:00
parent 8c9b5d0568
commit 783bc64a02
6 changed files with 7 additions and 139 deletions

View File

@ -43,16 +43,6 @@ $(GlibEtcInstallRoot)\bin\glib-genmarshal --prefix=_clutter_marshal --body ..\..
<GenEnumsSrcC>perl $(GlibEtcInstallRoot)\bin\glib-mkenums --template ..\..\..\clutter\clutter-enum-types.c.in $(EnumHeaders) &gt; ..\..\..\clutter\clutter-enum-types.c</GenEnumsSrcC>
<GenEnumsSrcGDKH>perl $(GlibEtcInstallRoot)\bin\glib-mkenums --template ..\..\..\clutter\clutter-enum-types.h.in $(EnumHeaders) $(GdkEnumHeader) &gt; ..\..\..\clutter\clutter-enum-types.h</GenEnumsSrcGDKH>
<GenEnumsSrcGDKC>perl $(GlibEtcInstallRoot)\bin\glib-mkenums --template ..\..\..\clutter\clutter-enum-types.c.in $(EnumHeaders) $(GdkEnumHeader) &gt; ..\..\..\clutter\clutter-enum-types.c</GenEnumsSrcGDKC>
<GenerateClutterDef>
echo EXPORTS &gt; $(DefDir)\clutter.def
cl -EP -DHAVE_CAIRO -DCLUTTER_WINDOWING_WIN32 -DCLUTTER_ENABLE_EXPERIMENTAL_API ..\..\..\clutter\clutter.symbols &gt;&gt; $(DefDir)\clutter.def
</GenerateClutterDef>
<GenerateClutterGDKDef>
echo EXPORTS &gt; $(DefDir)\clutter.def
cl -EP -DHAVE_CAIRO -DCLUTTER_WINDOWING_WIN32 -DCLUTTER_WINDOWING_GDK -DCLUTTER_ENABLE_EXPERIMENTAL_API ..\..\..\clutter\clutter.symbols &gt;&gt; $(DefDir)\clutter.def
</GenerateClutterGDKDef>
</PropertyGroup>
<PropertyGroup>
<_PropertySheetDisplayName>cluttergensrcsprops</_PropertySheetDisplayName>
@ -88,11 +78,5 @@ cl -EP -DHAVE_CAIRO -DCLUTTER_WINDOWING_WIN32 -DCLUTTER_WINDOWING_GDK -DCLUTTER_
<BuildMacro Include="GenEnumsSrcGDKC">
<Value>$(GenEnumsSrcGDKC)</Value>
</BuildMacro>
<BuildMacro Include="GenerateClutterDef">
<Value>$(GenerateClutterDef)</Value>
</BuildMacro>
<BuildMacro Include="GenerateClutterGDKDef">
<Value>$(GenerateClutterGDKDef)</Value>
</BuildMacro>
</ItemGroup>
</Project>

View File

@ -30,7 +30,6 @@
<CustomBuild Include="..\..\..\clutter\clutter-marshal.list"><Filter>Resource Files</Filter></CustomBuild>
<CustomBuild Include="..\..\..\clutter\clutter-enum-types.h.in"><Filter>Resource Files</Filter></CustomBuild>
<CustomBuild Include="..\..\..\clutter\clutter-enum-types.c.in"><Filter>Resource Files</Filter></CustomBuild>
<CustomBuild Include="..\..\..\clutter\clutter.symbols"><Filter>Resource Files</Filter></CustomBuild>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\..\clutter\win32\resources.rc">

View File

@ -151,7 +151,6 @@
<Link>
<AdditionalDependencies>opengl32.lib;winmm.lib;intl.lib;json-glib-1.0.lib;pangocairo-1.0.lib;pango-1.0.lib;cairo-gobject.lib;cairo.lib;atk-1.0.lib;gmodule-2.0.lib;gio-2.0.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ClutterDllPrefix)$(ProjectName)$(ClutterDllSuffix).dll</OutputFile>
<ModuleDefinitionFile>$(IntDir)\$(ProjectName).def</ModuleDefinitionFile>
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
@ -177,7 +176,6 @@
<Link>
<AdditionalDependencies>opengl32.lib;winmm.lib;intl.lib;json-glib-1.0.lib;gdk-3.0.lib;pangocairo-1.0.lib;pango-1.0.lib;cairo-gobject.lib;cairo.lib;atk-1.0.lib;gmodule-2.0.lib;gio-2.0.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ClutterDllPrefix)$(ProjectName)$(ClutterDllSuffix).dll</OutputFile>
<ModuleDefinitionFile>$(IntDir)\$(ProjectName).def</ModuleDefinitionFile>
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
@ -203,7 +201,6 @@
<Link>
<AdditionalDependencies>opengl32.lib;winmm.lib;intl.lib;json-glib-1.0.lib;pangocairo-1.0.lib;pango-1.0.lib;cairo-gobject.lib;cairo.lib;atk-1.0.lib;gmodule-2.0.lib;gio-2.0.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ClutterDllPrefix)$(ProjectName)$(ClutterDllSuffix).dll</OutputFile>
<ModuleDefinitionFile>$(IntDir)\$(ProjectName).def</ModuleDefinitionFile>
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
@ -229,7 +226,6 @@
<Link>
<AdditionalDependencies>opengl32.lib;winmm.lib;intl.lib;json-glib-1.0.lib;gdk-3.0.lib;pangocairo-1.0.lib;pango-1.0.lib;cairo-gobject.lib;cairo.lib;atk-1.0.lib;gmodule-2.0.lib;gio-2.0.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ClutterDllPrefix)$(ProjectName)$(ClutterDllSuffix).dll</OutputFile>
<ModuleDefinitionFile>$(IntDir)\$(ProjectName).def</ModuleDefinitionFile>
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
@ -255,7 +251,6 @@
<Link>
<AdditionalDependencies>opengl32.lib;winmm.lib;intl.lib;json-glib-1.0.lib;pangocairo-1.0.lib;pango-1.0.lib;cairo-gobject.lib;cairo.lib;atk-1.0.lib;gmodule-2.0.lib;gio-2.0.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ClutterDllPrefix)$(ProjectName)$(ClutterDllSuffix).dll</OutputFile>
<ModuleDefinitionFile>$(IntDir)\$(ProjectName).def</ModuleDefinitionFile>
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
@ -283,7 +278,6 @@
<Link>
<AdditionalDependencies>opengl32.lib;winmm.lib;intl.lib;json-glib-1.0.lib;gdk-3.0.lib;pangocairo-1.0.lib;pango-1.0.lib;cairo-gobject.lib;cairo.lib;atk-1.0.lib;gmodule-2.0.lib;gio-2.0.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ClutterDllPrefix)$(ProjectName)$(ClutterDllSuffix).dll</OutputFile>
<ModuleDefinitionFile>$(IntDir)\$(ProjectName).def</ModuleDefinitionFile>
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
@ -308,7 +302,6 @@
<Link>
<AdditionalDependencies>opengl32.lib;winmm.lib;intl.lib;json-glib-1.0.lib;pangocairo-1.0.lib;pango-1.0.lib;cairo-gobject.lib;cairo.lib;atk-1.0.lib;gmodule-2.0.lib;gio-2.0.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ClutterDllPrefix)$(ProjectName)$(ClutterDllSuffix).dll</OutputFile>
<ModuleDefinitionFile>$(IntDir)\$(ProjectName).def</ModuleDefinitionFile>
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
@ -333,7 +326,6 @@
<Link>
<AdditionalDependencies>opengl32.lib;winmm.lib;intl.lib;json-glib-1.0.lib;gdk-3.0.lib;pangocairo-1.0.lib;pango-1.0.lib;cairo-gobject.lib;cairo.lib;atk-1.0.lib;gmodule-2.0.lib;gio-2.0.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(ClutterDllPrefix)$(ProjectName)$(ClutterDllSuffix).dll</OutputFile>
<ModuleDefinitionFile>$(IntDir)\$(ProjectName).def</ModuleDefinitionFile>
<ImportLibrary>$(TargetDir)$(ProjectName)-$(ApiVersion).lib</ImportLibrary>
<GenerateDebugInformation>true</GenerateDebugInformation>
<SubSystem>Windows</SubSystem>
@ -514,32 +506,6 @@
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(GenEnumsSrcC)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\..\clutter\clutter-enum-types.c;%(Outputs)</Outputs>
</CustomBuild>
<CustomBuild Include="..\..\..\clutter\clutter.symbols">
<Message Condition="'$(Configuration)|$(Platform)'=='Debug_GDK|Win32'">Generating clutter.def...</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug_GDK|Win32'">$(GenerateClutterGDKDef)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug_GDK|Win32'">$(IntDir)clutter.def;%(Outputs)</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Generating clutter.def...</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(GenerateClutterDef)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(IntDir)clutter.def;%(Outputs)</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug_GDK|x64'">Generating clutter.def...</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug_GDK|x64'">$(GenerateClutterGDKDef)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug_GDK|x64'">$(IntDir)clutter.def;%(Outputs)</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Generating clutter.def...</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(GenerateClutterDef)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)clutter.def;%(Outputs)</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Release_GDK|Win32'">Generating clutter.def...</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Release_GDK|Win32'">$(GenerateClutterGDKDef)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release_GDK|Win32'">$(IntDir)clutter.def;%(Outputs)</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Generating clutter.def...</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(GenerateClutterDef)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(IntDir)clutter.def;%(Outputs)</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Release_GDK|x64'">Generating clutter.def...</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Release_GDK|x64'">$(GenerateClutterGDKDef)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release_GDK|x64'">$(IntDir)clutter.def;%(Outputs)</Outputs>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Generating clutter.def...</Message>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(GenerateClutterDef)</Command>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)clutter.def;%(Outputs)</Outputs>
</CustomBuild>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\..\clutter\win32\resources.rc" />

View File

@ -64,18 +64,4 @@ $(GlibEtcInstallRoot)\bin\glib-genmarshal --prefix=_clutter_marshal --body ..\..
Name="GenEnumsSrcGDKC"
Value="perl $(GlibEtcInstallRoot)\bin\glib-mkenums --template ..\..\..\clutter\clutter-enum-types.c.in $(EnumHeaders) $(GdkEnumHeader) &gt; ..\..\..\clutter\clutter-enum-types.c"
/>
<UserMacro
Name="GenerateClutterDef"
Value="
echo EXPORTS &gt; $(DefDir)\clutter.def&#x0D;&#x0A;
cl -EP -DHAVE_CAIRO -DCLUTTER_WINDOWING_WIN32 -DCLUTTER_ENABLE_EXPERIMENTAL_API ..\..\..\clutter\clutter.symbols &gt;&gt; $(DefDir)\clutter.def&#x0D;&#x0A;
"
/>
<UserMacro
Name="GenerateClutterGDKDef"
Value="
echo EXPORTS &gt; $(DefDir)\clutter.def&#x0D;&#x0A;
cl -EP -DHAVE_CAIRO -DCLUTTER_WINDOWING_WIN32 -DCLUTTER_WINDOWING_GDK -DCLUTTER_ENABLE_EXPERIMENTAL_API ..\..\..\clutter\clutter.symbols &gt;&gt; $(DefDir)\clutter.def&#x0D;&#x0A;
"
/>
</VisualStudioPropertySheet>

View File

@ -46,7 +46,6 @@
AdditionalDependencies="opengl32.lib winmm.lib intl.lib json-glib-1.0.lib pangocairo-1.0.lib pango-1.0.lib cairo-gobject.lib cairo.lib atk-1.0.lib gmodule-2.0.lib gio-2.0.lib"
OutputFile="$(OutDir)\$(ClutterDllPrefix)$(ProjectName)$(ClutterDllSuffix).dll"
LinkIncremental="2"
ModuleDefinitionFile="$(IntDir)\$(ProjectName).def"
ImportLibrary="$(TargetDir)$(ProjectName)-$(ApiVersion).lib"
GenerateDebugInformation="true"
SubSystem="2"
@ -81,7 +80,6 @@
AdditionalDependencies="opengl32.lib winmm.lib intl.lib json-glib-1.0.lib gdk-3.0.lib pangocairo-1.0.lib pango-1.0.lib cairo-gobject.lib cairo.lib atk-1.0.lib gmodule-2.0.lib gio-2.0.lib"
OutputFile="$(OutDir)\$(ClutterDllPrefix)$(ProjectName)$(ClutterDllSuffix).dll"
LinkIncremental="2"
ModuleDefinitionFile="$(IntDir)\$(ProjectName).def"
ImportLibrary="$(TargetDir)$(ProjectName)-$(ApiVersion).lib"
GenerateDebugInformation="true"
SubSystem="2"
@ -115,7 +113,6 @@
AdditionalDependencies="opengl32.lib winmm.lib intl.lib json-glib-1.0.lib pangocairo-1.0.lib pango-1.0.lib cairo-gobject.lib cairo.lib atk-1.0.lib gmodule-2.0.lib gio-2.0.lib"
OutputFile="$(OutDir)\$(ClutterDllPrefix)$(ProjectName)$(ClutterDllSuffix).dll"
LinkIncremental="2"
ModuleDefinitionFile="$(IntDir)\$(ProjectName).def"
ImportLibrary="$(TargetDir)$(ProjectName)-$(ApiVersion).lib"
GenerateDebugInformation="true"
SubSystem="2"
@ -150,7 +147,6 @@
AdditionalDependencies="opengl32.lib winmm.lib intl.lib json-glib-1.0.lib gdk-3.0.lib pangocairo-1.0.lib pango-1.0.lib cairo-gobject.lib cairo.lib atk-1.0.lib gmodule-2.0.lib gio-2.0.lib"
OutputFile="$(OutDir)\$(ClutterDllPrefix)$(ProjectName)$(ClutterDllSuffix).dll"
LinkIncremental="2"
ModuleDefinitionFile="$(IntDir)\$(ProjectName).def"
ImportLibrary="$(TargetDir)$(ProjectName)-$(ApiVersion).lib"
GenerateDebugInformation="true"
SubSystem="2"
@ -185,7 +181,6 @@
AdditionalDependencies="opengl32.lib winmm.lib intl.lib json-glib-1.0.lib pangocairo-1.0.lib pango-1.0.lib cairo-gobject.lib cairo.lib atk-1.0.lib gmodule-2.0.lib gio-2.0.lib"
OutputFile="$(OutDir)\$(ClutterDllPrefix)$(ProjectName)$(ClutterDllSuffix).dll"
LinkIncremental="1"
ModuleDefinitionFile="$(IntDir)\$(ProjectName).def"
ImportLibrary="$(TargetDir)$(ProjectName)-$(ApiVersion).lib"
GenerateDebugInformation="true"
SubSystem="2"
@ -223,7 +218,6 @@
AdditionalDependencies="opengl32.lib winmm.lib intl.lib json-glib-1.0.lib gdk-3.0.lib pangocairo-1.0.lib pango-1.0.lib cairo-gobject.lib cairo.lib atk-1.0.lib gmodule-2.0.lib gio-2.0.lib"
OutputFile="$(OutDir)\$(ClutterDllPrefix)$(ProjectName)$(ClutterDllSuffix).dll"
LinkIncremental="1"
ModuleDefinitionFile="$(IntDir)\$(ProjectName).def"
ImportLibrary="$(TargetDir)$(ProjectName)-$(ApiVersion).lib"
GenerateDebugInformation="true"
SubSystem="2"
@ -256,7 +250,6 @@
AdditionalDependencies="opengl32.lib winmm.lib intl.lib json-glib-1.0.lib pangocairo-1.0.lib pango-1.0.lib cairo-gobject.lib cairo.lib atk-1.0.lib gmodule-2.0.lib gio-2.0.lib"
OutputFile="$(OutDir)\$(ClutterDllPrefix)$(ProjectName)$(ClutterDllSuffix).dll"
LinkIncremental="2"
ModuleDefinitionFile="$(IntDir)\$(ProjectName).def"
ImportLibrary="$(TargetDir)$(ProjectName)-$(ApiVersion).lib"
GenerateDebugInformation="true"
SubSystem="2"
@ -290,7 +283,6 @@
AdditionalDependencies="opengl32.lib winmm.lib intl.lib json-glib-1.0.lib gdk-3.0.lib pangocairo-1.0.lib pango-1.0.lib cairo-gobject.lib cairo.lib atk-1.0.lib gmodule-2.0.lib gio-2.0.lib"
OutputFile="$(OutDir)\$(ClutterDllPrefix)$(ProjectName)$(ClutterDllSuffix).dll"
LinkIncremental="2"
ModuleDefinitionFile="$(IntDir)\$(ProjectName).def"
ImportLibrary="$(TargetDir)$(ProjectName)-$(ApiVersion).lib"
GenerateDebugInformation="true"
SubSystem="2"
@ -686,72 +678,6 @@
/>
</FileConfiguration>
</File>
<File RelativePath="..\..\..\clutter\clutter.symbols">
<FileConfiguration Name="Debug|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating clutter.def..."
CommandLine="$(GenerateClutterDef)"
Outputs="$(IntDir)\clutter.def"
/>
</FileConfiguration>
<FileConfiguration Name="Debug_GDK|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating clutter.def..."
CommandLine="$(GenerateClutterGDKDef)"
Outputs="$(IntDir)\clutter.def"
/>
</FileConfiguration>
<FileConfiguration Name="Release|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating clutter.def..."
CommandLine="$(GenerateClutterDef)"
Outputs="$(IntDir)\clutter.def"
/>
</FileConfiguration>
<FileConfiguration Name="Release_GDK|Win32">
<Tool
Name="VCCustomBuildTool"
Description="Generating clutter.def..."
CommandLine="$(GenerateClutterGDKDef)"
Outputs="$(IntDir)\clutter.def"
/>
</FileConfiguration>
<FileConfiguration Name="Debug|x64">
<Tool
Name="VCCustomBuildTool"
Description="Generating clutter.def..."
CommandLine="$(GenerateClutterDef)"
Outputs="$(IntDir)\clutter.def"
/>
</FileConfiguration>
<FileConfiguration Name="Debug_GDK|x64">
<Tool
Name="VCCustomBuildTool"
Description="Generating clutter.def..."
CommandLine="$(GenerateClutterGDKDef)"
Outputs="$(IntDir)\clutter.def"
/>
</FileConfiguration>
<FileConfiguration Name="Release|x64">
<Tool
Name="VCCustomBuildTool"
Description="Generating clutter.def..."
CommandLine="$(GenerateClutterDef)"
Outputs="$(IntDir)\clutter.def"
/>
</FileConfiguration>
<FileConfiguration Name="Release_GDK|x64">
<Tool
Name="VCCustomBuildTool"
Description="Generating clutter.def..."
CommandLine="$(GenerateClutterGDKDef)"
Outputs="$(IntDir)\clutter.def"
/>
</FileConfiguration>
</File>
<File RelativePath="..\..\..\clutter\win32\resources.rc" />
</Filter>
</Files>

View File

@ -147,3 +147,10 @@
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* defines how to decorate public symbols while building */
#ifdef _MSC_VER
#define _CLUTTER_EXTERN __declspec(dllexport) extern
#else
#define _CLUTTER_EXTERN __attribute__((visibility("default"))) __declspec(dllexport) extern
#endif