Browse Source

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

Linux compilation Pull Request merged
Thomas Buck 10 years ago
parent
commit
3ca874b6ea
8 changed files with 21 additions and 14 deletions
  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 View File

31
 #################################################################
31
 #################################################################
32
 
32
 
33
 # Build warnings
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
 # Flags for all builds
46
 # Flags for all builds
43
 set (OpenRaider_CXX_FLAGS "${OpenRaider_CXX_FLAGS} -std=c++11 ${WARNINGS}")
47
 set (OpenRaider_CXX_FLAGS "${OpenRaider_CXX_FLAGS} -std=c++11 ${WARNINGS}")

+ 1
- 1
include/Render.h View File

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

include/Config.h.in → include/config.h.in View File


+ 3
- 3
src/CMakeLists.txt View File

68
 
68
 
69
 # Configuration Header file
69
 # Configuration Header file
70
 configure_file (
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
 
177
 
178
 if (NOT APPLE)
178
 if (NOT APPLE)
179
     # Install binary
179
     # Install binary
180
-    install (TARGET OpenRaider
180
+    install (TARGETS OpenRaider
181
         RUNTIME DESTINATION bin
181
         RUNTIME DESTINATION bin
182
     )
182
     )
183
 endif (NOT APPLE)
183
 endif (NOT APPLE)

+ 1
- 0
src/Menu.cpp View File

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

+ 1
- 0
src/SkeletalModel.cpp View File

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

+ 1
- 0
src/World.cpp View File

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

+ 3
- 3
src/utils/strings.cpp View File

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

Loading…
Cancel
Save