diff options
author | LucaSas <sas.luca.alex@gmail.com> | 2021-11-04 16:15:47 +0200 |
---|---|---|
committer | LucaSas <sas.luca.alex@gmail.com> | 2021-11-04 16:15:47 +0200 |
commit | 4e34ae85948438f726a911c9dbb8616968a378a5 (patch) | |
tree | 07b470559a9f973bcf695938606c7c28cd5e161a /libs/raylib/cmake/LibraryConfigurations.cmake | |
parent | d96b4ebce5ee6245fa80d27d41b67aa56555c912 (diff) | |
parent | d227d3c609c4b95fa9c8a0ba5a10e7c47bcb984c (diff) | |
download | gamejam-slgj-2024-4e34ae85948438f726a911c9dbb8616968a378a5.tar.gz gamejam-slgj-2024-4e34ae85948438f726a911c9dbb8616968a378a5.tar.bz2 gamejam-slgj-2024-4e34ae85948438f726a911c9dbb8616968a378a5.zip |
Merge remote-tracking branch 'origin/master'
# Conflicts:
# README.md
# libs/raylib/.gitignore
# libs/raylib/BINDINGS.md
# libs/raylib/CHANGELOG
# libs/raylib/CMakeLists.txt
# libs/raylib/CONTRIBUTING.md
# libs/raylib/HISTORY.md
# libs/raylib/LICENSE
# libs/raylib/README.md
# libs/raylib/ROADMAP.md
# libs/raylib/SPONSORS.md
# libs/raylib/raylib.pc.in
# libs/raylib/src/CMakeLists.txt
# libs/raylib/src/Makefile
# libs/raylib/src/camera.h
# libs/raylib/src/config.h
# libs/raylib/src/core.c
# libs/raylib/src/easings.h
# libs/raylib/src/external/cgltf.h
# libs/raylib/src/external/dr_flac.h
# libs/raylib/src/external/dr_mp3.h
# libs/raylib/src/external/dr_wav.h
# libs/raylib/src/external/glfw/CMake/glfw3.pc.in
# libs/raylib/src/external/glfw/CMake/glfw3Config.cmake.in
# libs/raylib/src/external/glfw/CMakeLists.txt
# libs/raylib/src/external/glfw/README.md
# libs/raylib/src/external/glfw/include/GLFW/glfw3.h
# libs/raylib/src/external/glfw/src/cocoa_init.m
# libs/raylib/src/external/glfw/src/cocoa_joystick.h
# libs/raylib/src/external/glfw/src/cocoa_joystick.m
# libs/raylib/src/external/glfw/src/cocoa_monitor.m
# libs/raylib/src/external/glfw/src/cocoa_platform.h
# libs/raylib/src/external/glfw/src/cocoa_window.m
# libs/raylib/src/external/glfw/src/egl_context.c
# libs/raylib/src/external/glfw/src/egl_context.h
# libs/raylib/src/external/glfw/src/glfw_config.h.in
# libs/raylib/src/external/glfw/src/init.c
# libs/raylib/src/external/glfw/src/input.c
# libs/raylib/src/external/glfw/src/internal.h
# libs/raylib/src/external/glfw/src/linux_joystick.c
# libs/raylib/src/external/glfw/src/linux_joystick.h
# libs/raylib/src/external/glfw/src/mappings.h
# libs/raylib/src/external/glfw/src/nsgl_context.m
# libs/raylib/src/external/glfw/src/null_init.c
# libs/raylib/src/external/glfw/src/null_joystick.c
# libs/raylib/src/external/glfw/src/null_monitor.c
# libs/raylib/src/external/glfw/src/null_platform.h
# libs/raylib/src/external/glfw/src/null_window.c
# libs/raylib/src/external/glfw/src/osmesa_context.h
# libs/raylib/src/external/glfw/src/wgl_context.h
# libs/raylib/src/external/glfw/src/win32_init.c
# libs/raylib/src/external/glfw/src/win32_joystick.c
# libs/raylib/src/external/glfw/src/win32_joystick.h
# libs/raylib/src/external/glfw/src/win32_monitor.c
# libs/raylib/src/external/glfw/src/win32_platform.h
# libs/raylib/src/external/glfw/src/win32_window.c
# libs/raylib/src/external/glfw/src/window.c
# libs/raylib/src/external/glfw/src/wl_init.c
# libs/raylib/src/external/glfw/src/wl_monitor.c
# libs/raylib/src/external/glfw/src/wl_platform.h
# libs/raylib/src/external/glfw/src/wl_window.c
# libs/raylib/src/external/glfw/src/x11_init.c
# libs/raylib/src/external/glfw/src/x11_monitor.c
# libs/raylib/src/external/glfw/src/x11_platform.h
# libs/raylib/src/external/glfw/src/x11_window.c
# libs/raylib/src/external/jar_xm.h
# libs/raylib/src/external/miniaudio.h
# libs/raylib/src/external/stb_image.h
# libs/raylib/src/external/stb_image_write.h
# libs/raylib/src/external/stb_vorbis.h
# libs/raylib/src/external/tinyobj_loader_c.h
# libs/raylib/src/gestures.h
# libs/raylib/src/models.c
# libs/raylib/src/physac.h
# libs/raylib/src/raudio.c
# libs/raylib/src/raudio.h
# libs/raylib/src/raylib.dll.rc
# libs/raylib/src/raylib.dll.rc.data
# libs/raylib/src/raylib.h
# libs/raylib/src/raylib.rc
# libs/raylib/src/raylib.rc.data
# libs/raylib/src/raymath.h
# libs/raylib/src/rglfw.c
# libs/raylib/src/rlgl.h
# libs/raylib/src/rmem.h
# libs/raylib/src/rnet.h
# libs/raylib/src/shapes.c
# libs/raylib/src/text.c
# libs/raylib/src/textures.c
# libs/raylib/src/utils.c
# libs/raylib/src/utils.h
Diffstat (limited to 'libs/raylib/cmake/LibraryConfigurations.cmake')
-rw-r--r-- | libs/raylib/cmake/LibraryConfigurations.cmake | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/libs/raylib/cmake/LibraryConfigurations.cmake b/libs/raylib/cmake/LibraryConfigurations.cmake new file mode 100644 index 0000000..2d4767a --- /dev/null +++ b/libs/raylib/cmake/LibraryConfigurations.cmake @@ -0,0 +1,107 @@ +if (${PLATFORM} MATCHES "Desktop") + set(PLATFORM_CPP "PLATFORM_DESKTOP") + + if (APPLE) + # Need to force OpenGL 3.3 on OS X + # See: https://github.com/raysan5/raylib/issues/341 + set(GRAPHICS "GRAPHICS_API_OPENGL_33") + find_library(OPENGL_LIBRARY OpenGL) + set(LIBS_PRIVATE ${OPENGL_LIBRARY}) + link_libraries("${LIBS_PRIVATE}") + if (NOT CMAKE_SYSTEM STRLESS "Darwin-18.0.0") + add_definitions(-DGL_SILENCE_DEPRECATION) + MESSAGE(AUTHOR_WARNING "OpenGL is deprecated starting with macOS 10.14 (Mojave)!") + endif () + elseif (WIN32) + add_definitions(-D_CRT_SECURE_NO_WARNINGS) + set(LIBS_PRIVATE ${LIBS_PRIVATE} winmm) + else () + find_library(pthread NAMES pthread) + find_package(OpenGL QUIET) + if ("${OPENGL_LIBRARIES}" STREQUAL "") + set(OPENGL_LIBRARIES "GL") + endif () + + if ("${CMAKE_SYSTEM_NAME}" MATCHES "(Net|Open)BSD") + find_library(OSS_LIBRARY ossaudio) + endif () + + set(LIBS_PRIVATE m pthread ${OPENGL_LIBRARIES} ${OSS_LIBRARY}) + endif () + +elseif (${PLATFORM} MATCHES "Web") + set(PLATFORM_CPP "PLATFORM_WEB") + set(GRAPHICS "GRAPHICS_API_OPENGL_ES2") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -s USE_GLFW=3 -s ASSERTIONS=1 --profiling") + set(CMAKE_STATIC_LIBRARY_SUFFIX ".a") + +elseif (${PLATFORM} MATCHES "Android") + set(PLATFORM_CPP "PLATFORM_ANDROID") + set(GRAPHICS "GRAPHICS_API_OPENGL_ES2") + set(CMAKE_POSITION_INDEPENDENT_CODE ON) + + add_definitions(-DANDROID -D__ANDROID_API__=21) + include_directories(external/android/native_app_glue) + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--exclude-libs,libatomic.a -Wl,--build-id -Wl,-z,noexecstack -Wl,-z,relro -Wl,-z,now -Wl,--warn-shared-textrel -Wl,--fatal-warnings -uANativeActivity_onCreate") + + find_library(OPENGL_LIBRARY OpenGL) + set(LIBS_PRIVATE m log android EGL GLESv2 OpenSLES atomic c) + +elseif (${PLATFORM} MATCHES "Raspberry Pi") + set(PLATFORM_CPP "PLATFORM_RPI") + set(GRAPHICS "GRAPHICS_API_OPENGL_ES2") + + add_definitions(-D_DEFAULT_SOURCE) + + find_library(GLESV2 brcmGLESv2 HINTS /opt/vc/lib) + find_library(EGL brcmEGL HINTS /opt/vc/lib) + find_library(BCMHOST bcm_host HINTS /opt/vc/lib) + include_directories(/opt/vc/include /opt/vc/include/interface/vmcs_host/linux /opt/vc/include/interface/vcos/pthreads) + link_directories(/opt/vc/lib) + set(LIBS_PRIVATE ${GLESV2} ${EGL} ${BCMHOST} pthread rt m dl) + +elseif (${PLATFORM} MATCHES "DRM") + set(PLATFORM_CPP "PLATFORM_DRM") + set(GRAPHICS "GRAPHICS_API_OPENGL_ES2") + + add_definitions(-D_DEFAULT_SOURCE) + add_definitions(-DEGL_NO_X11) + add_definitions(-DPLATFORM_DRM) + + find_library(GLESV2 GLESv2) + find_library(EGL EGL) + find_library(DRM drm) + find_library(GBM gbm) + + if (NOT CMAKE_CROSSCOMPILING) + include_directories(/usr/include/libdrm) + endif () + set(LIBS_PRIVATE ${GLESV2} ${EGL} ${DRM} ${GBM} pthread m dl) + +endif () + +if (${OPENGL_VERSION}) + set(${SUGGESTED_GRAPHICS} "${GRAPHICS}") + if (${OPENGL_VERSION} MATCHES "3.3") + set(GRAPHICS "GRAPHICS_API_OPENGL_33") + elseif (${OPENGL_VERSION} MATCHES "2.1") + set(GRAPHICS "GRAPHICS_API_OPENGL_21") + elseif (${OPENGL_VERSION} MATCHES "1.1") + set(GRAPHICS "GRAPHICS_API_OPENGL_11") + elseif (${OPENGL_VERSION} MATCHES "ES 2.0") + set(GRAPHICS "GRAPHICS_API_OPENGL_ES2") + endif () + if ("${SUGGESTED_GRAPHICS}" AND NOT "${SUGGESTED_GRAPHICS}" STREQUAL "${GRAPHICS}") + message(WARNING "You are overriding the suggested GRAPHICS=${SUGGESTED_GRAPHICS} with ${GRAPHICS}! This may fail") + endif () +endif () + +if (NOT GRAPHICS) + set(GRAPHICS "GRAPHICS_API_OPENGL_33") +endif () + +set(LIBS_PRIVATE ${LIBS_PRIVATE} ${OPENAL_LIBRARY}) + +if (${PLATFORM} MATCHES "Desktop") + set(LIBS_PRIVATE ${LIBS_PRIVATE} glfw) +endif () |