diff --git a/CMakeLists.txt b/CMakeLists.txt index 8031c141f5..b76aa80551 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,7 @@ if(ANDROID) endif() endif() -if (IOS OR BLACKBERRY) +if(IOS OR BLACKBERRY) if (SIMULATOR) set(X86 ON) else() @@ -22,7 +22,7 @@ if (IOS OR BLACKBERRY) endif() endif() -if (MAEMO) +if(MAEMO) set(ARM ON) set(ARMEABI_V7A ON) #Maemo's gcc-4.7.2 is strict @@ -40,6 +40,14 @@ else() # Assume x86 set(X86 ON) 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) # Default to GLES2 but could be GL. set(USING_GLES2 ON) @@ -128,6 +136,11 @@ if(USING_GLES2 AND NOT IOS) elseif(NOT IOS) include(FindOpenGL REQUIRED) 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) include(FindSDL) endif() @@ -158,6 +171,9 @@ endif() if(MAEMO) add_definitions(-DMAEMO) endif() +if(RPI) + add_definitions(-DRPI) +endif() if(USING_EGL) add_definitions(-DUSING_EGL) diff --git a/Qt/GPU.pro b/Qt/GPU.pro index 376bc2f8ad..39a9cf6c36 100644 --- a/Qt/GPU.pro +++ b/Qt/GPU.pro @@ -7,6 +7,7 @@ CONFIG += staticlib include(Settings.pri) INCLUDEPATH += $$P/ $$P/native +!contains(DEFINES, USING_GLES2): INCLUDEPATH += $$P/native/ext/glew win32 { SOURCES += $$P/Windows/OpenGLBase.cpp diff --git a/Qt/Native.pro b/Qt/Native.pro index 8cadce03a3..a32580e7ed 100644 --- a/Qt/Native.pro +++ b/Qt/Native.pro @@ -6,9 +6,12 @@ CONFIG += staticlib include(Settings.pri) +INCLUDEPATH += $$P/native + !contains(DEFINES,USING_GLES2) { SOURCES += $$P/native/ext/glew/glew.c HEADERS += $$P/native/ext/glew/GL/*.h + INCLUDEPATH += $$P/native/ext/glew } # RG_ETC1 @@ -141,5 +144,3 @@ HEADERS += $$P/native/audio/*.h \ $$P/native/util/random/*.h \ $$P/native/util/text/utf8.h \ $$P/native/util/text/parsers.h - -INCLUDEPATH += $$P/native diff --git a/Qt/Settings.pri b/Qt/Settings.pri index 27f145b37e..b29b424c88 100644 --- a/Qt/Settings.pri +++ b/Qt/Settings.pri @@ -53,10 +53,7 @@ arm:!symbian { QMAKE_CXXFLAGS_DEBUG += -march=armv7-a -mtune=cortex-a8 -mfpu=neon -ftree-vectorize -ffast-math } -gleslib = $$find(QT_CONFIG, "opengles") -count(gleslib,0) { # OpenGL - INCLUDEPATH += $$P/native/ext/glew -} else { +contains(QT_CONFIG, opengles.) { DEFINES += USING_GLES2 # How else do we know if the environment prefers windows? !linux|android|maemo { @@ -79,11 +76,15 @@ android { linux:!android { arm: INCLUDEPATH += $$P/ffmpeg/linux/armv7/include 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 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 { # Use mkspec: unsupported/qws/qnx-armv7-g++ DEFINES += BLACKBERRY "_QNX_SOURCE=1" "_C99=1"