Skip to content

Commit

Permalink
CMake: Cleanup more names.
Browse files Browse the repository at this point in the history
  • Loading branch information
xsacha committed Jun 18, 2014
1 parent 46abce7 commit 12e091b
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 37 deletions.
69 changes: 33 additions & 36 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,45 +5,29 @@ enable_language(ASM)

add_definitions(-DPPSSPP)

# Detect CPU from CMAKE configuration. Toolchains should set this up
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^arm")
set(ARM ON)
endif()

if(ANDROID)
if(ARMEABI OR ARMEABI_V7A)
set(USE_FFMPEG ON)
endif()
endif()

if(IOS OR BLACKBERRY)
if (NOT SIMULATOR)
set(ARMEABI_V7A ON)
set(USE_FFMPEG ON)
endif()
endif()

if(MAEMO)
set(ARMEABI_V7A ON)
#Maemo's gcc-4.7.2 is strict
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")
if(${CMAKE_SYSTEM_PROCESSOR} MATCHES "^armv7")
set(ARMV7 ON)
endif()

if(LOONGSON)
set(MIPS ON) # MIPS + x86 for now
endif()
# Remove soon?
set(USE_FFMPEG ON)

if(ARM OR SIMULATOR)
set(USING_EGL ON)
set(MOBILE_DEVICE ON)
else() # Assume x86
endif()
if (NOT ARM) # 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()

Expand All @@ -55,17 +39,13 @@ endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(LINUX ON)
add_definitions(-D__STDC_CONSTANT_MACROS)
if (NOT MOBILE_DEVICE)
set(USE_FFMPEG ON)
endif()
endif()

if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(MACOSX ON)
set(USE_FFMPEG ON)
endif()

if (NOT ARM AND NOT MIPS)
if (X86 AND NOT MIPS)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
add_definitions(-D_M_X64)
else()
Expand All @@ -84,6 +64,7 @@ endif()

# User-editable options (go into CMakeCache.txt)
# :: Processors
option(ARMV7 "Set to ON if targeting an ARMv7 processor" ${ARMV7})
option(ARM "Set to ON if targeting an ARM processor" ${ARM})
option(MIPS "Set to ON if targeting a MIPS processor" ${MIPS})
option(X86 "Set to ON if targeting an X86 processor" ${X86})
Expand Down Expand Up @@ -121,6 +102,16 @@ if(ANDROID OR BLACKBERRY OR IOS)
endif()
endif()

if(ARMV7)
message("Building for ARMv7")
elseif(ARM)
message("Building for ARMv6")
elseif(MIPS)
message("Building for MIPS in x86 mode")
else()
message("Building for x86")
endif()

if(ANDROID)
set(CoreLibName ppsspp_jni)
set(CoreLinkType SHARED)
Expand All @@ -130,20 +121,26 @@ else()
endif()

#find_package(Qt5Widgets)
if(USING_GLES2 AND NOT IOS)
set(OPENGL_LIBRARIES GLESv2)
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)
elseif(USING_GLES2 AND NOT IOS)
set(OPENGL_LIBRARIES GLESv2)
elseif(NOT IOS)
include(FindOpenGL REQUIRED)
endif()

if(MAEMO)
#Maemo's gcc-4.7.2 is strict
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")
endif()

if (NOT BLACKBERRY AND NOT ANDROID AND NOT IOS)
include(FindSDL)
endif()
include(FindThreads)

if(APPLE)
find_library(COCOA_LIBRARY Cocoa)
endif()
Expand Down Expand Up @@ -454,7 +451,7 @@ if(USE_FFMPEG)
)
endif()

if(IOS OR BLACKBERRY OR MACOSX)
if(APPLE OR BLACKBERRY)
set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} iconv)
endif()

Expand Down Expand Up @@ -658,7 +655,7 @@ endif()
set(nativeExtra)
set(nativeExtraLibs)

if(ARMEABI_V7A)
if(ARMV7)
set(nativeExtra ${nativeExtra}
native/math/fast/fast_matrix_neon.S)
endif()
Expand Down Expand Up @@ -1253,7 +1250,7 @@ set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/git-version.cpp
PROPERTIES GENERATED TRUE)
add_dependencies(${CoreLibName} GitVersion)

if(ARMEABI_V7A)
if(ARMV7)
set(GPU_NEON GPU/Common/TextureDecoderNEON.cpp)
endif()
add_library(GPU OBJECT
Expand Down
2 changes: 1 addition & 1 deletion native
Submodule native updated 1 files
+34 −0 image/png_load.cpp

0 comments on commit 12e091b

Please sign in to comment.