]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
Fix compile on CentOS 7 TimePath/cmake
authorTimePath <andrew.hardaker1995@gmail.com>
Sat, 26 Mar 2016 10:11:46 +0000 (21:11 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Sat, 26 Mar 2016 10:20:10 +0000 (21:20 +1100)
CMakeLists.txt
libs/CMakeLists.txt
libs/l_net/l_net_berkley.c
tools/quake3/common/vfs.h
tools/quake3/q3data/q3data.c

index d5fb2d61c5907f885284627a0c532dab9274bed8..bc2908583a35a3192269f37945869090411b6f12 100644 (file)
@@ -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
index 19ed8fa90a84680262096f70b5e41cd129aaac53..049e6da7a690f45025ad2d69203449aacf82596d 100644 (file)
@@ -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)
index ac618dd684002a966923c18f3780fc01ab3333ef..5571fa98afe7171f2667e3a0453c8f16336c39f4 100644 (file)
@@ -37,6 +37,8 @@
 #include "l_net_wins.h"
 
 #include <sys/types.h>
+typedef unsigned short u_short;
+typedef unsigned long u_long;
 #include <sys/socket.h>
 #include <sys/ioctl.h>
 #include <netinet/in.h>
index 51ac6dddcfce11f6d2984f16333667479912f297..776402fe54dd70a6453692b1d1490290361b532c 100644 (file)
@@ -41,6 +41,8 @@
 #include <io.h>
 #define R_OK 04
 #define S_ISDIR( mode ) ( mode & _S_IFDIR )
+#endif
+#ifndef PATH_MAX
 #define PATH_MAX 260
 #endif
 #include <glib.h>
index 098e78f670e3a22f1961da10024ab12c5458d7f9..ba463014474789edbe7ae01c62d1fee5fcbdbeab 100644 (file)
@@ -336,6 +336,7 @@ void PackDirectory_r( char *dir ){
 #include <sys/types.h>
 #ifndef WIN32
 #include <sys/dir.h>
+#include <sys/stat.h>
 #else
 #include <sys/dirent.h>
 #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;
                }