CMake: Add RPI method. Fixes #1695 Qt: Add bitness define. Fixes #6306

This commit is contained in:
Sacha 2014-06-18 02:48:10 +10:00
parent 5876823478
commit b928ec4717
4 changed files with 28 additions and 9 deletions

View File

@ -12,7 +12,7 @@ if(ANDROID)
endif() endif()
endif() endif()
if (IOS OR BLACKBERRY) if(IOS OR BLACKBERRY)
if (SIMULATOR) if (SIMULATOR)
set(X86 ON) set(X86 ON)
else() else()
@ -22,7 +22,7 @@ if (IOS OR BLACKBERRY)
endif() endif()
endif() endif()
if (MAEMO) if(MAEMO)
set(ARM ON) set(ARM ON)
set(ARMEABI_V7A ON) set(ARMEABI_V7A ON)
#Maemo's gcc-4.7.2 is strict #Maemo's gcc-4.7.2 is strict
@ -40,6 +40,14 @@ else() # Assume x86
set(X86 ON) set(X86 ON)
endif() endif()
include(CheckIncludeFile)
check_include_file(/opt/vc/include/bcm_host.h RPI)
if(RPI)
set(ARM ON)
set(USING_GLES2 ON)
set(MOBILE_DEVICE OFF)
endif()
if(USING_EGL) if(USING_EGL)
# Default to GLES2 but could be GL. # Default to GLES2 but could be GL.
set(USING_GLES2 ON) set(USING_GLES2 ON)
@ -128,6 +136,11 @@ if(USING_GLES2 AND NOT IOS)
elseif(NOT IOS) elseif(NOT IOS)
include(FindOpenGL REQUIRED) include(FindOpenGL REQUIRED)
endif() endif()
if(RPI)
include_directories(/opt/vc/include /opt/vc/include/interface/vcos/pthreads)
link_directories(/opt/vc/lib)
set(OPENGL_LIBRARIES GLESv2 bcm_host)
endif()
if (NOT BLACKBERRY AND NOT ANDROID AND NOT IOS) if (NOT BLACKBERRY AND NOT ANDROID AND NOT IOS)
include(FindSDL) include(FindSDL)
endif() endif()
@ -158,6 +171,9 @@ endif()
if(MAEMO) if(MAEMO)
add_definitions(-DMAEMO) add_definitions(-DMAEMO)
endif() endif()
if(RPI)
add_definitions(-DRPI)
endif()
if(USING_EGL) if(USING_EGL)
add_definitions(-DUSING_EGL) add_definitions(-DUSING_EGL)

View File

@ -7,6 +7,7 @@ CONFIG += staticlib
include(Settings.pri) include(Settings.pri)
INCLUDEPATH += $$P/ $$P/native INCLUDEPATH += $$P/ $$P/native
!contains(DEFINES, USING_GLES2): INCLUDEPATH += $$P/native/ext/glew
win32 { win32 {
SOURCES += $$P/Windows/OpenGLBase.cpp SOURCES += $$P/Windows/OpenGLBase.cpp

View File

@ -6,9 +6,12 @@ CONFIG += staticlib
include(Settings.pri) include(Settings.pri)
INCLUDEPATH += $$P/native
!contains(DEFINES,USING_GLES2) { !contains(DEFINES,USING_GLES2) {
SOURCES += $$P/native/ext/glew/glew.c SOURCES += $$P/native/ext/glew/glew.c
HEADERS += $$P/native/ext/glew/GL/*.h HEADERS += $$P/native/ext/glew/GL/*.h
INCLUDEPATH += $$P/native/ext/glew
} }
# RG_ETC1 # RG_ETC1
@ -141,5 +144,3 @@ HEADERS += $$P/native/audio/*.h \
$$P/native/util/random/*.h \ $$P/native/util/random/*.h \
$$P/native/util/text/utf8.h \ $$P/native/util/text/utf8.h \
$$P/native/util/text/parsers.h $$P/native/util/text/parsers.h
INCLUDEPATH += $$P/native

View File

@ -53,10 +53,7 @@ arm:!symbian {
QMAKE_CXXFLAGS_DEBUG += -march=armv7-a -mtune=cortex-a8 -mfpu=neon -ftree-vectorize -ffast-math QMAKE_CXXFLAGS_DEBUG += -march=armv7-a -mtune=cortex-a8 -mfpu=neon -ftree-vectorize -ffast-math
} }
gleslib = $$find(QT_CONFIG, "opengles") contains(QT_CONFIG, opengles.) {
count(gleslib,0) { # OpenGL
INCLUDEPATH += $$P/native/ext/glew
} else {
DEFINES += USING_GLES2 DEFINES += USING_GLES2
# How else do we know if the environment prefers windows? # How else do we know if the environment prefers windows?
!linux|android|maemo { !linux|android|maemo {
@ -79,11 +76,15 @@ android {
linux:!android { linux:!android {
arm: INCLUDEPATH += $$P/ffmpeg/linux/armv7/include arm: INCLUDEPATH += $$P/ffmpeg/linux/armv7/include
else { else {
contains(QT_ARCH, x86_64): QMAKE_TARGET.arch = x86_64 contains(QT_ARCH, x86_64) QMAKE_TARGET.arch = x86_64
else: QMAKE_TARGET.arch = x86 else: QMAKE_TARGET.arch = x86
INCLUDEPATH += $$P/ffmpeg/linux/$${QMAKE_TARGET.arch}/include INCLUDEPATH += $$P/ffmpeg/linux/$${QMAKE_TARGET.arch}/include
} }
} }
# Fix 32-bit/64-bit defines
contains(QMAKE_TARGET.arch, x86_64): DEFINES += _M_X64
else: DEFINES += _M_IX86
qnx { qnx {
# Use mkspec: unsupported/qws/qnx-armv7-g++ # Use mkspec: unsupported/qws/qnx-armv7-g++
DEFINES += BLACKBERRY "_QNX_SOURCE=1" "_C99=1" DEFINES += BLACKBERRY "_QNX_SOURCE=1" "_C99=1"