Permalink
Browse files

Merge pull request #11185 from hissingshark/vero4k-patch

Added Vulkan disable and forced CPU detection options
  • Loading branch information...
hrydgard committed Jun 27, 2018
2 parents fb9524b + 90fbbab commit 5abf324da97597d386255ff5dd6b082c19fb1964
Showing with 34 additions and 1 deletion.
  1. +12 −1 CMakeLists.txt
  2. +22 −0 cmake/Toolchains/vero4k.armv8.cmake
@@ -19,6 +19,11 @@ if(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
message("Clang enabled")
endif()
if(FORCED_CPU)
message("Detected CPU (${CMAKE_SYSTEM_PROCESSOR}) overridden as: ${FORCED_CPU}")
set(CMAKE_SYSTEM_PROCESSOR ${FORCED_CPU})
endif()
# Detect CPU from CMAKE configuration. Toolchains should set this up
if(CMAKE_SYSTEM_PROCESSOR)
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^arm")
@@ -109,6 +114,7 @@ option(USING_EGL "Set to ON if target environment uses EGL" ${USING_EGL})
option(USING_FBDEV "Set to ON if target environment uses fbdev (eg. Pandora)" ${USING_FBDEV})
option(USING_GLES2 "Set to ON if target device uses OpenGL ES 2.0" ${USING_GLES2})
option(RASPBIAN "Set to ON to workaround threading issues when building for ARMV7 on Raspbian" ${RASPBIAN})
option(USING_X11_VULKAN "Set to OFF if target environment doesn't use X11 for Vulkan" ON)
# :: Frontends
option(USING_QT_UI "Set to ON if you wish to use the Qt frontend wrapper" ${USING_QT_UI})
option(MOBILE_DEVICE "Set to ON when targeting a mobile device" ${MOBILE_DEVICE})
@@ -124,7 +130,12 @@ option(USE_WAYLAND_WSI "Set to ON to require Wayland support for Vulkan" ${USE_W
option(USE_ADDRESS_SANITIZER "Use Clang memory sanitizer" ${USE_ADDRESS_SANITIZER})
if(UNIX AND NOT (APPLE OR ANDROID) AND VULKAN)
add_definitions(-DVK_USE_PLATFORM_XLIB_KHR)
if(USING_X11_VULKAN)
message("Using X11 for Vulkan")
add_definitions(-DVK_USE_PLATFORM_XLIB_KHR)
else()
message("NOT using X11 for Vulkan")
endif()
# add_definitions(-DVK_USE_PLATFORM_XCB_KHR)
find_package(Wayland)
if (USE_WAYLAND_WSI AND NOT WAYLAND_FOUND)
@@ -0,0 +1,22 @@
include_directories(SYSTEM
/opt/vero3/include
/opt/vero3/include/EGL
/opt/vero3/include/GLES2
)
set(ARCH_FLAGS "-march=armv8-a+crc -mtune=cortex-a53 -mfloat-abi=hard -funsafe-math-optimizations")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ARCH_FLAGS}" CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARCH_FLAGS}" CACHE STRING "" FORCE)
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} ${ARCH_FLAGS}" CACHE STRING "" FORCE)
set(CMAKE_EXE_LINKER_FLAGS "-L/opt/vero3/lib" CACHE STRING "" FORCE)
set(OPENGL_LIBRARIES /opt/vero3/lib/libGLESv2.so)
set(EGL_LIBRARIES /opt/vero3/lib/libEGL.so)
set(USING_GLES2 ON)
set(USING_EGL ON)
set(USING_FBDEV ON)
set(ARMV7 ON)
set(FORCED_CPU armv7)
set(USING_X11_VULKAN OFF CACHE BOOL "" FORCE)

0 comments on commit 5abf324

Please sign in to comment.