@@ -108,7 +108,8 @@ if(BUILD_CLIENT)
108
108
if (ENABLE_GLES)
109
109
find_package (OpenGLES2 REQUIRED)
110
110
else ()
111
- if (NOT WIN32 ) # Unix probably
111
+ # transitive dependency from Irrlicht (see longer explanation below)
112
+ if (NOT WIN32 )
112
113
set (OPENGL_GL_PREFERENCE "LEGACY" CACHE STRING
113
114
"See CMake Policy CMP0072 for reference. GLVND is broken on some nvidia setups" )
114
115
set (OpenGL_GL_PREFERENCE ${OPENGL_GL_PREFERENCE} )
@@ -281,25 +282,38 @@ if(WIN32)
281
282
else ()
282
283
# Unix probably
283
284
if (BUILD_CLIENT)
284
- if (NOT HAIKU)
285
+ if (NOT HAIKU AND NOT APPLE )
285
286
find_package (X11 REQUIRED)
286
- endif (NOT HAIKU)
287
+ endif (NOT HAIKU AND NOT APPLE )
288
+
289
+ ##
290
+ # The following dependencies are transitive dependencies from Irrlicht.
291
+ # Minetest itself does not use them, but we link them so that statically
292
+ # linking Irrlicht works.
293
+ if (NOT HAIKU AND NOT APPLE )
294
+ # This way Xxf86vm is found on OpenBSD too
295
+ find_library (XXF86VM_LIBRARY Xxf86vm)
296
+ mark_as_advanced (XXF86VM_LIBRARY)
297
+ set (CLIENT_PLATFORM_LIBS ${CLIENT_PLATFORM_LIBS} ${XXF86VM_LIBRARY} )
298
+ endif (NOT HAIKU AND NOT APPLE )
287
299
288
300
find_package (JPEG REQUIRED)
289
301
find_package (BZip2 REQUIRED)
290
302
find_package (PNG REQUIRED)
291
303
if (APPLE )
292
- find_library (CARBON_LIB Carbon)
293
- find_library (COCOA_LIB Cocoa)
294
- find_library (IOKIT_LIB IOKit)
304
+ find_library (CARBON_LIB Carbon REQUIRED )
305
+ find_library (COCOA_LIB Cocoa REQUIRED )
306
+ find_library (IOKIT_LIB IOKit REQUIRED )
295
307
mark_as_advanced (
296
308
CARBON_LIB
297
309
COCOA_LIB
298
310
IOKIT_LIB
299
311
)
300
312
SET (CLIENT_PLATFORM_LIBS ${CLIENT_PLATFORM_LIBS} ${CARBON_LIB} ${COCOA_LIB} ${IOKIT_LIB} )
301
313
endif (APPLE )
314
+ ##
302
315
endif (BUILD_CLIENT)
316
+
303
317
find_package (ZLIB REQUIRED)
304
318
set (PLATFORM_LIBS -lpthread ${CMAKE_DL_LIBS} )
305
319
if (APPLE )
@@ -311,13 +325,6 @@ else()
311
325
endif (HAVE_LIBRT)
312
326
endif (APPLE )
313
327
314
- if (NOT HAIKU AND NOT APPLE )
315
- # This way Xxf86vm is found on OpenBSD too
316
- find_library (XXF86VM_LIBRARY Xxf86vm)
317
- mark_as_advanced (XXF86VM_LIBRARY)
318
- set (CLIENT_PLATFORM_LIBS ${CLIENT_PLATFORM_LIBS} ${XXF86VM_LIBRARY} )
319
- endif (NOT HAIKU AND NOT APPLE )
320
-
321
328
# Prefer local iconv if installed
322
329
find_library (ICONV_LIBRARY iconv)
323
330
mark_as_advanced (ICONV_LIBRARY)
0 commit comments