]> granicus.if.org Git - nethack/commitdiff
Build curses if PDCurses is available.
authorBart House <bart@barthouse.com>
Sun, 18 Nov 2018 07:56:31 +0000 (23:56 -0800)
committerBart House <bart@barthouse.com>
Sun, 18 Nov 2018 07:56:31 +0000 (23:56 -0800)
There are two ways to enable curses in the build.  Either set the
environment variable PDCURSES to a folder containing a PDCurses repository
OR place the PDCurses folder alongside the NetHack source repository.

win/win32/vs2017/NetHack.vcxproj
win/win32/vs2017/dirs.props

index 981bc1e45f0a2c961ea20b412177327dca555e31..e51474a6531234680cbbd2f78ac04b79df3319d8 100644 (file)
   <PropertyGroup>\r
     <OutDir>$(BinDir)</OutDir>\r
   </PropertyGroup>\r
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
-    <IncludePath>$(PDCURSES);$(IncludePath)</IncludePath>\r
-  </PropertyGroup>\r
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
-    <IncludePath>$(PDCURSES);$(IncludePath)</IncludePath>\r
-  </PropertyGroup>\r
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">\r
-    <IncludePath>$(PDCURSES);$(IncludePath)</IncludePath>\r
-  </PropertyGroup>\r
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">\r
-    <IncludePath>$(PDCURSES);$(IncludePath)</IncludePath>\r
-  </PropertyGroup>\r
+  <ItemDefinitionGroup Condition="Exists('$(PDCURSES)')">\r
+    <ClCompile>\r
+      <AdditionalIncludeDirectories>$(PDCURSES);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
+         <PreprocessorDefinitions>CURSES_GRAPHICS;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+    </ClCompile>\r
+       <Link>\r
+      <AdditionalLibraryDirectories>$(PDCURSES)\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>\r
+      <AdditionalDependencies>PDCurses.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
+         </Link>\r
+  </ItemDefinitionGroup>\r
   <ItemDefinitionGroup>\r
     <ClCompile>\r
       <AdditionalOptions>/Gs /Oi- %(AdditionalOptions)</AdditionalOptions>\r
       <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>\r
       <OmitFramePointers>true</OmitFramePointers>\r
       <AdditionalIncludeDirectories>$(WinWin32Dir);$(IncDir);$(SysWinntDir);$(SysShareDir);$(WinShareDir);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>\r
-      <PreprocessorDefinitions>TILES;WIN32CON;DLB;MSWIN_GRAPHICS;CURSES_GRAPHICS;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
+      <PreprocessorDefinitions>TILES;WIN32CON;DLB;MSWIN_GRAPHICS;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
     </ClCompile>\r
     <Link>\r
-      <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;winmm.lib;Winmm.lib;PDCurses.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
-      <AdditionalLibraryDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(PDCURSES)\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>\r
-      <AdditionalLibraryDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(PDCURSES)\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>\r
-      <AdditionalLibraryDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(PDCURSES)\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>\r
-      <AdditionalLibraryDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(PDCURSES)\bin\$(Platform)\$(Configuration)\</AdditionalLibraryDirectories>\r
+      <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;winmm.lib;Winmm.lib;%(AdditionalDependencies)</AdditionalDependencies>\r
     </Link>\r
   </ItemDefinitionGroup>\r
   <ItemGroup>\r
     <ClCompile Include="$(WinTtyDir)getline.c" />\r
     <ClCompile Include="$(WinTtyDir)topl.c" />\r
     <ClCompile Include="$(WinTtyDir)wintty.c" />\r
-    <ClCompile Include="$(WinCursDir)cursdial.c" />\r
-    <ClCompile Include="$(WinCursDir)cursinit.c" />\r
-    <ClCompile Include="$(WinCursDir)cursinvt.c" />\r
-    <ClCompile Include="$(WinCursDir)cursmain.c" />\r
-    <ClCompile Include="$(WinCursDir)cursmesg.c" />\r
-    <ClCompile Include="$(WinCursDir)cursmisc.c" />\r
-    <ClCompile Include="$(WinCursDir)cursstat.c" />\r
-    <ClCompile Include="$(WinCursDir)curswins.c" />\r
+    <ClCompile Condition="Exists('$(PDCURSES)')" Include="$(WinCursDir)cursdial.c" />\r
+    <ClCompile Condition="Exists('$(PDCURSES)')" Include="$(WinCursDir)cursinit.c" />\r
+    <ClCompile Condition="Exists('$(PDCURSES)')" Include="$(WinCursDir)cursinvt.c" />\r
+    <ClCompile Condition="Exists('$(PDCURSES)')" Include="$(WinCursDir)cursmain.c" />\r
+    <ClCompile Condition="Exists('$(PDCURSES)')" Include="$(WinCursDir)cursmesg.c" />\r
+    <ClCompile Condition="Exists('$(PDCURSES)')" Include="$(WinCursDir)cursmisc.c" />\r
+    <ClCompile Condition="Exists('$(PDCURSES)')" Include="$(WinCursDir)cursstat.c" />\r
+    <ClCompile Condition="Exists('$(PDCURSES)')" Include="$(WinCursDir)curswins.c" />\r
   </ItemGroup>\r
   <ItemGroup>\r
     <ClInclude Include="$(IncDir)align.h" />\r
index e1c36b8a192c2995fd527bccf80c86ec0b75ebe9..0ebb31a25754c0fb7c784afab4e7999f1718f342 100644 (file)
@@ -22,4 +22,7 @@
        <IntDir>$(ObjDir)</IntDir>
        <WinCursDir>$(RootDir)win\curses\</WinCursDir>
   </PropertyGroup>
+  <PropertyGroup Condition="'$(PDCURSES)'=='' AND Exists('$(RootDir)..\PDCurses')">
+       <PDCURSES>$(RootDir)..\PDCurses\</PDCURSES>
+  </PropertyGroup>
 </Project>