From: TimePath Date: Sat, 26 Mar 2016 10:11:46 +0000 (+1100) Subject: Fix compile on CentOS 7 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=refs%2Fheads%2FTimePath%2Fcmake;p=xonotic%2Fnetradiant.git Fix compile on CentOS 7 --- diff --git a/CMakeLists.txt b/CMakeLists.txt index d5fb2d61..bc290858 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,6 @@ -cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR) +cmake_minimum_required(VERSION 2.8.11 FATAL_ERROR) + +option(SKIP_RADIANT "don't build the gui, useful for map compile servers" OFF) project(NetRadiant C CXX) @@ -150,19 +152,25 @@ add_library(includes ${INCLUDELIST}) # Plugins #----------------------------------------------------------------------- -add_subdirectory(contrib) +if (NOT SKIP_RADIANT) + add_subdirectory(contrib) +endif () #----------------------------------------------------------------------- # Modules #----------------------------------------------------------------------- -add_subdirectory(plugins) +if (NOT SKIP_RADIANT) + add_subdirectory(plugins) +endif () #----------------------------------------------------------------------- # Radiant #----------------------------------------------------------------------- -add_subdirectory(radiant build) +if (NOT SKIP_RADIANT) + add_subdirectory(radiant build) +endif () if (CMAKE_EXECUTABLE_SUFFIX) set(RADIANT_EXECUTABLE ${CMAKE_EXECUTABLE_SUFFIX}) @@ -173,9 +181,12 @@ else () OUTPUT_STRIP_TRAILING_WHITESPACE ) endif () -set_target_properties(radiant PROPERTIES - COMPILE_DEFINITIONS RADIANT_EXECUTABLE="${RADIANT_EXECUTABLE}" - ) + +if (NOT SKIP_RADIANT) + set_target_properties(radiant PROPERTIES + COMPILE_DEFINITIONS RADIANT_EXECUTABLE="${RADIANT_EXECUTABLE}" + ) +endif () #----------------------------------------------------------------------- # Tools diff --git a/libs/CMakeLists.txt b/libs/CMakeLists.txt index 19ed8fa9..049e6da7 100644 --- a/libs/CMakeLists.txt +++ b/libs/CMakeLists.txt @@ -10,7 +10,9 @@ add_subdirectory(debugging) add_subdirectory(etclib) add_subdirectory(filematch) add_subdirectory(generic) -add_subdirectory(gtkutil) +if (NOT SKIP_RADIANT) + add_subdirectory(gtkutil) +endif () add_subdirectory(l_net) add_subdirectory(math) add_subdirectory(mathlib) diff --git a/libs/l_net/l_net_berkley.c b/libs/l_net/l_net_berkley.c index ac618dd6..5571fa98 100644 --- a/libs/l_net/l_net_berkley.c +++ b/libs/l_net/l_net_berkley.c @@ -37,6 +37,8 @@ #include "l_net_wins.h" #include +typedef unsigned short u_short; +typedef unsigned long u_long; #include #include #include diff --git a/tools/quake3/common/vfs.h b/tools/quake3/common/vfs.h index 51ac6ddd..776402fe 100644 --- a/tools/quake3/common/vfs.h +++ b/tools/quake3/common/vfs.h @@ -41,6 +41,8 @@ #include #define R_OK 04 #define S_ISDIR( mode ) ( mode & _S_IFDIR ) +#endif +#ifndef PATH_MAX #define PATH_MAX 260 #endif #include diff --git a/tools/quake3/q3data/q3data.c b/tools/quake3/q3data/q3data.c index 098e78f6..ba463014 100644 --- a/tools/quake3/q3data/q3data.c +++ b/tools/quake3/q3data/q3data.c @@ -336,6 +336,7 @@ void PackDirectory_r( char *dir ){ #include #ifndef WIN32 #include +#include #else #include #endif @@ -372,7 +373,7 @@ void PackDirectory_r( char *dir ){ if ( stat( dirstring, &st ) == -1 ) { Error( "fstating %s", pf->name ); } - if ( st.st_mode & S_IFDIR ) { // directory + if ( S_ISDIR(st.st_mode) ) { // directory PackDirectory_r( fullname ); continue; }