- Added Linux support for the CMakeLists. This meant downgrading them for
CMake 2.4, since the distros don't seem to consider 2.6 stable yet. As a bonus, GTK+ is no longer a required dependency; now it's optional. - Made dehsupp ignore CR characters, so it doesn't spew warnings on Linux. SVN r1092 (trunk)
This commit is contained in:
parent
0e9c1d0c2a
commit
de5d4715c2
24 changed files with 106 additions and 248 deletions
|
|
@ -1,5 +1,6 @@
|
|||
cmake_minimum_required( VERSION 2.6 )
|
||||
cmake_minimum_required( VERSION 2.4 )
|
||||
include( CheckFunctionExists )
|
||||
include( FindPkgConfig )
|
||||
|
||||
option( NO_ASM "Disable assembly code" )
|
||||
if( CMAKE_COMPILER_IS_GNUCXX )
|
||||
|
|
@ -85,6 +86,7 @@ else( WIN32 )
|
|||
/usr/include
|
||||
/opt/local/include
|
||||
/opt/include )
|
||||
set( FMOD_INC_PATH_SUFFIXES PATH_SUFFIXES fmodex )
|
||||
set( NASM_NAMES nasm )
|
||||
|
||||
# Non-Windows version also needs SDL
|
||||
|
|
@ -97,13 +99,13 @@ else( WIN32 )
|
|||
|
||||
# Use GTK+ for the IWAD picker, if available.
|
||||
if( NOT NO_GTK )
|
||||
find_package( GTK )
|
||||
if( GTK_FOUND )
|
||||
set( ZDOOM_LIBS ${ZDOOM_LIBS} ${GTK_LIBRARIES )
|
||||
include_directories( "${GTK_LIBRARIES}" )
|
||||
else( GTK_FOUND )
|
||||
pkg_check_modules( GTK2 gtk+-2.0 )
|
||||
if( GTK2_FOUND )
|
||||
set( ZDOOM_LIBS ${ZDOOM_LIBS} ${GTK2_LIBRARIES} )
|
||||
include_directories( ${GTK2_INCLUDE_DIRS} )
|
||||
else( GTK2_FOUND )
|
||||
set( NO_GTK ON )
|
||||
endif( GTK_FOUND )
|
||||
endif( GTK2_FOUND )
|
||||
endif( NOT NO_GTK )
|
||||
|
||||
if( NO_GTK )
|
||||
|
|
@ -255,7 +257,7 @@ endif( NOT MSVC )
|
|||
# Update svnrevision.h
|
||||
|
||||
add_custom_command( OUTPUT ${CMAKE_SOURCE_DIR}/src/svnrevision.h
|
||||
COMMAND updaterevision . src/svnrevision.h
|
||||
COMMAND ${CMAKE_BINARY_DIR}/tools/updaterevision/updaterevision . src/svnrevision.h
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
DEPENDS updaterevision )
|
||||
|
||||
|
|
@ -300,6 +302,7 @@ else( WIN32 )
|
|||
set( SYSTEM_SOURCES
|
||||
sdl/crashcatcher.c
|
||||
sdl/hardware.cpp
|
||||
sdl/i_cd.cpp
|
||||
sdl/i_input.cpp
|
||||
sdl/i_main.cpp
|
||||
sdl/i_movie.cpp
|
||||
|
|
@ -323,12 +326,12 @@ endif( NOT NO_ASM )
|
|||
|
||||
add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xlat_parser.c ${CMAKE_CURRENT_BINARY_DIR}/xlat_parser.h
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/xlat/xlat_parser.y .
|
||||
COMMAND lemon xlat_parser.y
|
||||
COMMAND ${CMAKE_BINARY_DIR}/tools/lemon/lemon xlat_parser.y
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
|
||||
DEPENDS lemon ${CMAKE_CURRENT_SOURCE_DIR}/xlat/xlat_parser.y )
|
||||
|
||||
add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/sc_man_scanner.h
|
||||
COMMAND re2c --no-generation-date -s -o ${CMAKE_CURRENT_BINARY_DIR}/sc_man_scanner.h ${CMAKE_CURRENT_SOURCE_DIR}/sc_man_scanner.re
|
||||
COMMAND ${CMAKE_BINARY_DIR}/tools/re2c/re2c --no-generation-date -s -o ${CMAKE_CURRENT_BINARY_DIR}/sc_man_scanner.h ${CMAKE_CURRENT_SOURCE_DIR}/sc_man_scanner.re
|
||||
DEPENDS re2c ${CMAKE_CURRENT_SOURCE_DIR}/sc_man_scanner.re )
|
||||
|
||||
include_directories( ${CMAKE_CURRENT_BINARY_DIR} )
|
||||
|
|
@ -680,9 +683,18 @@ include_directories( .
|
|||
|
||||
add_dependencies( zdoom revision_check )
|
||||
|
||||
# RUNTIME_OUTPUT_DIRECTORY does not exist in CMake 2.4.
|
||||
# Linux distributions are slow to adopt 2.6. :(
|
||||
set_target_properties( zdoom PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${ZDOOM_OUTPUT_DIR} )
|
||||
set_target_properties( zdoom PROPERTIES OUTPUT_NAME ${ZDOOM_EXE_NAME} )
|
||||
|
||||
if( NOT WIN32 )
|
||||
FILE( WRITE ${CMAKE_CURRENT_BINARY_DIR}/link-make "if [ ! -e ${ZDOOM_OUTPUT_DIR}/${ZDOOM_EXE_NAME} ]; then ln -sf ${CMAKE_CURRENT_BINARY_DIR}/${ZDOOM_EXE_NAME} ${ZDOOM_OUTPUT_DIR}/${ZDOOM_EXE_NAME}; fi" )
|
||||
add_custom_command( TARGET zdoom POST_BUILD
|
||||
COMMAND chmod +x ${CMAKE_CURRENT_BINARY_DIR}/link-make
|
||||
COMMAND /bin/sh -c ${CMAKE_CURRENT_BINARY_DIR}/link-make )
|
||||
endif( NOT WIN32 )
|
||||
|
||||
if( CMAKE_COMPILER_IS_GNUCXX )
|
||||
# GCC misoptimizes this file
|
||||
set_source_files_properties( oplsynth/fmopl.cpp PROPERTIES COMPILE_FLAGS "-fno-tree-dominator-opts -fno-tree-fre" )
|
||||
|
|
|
|||
|
|
@ -2068,7 +2068,7 @@ void P_ProcessSideTextures(bool checktranmap, side_t *sd, sector_t *sec, mapside
|
|||
// upper "texture" is light color
|
||||
// lower "texture" is fog color
|
||||
{
|
||||
DWORD color, fog;
|
||||
DWORD color = MAKERGB(255,255,255), fog = 0;
|
||||
bool colorgood, foggood;
|
||||
|
||||
SetTextureNoErr (sd, side_t::bottom, &fog, msd->bottomtexture, &foggood);
|
||||
|
|
|
|||
|
|
@ -947,7 +947,7 @@ static FSoundChan *S_StartSound(AActor *actor, const sector_t *sec, const FPolyO
|
|||
}
|
||||
|
||||
// If this actor is already playing something on the selected channel, stop it.
|
||||
if (type != SOURCE_None && (actor == NULL && channel != CHAN_AUTO) || (actor != NULL && actor->SoundChans & (1 << channel)))
|
||||
if (type != SOURCE_None && ((actor == NULL && channel != CHAN_AUTO) || (actor != NULL && actor->SoundChans & (1 << channel))))
|
||||
{
|
||||
for (chan = Channels; chan != NULL; chan = chan->NextChan)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -40,7 +40,9 @@
|
|||
#include <signal.h>
|
||||
#include <new>
|
||||
#include <sys/param.h>
|
||||
#ifndef NO_GTK
|
||||
#include <gtk/gtk.h>
|
||||
#endif
|
||||
#include <locale.h>
|
||||
|
||||
#include "doomerrors.h"
|
||||
|
|
@ -72,7 +74,9 @@ extern "C" int cc_install_handlers(int, int*, const char*, int(*)(char*, char*))
|
|||
|
||||
// PUBLIC DATA DEFINITIONS -------------------------------------------------
|
||||
|
||||
#ifndef NO_GTK
|
||||
bool GtkAvailable;
|
||||
#endif
|
||||
|
||||
// The command line arguments.
|
||||
DArgs *Args;
|
||||
|
|
@ -207,7 +211,9 @@ int main (int argc, char **argv)
|
|||
seteuid (getuid ());
|
||||
std::set_new_handler (NewFailure);
|
||||
|
||||
#ifndef NO_GTK
|
||||
GtkAvailable = gtk_init_check (&argc, &argv);
|
||||
#endif
|
||||
|
||||
setlocale (LC_ALL, "C");
|
||||
|
||||
|
|
|
|||
|
|
@ -29,9 +29,11 @@
|
|||
|
||||
#include <stdarg.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/time.h>
|
||||
#include <sys/time.h>
|
||||
#ifndef NO_GTK
|
||||
#include <gtk/gtk.h>
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
#include <gdk/gdkkeysyms.h>
|
||||
#endif
|
||||
|
||||
#include "doomerrors.h"
|
||||
#include <math.h>
|
||||
|
|
@ -71,8 +73,10 @@ extern "C"
|
|||
double CyclesPerSecond = 1e8;
|
||||
CPUInfo CPU;
|
||||
}
|
||||
|
||||
extern bool GtkAvailable;
|
||||
|
||||
#ifndef NO_GTK
|
||||
extern bool GtkAvailable;
|
||||
#endif
|
||||
|
||||
void CalculateCPUSpeed ();
|
||||
|
||||
|
|
@ -342,6 +346,7 @@ void I_PrintStr (const char *cp)
|
|||
fflush (stdout);
|
||||
}
|
||||
|
||||
#ifndef NO_GTK
|
||||
// GtkTreeViews eats return keys. I want this to be like a Windows listbox
|
||||
// where pressing Return can still activate the default button.
|
||||
gint AllowDefault(GtkWidget *widget, GdkEventKey *event, gpointer func_data)
|
||||
|
|
@ -381,7 +386,7 @@ void ClickedOK(GtkButton *button, gpointer func_data)
|
|||
}
|
||||
|
||||
EXTERN_CVAR (Bool, queryiwad);
|
||||
|
||||
|
||||
int I_PickIWad_Gtk (WadStuff *wads, int numwads, bool showwin, int defaultiwad)
|
||||
{
|
||||
GtkWidget *window;
|
||||
|
|
@ -513,7 +518,8 @@ int I_PickIWad_Gtk (WadStuff *wads, int numwads, bool showwin, int defaultiwad)
|
|||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
int I_PickIWad (WadStuff *wads, int numwads, bool showwin, int defaultiwad)
|
||||
{
|
||||
|
|
@ -523,11 +529,13 @@ int I_PickIWad (WadStuff *wads, int numwads, bool showwin, int defaultiwad)
|
|||
{
|
||||
return defaultiwad;
|
||||
}
|
||||
|
||||
|
||||
#ifndef NO_GTK
|
||||
if (GtkAvailable)
|
||||
{
|
||||
return I_PickIWad_Gtk (wads, numwads, showwin, defaultiwad);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
printf ("Please select a game wad (or 0 to exit):\n");
|
||||
for (i = 0; i < numwads; ++i)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue