Skip to content

Commit

Permalink
[cmake] fix set of APP_RENDER_SYSTEM on KodiConfig.cmake
Browse files Browse the repository at this point in the history
In the implementation of GLES under Windows found the foolish finding of OpenGL. This seems to exist systematically and makes it a little harder. Then found that "APP_RENDER_SYSTEM" of "KodiConfig.cmake" is not defined correctly (empty defined).

This request fixes this and uses the "platform" folder.
Parts of "Platform.cmake" are also included in PrepareEnv.cmake.
  • Loading branch information
AlwinEsch committed Mar 14, 2019
1 parent d68bd9b commit 3f0b2e7
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 5 deletions.
1 change: 1 addition & 0 deletions cmake/platform/android/android.cmake
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
set(PLATFORM_REQUIRED_DEPS OpenGLES EGL Zip)
set(APP_RENDER_SYSTEM gles)
1 change: 1 addition & 0 deletions cmake/platform/freebsd/x11.cmake
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
set(PLATFORM_REQUIRED_DEPS OpenGl EGL X XRandR LibDRM)
set(PLATFORM_OPTIONAL_DEPS VAAPI VDPAU GLX)
set(APP_RENDER_SYSTEM gl)
1 change: 1 addition & 0 deletions cmake/platform/ios/ios.cmake
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
set(PLATFORM_REQUIRED_DEPS OpenGLES)
set(APP_RENDER_SYSTEM gles)
1 change: 1 addition & 0 deletions cmake/platform/osx/osx.cmake
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
set(PLATFORM_REQUIRED_DEPS OpenGl Sdl)
set(APP_RENDER_SYSTEM gl)
2 changes: 1 addition & 1 deletion cmake/platform/windows/windows.cmake
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# File intentionally left empty
set(APP_RENDER_SYSTEM dx11)
1 change: 1 addition & 0 deletions cmake/platform/windowsstore/windowsstore.cmake
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
set(PLATFORM_REQUIRED_DEPS zlib)
set(APP_RENDER_SYSTEM dx11)
17 changes: 13 additions & 4 deletions cmake/scripts/common/Platform.cmake
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
if(NOT CORE_SYSTEM_NAME)
string(TOLOWER ${CMAKE_SYSTEM_NAME} CORE_SYSTEM_NAME)
endif()
# Switch used path, if CORE_SOURCE_DIR is set use it (e.g. on addons build)
# otherwise use the present source dir
if(CORE_SOURCE_DIR)
set(PLATFORM_USED_SOURCE_DIR ${CORE_SOURCE_DIR})
else()
set(PLATFORM_USED_SOURCE_DIR ${CMAKE_SOURCE_DIR})
endif()

if(CORE_SYSTEM_NAME STREQUAL linux OR CORE_SYSTEM_NAME STREQUAL freebsd)
# Set default CORE_PLATFORM_NAME to X11
Expand All @@ -24,14 +31,16 @@ unset(_DEFAULT_PLATFORM)
string(TOLOWER ${CORE_PLATFORM_NAME} CORE_PLATFORM_NAME_LC)

list(APPEND final_message "Platform: ${CORE_PLATFORM_NAME}")
if(EXISTS ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/${CORE_PLATFORM_NAME_LC}.cmake)
include(${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/${CORE_PLATFORM_NAME_LC}.cmake)
if(EXISTS ${PLATFORM_USED_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/${CORE_PLATFORM_NAME_LC}.cmake)
include(${PLATFORM_USED_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/${CORE_PLATFORM_NAME_LC}.cmake)
if(ENABLE_APP_AUTONAME)
set(APP_BINARY_SUFFIX "-${CORE_PLATFORM_NAME_LC}")
endif()
else()
file(GLOB _platformnames RELATIVE ${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/
${CMAKE_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/*.cmake)
file(GLOB _platformnames RELATIVE ${PLATFORM_USED_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/
${PLATFORM_USED_SOURCE_DIR}/cmake/platform/${CORE_SYSTEM_NAME}/*.cmake)
string(REPLACE ".cmake" " " _platformnames ${_platformnames})
message(FATAL_ERROR "invalid CORE_PLATFORM_NAME: ${CORE_PLATFORM_NAME_LC}\nValid platforms: ${_platformnames}")
endif()

unset(PLATFORM_USED_SOURCE_DIR)
1 change: 1 addition & 0 deletions cmake/scripts/common/PrepareEnv.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# parse version.txt and versions.h to get the version and API info
include(${CORE_SOURCE_DIR}/cmake/scripts/common/Macros.cmake)
include(${CORE_SOURCE_DIR}/cmake/scripts/common/Platform.cmake)
core_find_versions()

# in case we need to download something, set KODI_MIRROR to the default if not already set
Expand Down

0 comments on commit 3f0b2e7

Please sign in to comment.