Quellcode durchsuchen

Merge branch 'master' of github.com:xythobuz/OpenRaider

Linux compilation Pull Request merged
Thomas Buck vor 10 Jahren
Ursprung
Commit
3ca874b6ea
8 geänderte Dateien mit 21 neuen und 14 gelöschten Zeilen
  1. 11
    7
      CMakeLists.txt
  2. 1
    1
      include/Render.h
  3. 0
    0
      include/config.h.in
  4. 3
    3
      src/CMakeLists.txt
  5. 1
    0
      src/Menu.cpp
  6. 1
    0
      src/SkeletalModel.cpp
  7. 1
    0
      src/World.cpp
  8. 3
    3
      src/utils/strings.cpp

+ 11
- 7
CMakeLists.txt Datei anzeigen

@@ -31,13 +31,17 @@ set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")
31 31
 #################################################################
32 32
 
33 33
 # Build warnings
34
-set (WARNINGS "${WARNINGS} -Weverything -Wno-padded -Wno-packed")
35
-set (WARNINGS "${WARNINGS} -Wno-global-constructors -Wno-exit-time-destructors")
36
-set (WARNINGS "${WARNINGS} -Wno-documentation-unknown-command -Wno-c++98-compat-pedantic")
37
-set (WARNINGS "${WARNINGS} -Wno-missing-prototypes -Wno-missing-variable-declarations")
38
-set (WARNINGS "${WARNINGS} -Wno-disabled-macro-expansion")
39
-
40
-set (WARNINGS "${WARNINGS} -Wno-shorten-64-to-32 -Wno-sign-conversion")
34
+if("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
35
+    set (WARNINGS "${WARNINGS} -Weverything -Wno-padded -Wno-packed")
36
+    set (WARNINGS "${WARNINGS} -Wno-global-constructors -Wno-exit-time-destructors")
37
+    set (WARNINGS "${WARNINGS} -Wno-documentation-unknown-command -Wno-c++98-compat-pedantic")
38
+    set (WARNINGS "${WARNINGS} -Wno-missing-prototypes -Wno-missing-variable-declarations")
39
+    set (WARNINGS "${WARNINGS} -Wno-disabled-macro-expansion")
40
+
41
+    set (WARNINGS "${WARNINGS} -Wno-shorten-64-to-32 -Wno-sign-conversion")
42
+else()
43
+    set (WARNINGS "${WARNINGS} -Wall -Wextra -Wpedantic")
44
+endif()
41 45
 
42 46
 # Flags for all builds
43 47
 set (OpenRaider_CXX_FLAGS "${OpenRaider_CXX_FLAGS} -std=c++11 ${WARNINGS}")

+ 1
- 1
include/Render.h Datei anzeigen

@@ -11,7 +11,7 @@
11 11
 
12 12
 #include <vector>
13 13
 
14
-#include "Config.h"
14
+#include "config.h"
15 15
 #include "math/Matrix.h"
16 16
 #include "ViewVolume.h"
17 17
 #include "World.h"

include/Config.h.in → include/config.h.in Datei anzeigen


+ 3
- 3
src/CMakeLists.txt Datei anzeigen

@@ -68,8 +68,8 @@ endif (SDL2_FOUND AND SDL2TTF_FOUND)
68 68
 
69 69
 # Configuration Header file
70 70
 configure_file (
71
-    "${PROJECT_SOURCE_DIR}/include/Config.h.in"
72
-    "${PROJECT_BINARY_DIR}/Config.h"
71
+    "${PROJECT_SOURCE_DIR}/include/config.h.in"
72
+    "${PROJECT_BINARY_DIR}/config.h"
73 73
 )
74 74
 
75 75
 #################################################################
@@ -177,7 +177,7 @@ endif (APPLE)
177 177
 
178 178
 if (NOT APPLE)
179 179
     # Install binary
180
-    install (TARGET OpenRaider
180
+    install (TARGETS OpenRaider
181 181
         RUNTIME DESTINATION bin
182 182
     )
183 183
 endif (NOT APPLE)

+ 1
- 0
src/Menu.cpp Datei anzeigen

@@ -7,6 +7,7 @@
7 7
 
8 8
 #include <assert.h>
9 9
 #include <dirent.h>
10
+#include <cctype>
10 11
 
11 12
 #ifdef __APPLE__
12 13
 #include <OpenGL/gl.h>

+ 1
- 0
src/SkeletalModel.cpp Datei anzeigen

@@ -6,6 +6,7 @@
6 6
  * \author xythobuz
7 7
  */
8 8
 
9
+#include <cstddef>
9 10
 #include "SkeletalModel.h"
10 11
 
11 12
 SkeletalModel::SkeletalModel() {

+ 1
- 0
src/World.cpp Datei anzeigen

@@ -5,6 +5,7 @@
5 5
  * \author Mongoose
6 6
  */
7 7
 
8
+#include <cstdio>
8 9
 #include <math.h>
9 10
 #include <assert.h>
10 11
 

+ 3
- 3
src/utils/strings.cpp Datei anzeigen

@@ -11,7 +11,7 @@
11 11
 #include <string.h>
12 12
 #include <assert.h>
13 13
 
14
-#if defined(unix) || defined(__APPLE__)
14
+#if defined(unix) || defined(__APPLE__) || defined(__linux__)
15 15
 #include <wordexp.h>
16 16
 #endif
17 17
 
@@ -31,7 +31,7 @@ char *stringRemoveQuotes(const char *s) {
31 31
 }
32 32
 
33 33
 char *stringReplace(const char *s, const char *search, const char *replace) {
34
-    char *tmp = strstr(s, search);
34
+    char *tmp = strstr((char *)s, search);
35 35
     if (tmp == NULL)
36 36
         return NULL;
37 37
     size_t offset = tmp - s;
@@ -130,7 +130,7 @@ char *fullPath(const char *path, char end) {
130 130
     assert(path[0] != '\0');
131 131
 
132 132
     if (path[0] == '~') {
133
-#if defined(unix) || defined(__APPLE__)
133
+#if defined(unix) || defined(__APPLE__) || defined(__linux__)
134 134
 
135 135
 #ifdef __APPLE__
136 136
         // Workaround for Mac OS X. See:

Laden…
Abbrechen
Speichern