File: 0005-fix-sdl-build.patch

package info (click to toggle)
spring 88.0%2Bdfsg1-1.1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 41,524 kB
  • sloc: cpp: 343,114; ansic: 38,414; python: 12,257; java: 12,203; awk: 5,748; sh: 1,204; xml: 997; perl: 405; objc: 192; makefile: 181; php: 134; sed: 2
file content (121 lines) | stat: -rw-r--r-- 4,023 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
Author: Jan Dittberner <jandd@debian.org>
Subject: Use Debian version of SDL headers instead of missing included

--- a/rts/lib/headlessStubs/CMakeLists.txt
+++ b/rts/lib/headlessStubs/CMakeLists.txt
@@ -12,18 +12,8 @@
 		)
 ENDIF (WIN32)
 
-IF    (MINGW)
-	# We still need these header files,
-	# even if we are not going to link with SDL.
-	# We have them available anyway (mingwlibs).
-	FIND_PACKAGE(SDL REQUIRED)
-	INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR})
-ELSE  (MINGW)
-	# Use a direct copy of the GL and SDL headers,
-	# as these may not be available on headless systems.
-	INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
-	INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include/SDL)
-ENDIF (MINGW)
+FIND_PACKAGE(SDL REQUIRED)
+INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR})
 
 ADD_LIBRARY(headlessStubs STATIC EXCLUDE_FROM_ALL ${headlessStubsSources})
 TARGET_LINK_LIBRARIES(headlessStubs ${Boost_THREAD_LIBRARY})
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -165,9 +165,8 @@
 	add_definitions(${CUSTOM_COMPILER_DEFINITIONS})
 endif (CUSTOM_COMPILER_DEFINITIONS)
 
-if    (MINGW)
-	set(SDL_INCLUDE_DIR "${MINGWLIBS}/include/SDL")
-endif (MINGW)
+FIND_PACKAGE(SDL REQUIRED)
+INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR})
 if    (WIN32)
 	FIND_PACKAGE(Windres)
 endif (WIN32)
--- a/tools/unitsync/CMakeLists.txt
+++ b/tools/unitsync/CMakeLists.txt
@@ -13,18 +13,8 @@
 LIST(APPEND unitsync_libs 7zip lua)
 LIST(APPEND unitsync_libs headlessStubs)
 
-IF    (MINGW)
-	# We still need these header files,
-	# even if we are not going to link with SDL.
-	# We have them available anyway (mingwlibs).
-	FIND_PACKAGE(SDL REQUIRED)
-	INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR})
-ELSE  (MINGW)
-	# Use a direct copy of the GL and SDL headers,
-	# as these may not be available on headless systems.
-	INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include/SDL)
-ENDIF (MINGW)
-
+FIND_PACKAGE(SDL REQUIRED)
+INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR})
 
 ADD_DEFINITIONS(-DUNITSYNC)
 ADD_DEFINITIONS(${PIC_FLAG})
--- a/rts/builds/dedicated/CMakeLists.txt
+++ b/rts/builds/dedicated/CMakeLists.txt
@@ -27,21 +27,8 @@
 	LIST(APPEND engineDedicatedLibraries dl)
 ENDIF (UNIX)
 
-IF    (MINGW OR APPLE)
-	# Windows:
-	# We still need these header files,
-	# even if we are not going to link with SDL.
-	# We have them available anyway (mingwlibs).
-	# OS X:
-	# Cocoa requires the SDL libary, whenever the SDL headers are used,
-	# due to some #define magic, which is practically impossible to workaround.
-	FIND_PACKAGE(SDL REQUIRED)
-	INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR})
-ELSE  (MINGW OR APPLE)
-	# Use a direct copy of the GL and SDL headers,
-	# as these may not be available on headless systems.
-	INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include/SDL)
-ENDIF (MINGW OR APPLE)
+FIND_PACKAGE(SDL REQUIRED)
+INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR})
 
 
 ### Assemble the incude dirs
--- a/rts/builds/headless/CMakeLists.txt
+++ b/rts/builds/headless/CMakeLists.txt
@@ -12,25 +12,10 @@
 ADD_DEFINITIONS(-DBITMAP_NO_OPENGL)
 REMOVE_DEFINITIONS(-DAVI_CAPTURING)
 
-IF    (MINGW OR APPLE)
-	# Windows:
-	# We still need these header files,
-	# even if we are not going to link with gl, glu and SDL.
-	# We have them available anyway (mingwlibs).
-	# OS X:
-	# Cocoa requires the SDL libary, whenever the SDL headers are used,
-	# due to some #define magic, which is practically impossible to workaround.
-	FIND_PACKAGE(OpenGL REQUIRED)
-	FIND_PACKAGE(GLU REQUIRED)
-	FIND_PACKAGE(SDL REQUIRED)
-	INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR})
-ELSE  (MINGW OR APPLE)
-	# Use a direct copy of the GL and SDL headers,
-	# as these may not be available on headless systems.
-	INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include)
-	INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include/SDL)
-ENDIF (MINGW OR APPLE)
-
+FIND_PACKAGE(OpenGL REQUIRED)
+FIND_PACKAGE(GLU REQUIRED)
+FIND_PACKAGE(SDL REQUIRED)
+INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR})
 
 # headlessstubs are our stubs that replace libGL, libGLU, libGLEW, libSDL (yes really!)
 LIST(APPEND engineHeadlessLibraries headlessStubs)