]> granicus.if.org Git - graphviz/commitdiff
Made xdot a dynamic library on Windows
authorErwin Janssen <erwinjanssen@outlook.com>
Tue, 3 Jan 2017 18:20:58 +0000 (19:20 +0100)
committerErwin Janssen <erwinjanssen@outlook.com>
Wed, 4 Jan 2017 23:30:14 +0000 (00:30 +0100)
xdot is a dynamic library with the Autotools build, but was for some
reason a static library on Windows. Since Autotools is considered the
default, this commit makes xdot a dynamic library on Windows as well.
The added define "XDOT_API", is used for linking, so a seperate xdot.def
file is not needed. On non-Windows platforms, this define is set to
"extern", so nothing changes there.

lib/gvc.vcxproj
lib/xdot/xdot.h
lib/xdot/xdot.vcxproj

index 4f6ff891caec696d9f024118fa47508dc7f95d1c..2149fd9c7d388b41453665820fbe57f9d3a6de72 100644 (file)
@@ -63,7 +63,7 @@
       <DisableSpecificWarnings>4996</DisableSpecificWarnings>
     </ClCompile>
     <Link>
-      <AdditionalLibraryDirectories>$(SolutionDir)windows\dependencies\rxspencer\lib;$(SolutionDir)windows\dependencies\GTK2\lib;$(SolutionDir)windows\dependencies\libtool\lib;$(SolutionDir)windows\dependencies\expat\Bin;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalLibraryDirectories>$(SolutionDir)windows\dependencies\rxspencer\lib;$(SolutionDir)windows\dependencies\GTK2\lib;$(SolutionDir)windows\dependencies\libtool\lib;$(SolutionDir)windows\dependencies\expat\Bin;$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <SubSystem>Windows</SubSystem>
       <DataExecutionPrevention />
@@ -95,7 +95,7 @@ copy $(SolutionDir)windows\dependencies\GTK2\bin\zlib1.dll $(OutDir)zlib1.dll</C
       <DisableSpecificWarnings>4996</DisableSpecificWarnings>
     </ClCompile>
     <Link>
-      <AdditionalLibraryDirectories>$(SolutionDir)windows\dependencies\rxspencer\lib;$(SolutionDir)windows\dependencies\GTK2\lib;$(SolutionDir)windows\dependencies\libtool\lib;$(SolutionDir)windows\dependencies\expat\Bin;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+      <AdditionalLibraryDirectories>$(SolutionDir)windows\dependencies\rxspencer\lib;$(SolutionDir)windows\dependencies\GTK2\lib;$(SolutionDir)windows\dependencies\libtool\lib;$(SolutionDir)windows\dependencies\expat\Bin;$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
       <GenerateDebugInformation>No</GenerateDebugInformation>
       <SubSystem>Windows</SubSystem>
       <OptimizeReferences>true</OptimizeReferences>
index be843378a8a277fa03dc87ee1b17f8b2aa811499..b373caa951c2e9888cef0edb86fa69b91378efef 100755 (executable)
 extern "C" {
 #endif
 
+#ifdef _WIN32
+#   ifdef EXPORT_XDOT
+#       define XDOT_API __declspec(dllexport)
+#   else
+#       define XDOT_API __declspec(dllimport)
+#   endif
+#else
+#   define XDOT_API extern
+#endif
+
 #define INITIAL_XDOT_CAPACITY 512
 
 typedef enum {
@@ -162,17 +172,17 @@ typedef struct {
 } xdot_stats;
 
 /* ops are indexed by xop_kind */
-extern xdot* parseXDotF (char*, drawfunc_t opfns[], int sz);
-extern xdot* parseXDotFOn (char*, drawfunc_t opfns[], int sz, xdot*);
-extern xdot* parseXDot (char*);
-extern char* sprintXDot (xdot*);
-extern void fprintXDot (FILE*, xdot*);
-extern void jsonXDot (FILE*, xdot*);
-extern void freeXDot (xdot*);
-extern int statXDot (xdot*, xdot_stats*);
-extern xdot_grad_type colorTypeXDot (char*);
-extern char* parseXDotColor (char* cp, xdot_color* clr);
-extern void freeXDotColor (xdot_color*);
+XDOT_API xdot* parseXDotF (char*, drawfunc_t opfns[], int sz);
+XDOT_API xdot* parseXDotFOn (char*, drawfunc_t opfns[], int sz, xdot*);
+XDOT_API xdot* parseXDot (char*);
+XDOT_API char* sprintXDot (xdot*);
+XDOT_API void fprintXDot (FILE*, xdot*);
+XDOT_API void jsonXDot (FILE*, xdot*);
+XDOT_API void freeXDot (xdot*);
+XDOT_API int statXDot (xdot*, xdot_stats*);
+XDOT_API xdot_grad_type colorTypeXDot (char*);
+XDOT_API char* parseXDotColor (char* cp, xdot_color* clr);
+XDOT_API void freeXDotColor (xdot_color*);
 
 #ifdef __cplusplus
 }
index 67a649001757f6f14d3c4f53ef326226bdd922c0..bd266b62dc2e0b7a8614d2c63794302cbda8a62e 100644 (file)
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
     <PlatformToolset>v140</PlatformToolset>
   </PropertyGroup>
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
-    <ConfigurationType>StaticLibrary</ConfigurationType>
+    <ConfigurationType>DynamicLibrary</ConfigurationType>
     <PlatformToolset>v140</PlatformToolset>
   </PropertyGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
@@ -52,7 +52,7 @@
     <ClCompile>
       <Optimization>Disabled</Optimization>
       <AdditionalIncludeDirectories>$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;EXPORT_XDOT;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <MinimalRebuild>true</MinimalRebuild>
       <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
       <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
       <DisableSpecificWarnings>4996</DisableSpecificWarnings>
     </ClCompile>
     <Lib />
+    <Link>
+      <SubSystem>Console</SubSystem>
+      <DataExecutionPrevention />
+    </Link>
   </ItemDefinitionGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
     <ClCompile>
       <AdditionalIncludeDirectories>$(ProjectDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
-      <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>WIN32;EXPORT_XDOT;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <RuntimeLibrary>MultiThreaded</RuntimeLibrary>
       <PrecompiledHeader />
       <WarningLevel>Level4</WarningLevel>
       <DisableSpecificWarnings>4996</DisableSpecificWarnings>
     </ClCompile>
     <Lib />
+    <Link>
+      <GenerateDebugInformation>false</GenerateDebugInformation>
+      <SubSystem>Console</SubSystem>
+      <DataExecutionPrevention />
+    </Link>
   </ItemDefinitionGroup>
   <ItemGroup>
     <ClInclude Include="xdot.h" />