summaryrefslogtreecommitdiff
path: root/games-arcade/cdogs-sdl/files/cdogs-sdl-0.10.1-Add-BUILD_EDITOR-option.patch
blob: 5a5912e9b3afbb0900d890ad48c4fa4d499250fa (plain)
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
From f8adfb66ea686366edddc89e92c9a5537b8dfbef Mon Sep 17 00:00:00 2001
From: William Breathitt Gray <vilhelm.gray@gmail.com>
Date: Wed, 9 Dec 2020 07:45:54 -0500
Subject: [PATCH] Add BUILD_EDITOR option to control cdogs-sdl-editor build

---
 CMakeLists.txt     | 10 +++++++---
 src/CMakeLists.txt |  6 +++---
 2 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 169a17ca..510e4802 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -29,12 +29,14 @@ SET(WEBSITE "http://cxong.github.io/cdogs-sdl/")
 option(DEBUG "Enable debug build" OFF)
 option(DEBUG_PROFILE "Enable debug profile build" OFF)
 option(USE_SHARED_ENET "Use system installed copy of enet" OFF)
+option(BUILD_EDITOR "Build cdogs-sdl-editor" ON)
 
 # check for crosscompiling (defined when using a toolchain file)
 if(CMAKE_CROSSCOMPILING)
 	# check for gcw0
 	if(CMAKE_C_COMPILER MATCHES ".*gcw0-linux.*")
 		set(GCW0 1)
+		set(BUILD_EDITOR OFF)
 	endif()
 endif()
 
@@ -65,7 +67,9 @@ find_package(Nanopb REQUIRED)
 find_package(SDL2 REQUIRED)
 find_package(SDL2_image REQUIRED)
 find_package(SDL2_mixer REQUIRED)
-find_package(OpenGL REQUIRED)
+if(BUILD_EDITOR)
+	find_package(OpenGL REQUIRED)
+endif()
 find_package(CCache)
 link_directories(${SDL2_LIBRARY_DIRS} ${SDL2_IMAGE_LIBRARY_DIRS} ${SDL2_MIXER_LIBRARY_DIRS})
 
@@ -165,7 +169,7 @@ set_target_properties(cdogs-sdl PROPERTIES
 	RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_BINARY_DIR}/src
 	RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_BINARY_DIR}/src
 )
-if(NOT "${GCW0}")
+if(BUILD_EDITOR)
 	set_target_properties(cdogs-sdl-editor PROPERTIES
 		RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_CURRENT_BINARY_DIR}/src
 		RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_CURRENT_BINARY_DIR}/src
@@ -200,7 +204,7 @@ install(
   PROGRAMS
     ${CMAKE_CURRENT_BINARY_DIR}/src/cdogs-sdl${EXE_EXTENSION}
     DESTINATION ${CDOGS_BIN_DIR})
-if(NOT "${GCW0}")
+if(BUILD_EDITOR)
 	install(
 	  PROGRAMS
 	    ${CMAKE_CURRENT_BINARY_DIR}/src/cdogs-sdl-editor${EXE_EXTENSION}
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 8fb82667..564cbf3f 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -4,12 +4,12 @@ include_directories(
 	${SDL2_INCLUDE_DIRS}
 	${SDL2_IMAGE_INCLUDE_DIRS}
 	${SDL2_MIXER_INCLUDE_DIRS})
-if(NOT "${GCW0}")
+if(BUILD_EDITOR)
 	include_directories(${OPENGL_INCLUDE_DIRS})
 endif()
 
 add_subdirectory(cdogs)
-if(NOT "${GCW0}")
+if(BUILD_EDITOR)
 	add_subdirectory(cdogsed)
 endif()
 add_subdirectory(json)
@@ -82,7 +82,7 @@ if(GCW0)
 	)
 endif()
 
-if(NOT "${GCW0}")
+if(BUILD_EDITOR)
   add_executable(cdogs-sdl-editor cdogsed/cdogsed.c ${CDOGS_SDL_EXTRA})
   if(APPLE)
   	set_target_properties(cdogs-sdl-editor PROPERTIES
-- 
2.29.2