diff --git a/cmake/BuildParameters.cmake b/cmake/BuildParameters.cmake index 88db4daf92..6ba47f6f9f 100644 --- a/cmake/BuildParameters.cmake +++ b/cmake/BuildParameters.cmake @@ -80,7 +80,11 @@ include(TargetArch) target_architecture(PCSX2_TARGET_ARCHITECTURES) if(${PCSX2_TARGET_ARCHITECTURES} MATCHES "x86_64" OR ${PCSX2_TARGET_ARCHITECTURES} MATCHES "i386") if(${PCSX2_TARGET_ARCHITECTURES} MATCHES "x86_64" AND (CMAKE_BUILD_TYPE MATCHES "Release" OR PACKAGE_MODE)) - message(FATAL_ERROR "The code for ${PCSX2_TARGET_ARCHITECTURES} support is not ready yet.") + message(FATAL_ERROR " + The code for ${PCSX2_TARGET_ARCHITECTURES} support is not ready yet. + For now compile with -DCMAKE_TOOLCHAIN_FILE=cmake/linux-compiler-i386-multilib.cmake + or with + --cross-multilib passed to build.sh") endif() message(STATUS "Compiling a ${PCSX2_TARGET_ARCHITECTURES} build on a ${CMAKE_HOST_SYSTEM_PROCESSOR} host.") else() diff --git a/cmake/Pcsx2Utils.cmake b/cmake/Pcsx2Utils.cmake index f0557b2cd4..00dc841d57 100644 --- a/cmake/Pcsx2Utils.cmake +++ b/cmake/Pcsx2Utils.cmake @@ -7,42 +7,34 @@ # On linux, it also set a flag for specific distribution (ie Fedora) #------------------------------------------------------------------------------- function(detectOperatingSystem) - # nothing detected yet - set(MacOSX FALSE PARENT_SCOPE) - set(Windows FALSE PARENT_SCOPE) - set(Linux FALSE PARENT_SCOPE) - set(Fedora FALSE PARENT_SCOPE) - - # check if we are on Linux - if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") - set(Linux TRUE PARENT_SCOPE) - - if (EXISTS /etc/os-release) - # Read the file without CR character - file(STRINGS /etc/os-release OS_RELEASE) - if ("${OS_RELEASE}" MATCHES "^.*ID=fedora.*$") - set(Fedora TRUE PARENT_SCOPE) - message(STATUS "Build Fedora specific") - endif() - if ("${OS_RELEASE}" MATCHES "^.*ID=.*suse.*$") - set(openSUSE TRUE PARENT_SCOPE) - add_definitions(-DopenSUSE) - message(STATUS "Build openSUSE specific") - endif() - endif() - endif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") - - # check if we are on MacOSX - if(APPLE) - message(WARNING "Mac OS X isn't supported, build will most likely fail") - set(MacOSX TRUE PARENT_SCOPE) - endif(APPLE) - - # check if we are on Windows - if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") + if(WIN32) set(Windows TRUE PARENT_SCOPE) - endif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") -endfunction(detectOperatingSystem) + elseif(UNIX AND APPLE) + # No easy way to filter out iOS. + message(WARNING "OS X/iOS isn't supported, the build will most likely fail") + set(MacOSX TRUE PARENT_SCOPE) + elseif(UNIX) + if(CMAKE_SYSTEM_NAME MATCHES "Linux") + set(Linux TRUE PARENT_SCOPE) + if (EXISTS /etc/os-release) + # Read the file without CR character + file(STRINGS /etc/os-release OS_RELEASE) + if("${OS_RELEASE}" MATCHES "^.*ID=fedora.*$") + set(Fedora TRUE PARENT_SCOPE) + message(STATUS "Build Fedora specific") + elseif("${OS_RELEASE}" MATCHES "^.*ID=.*suse.*$") + set(openSUSE TRUE PARENT_SCOPE) + add_definitions(-DopenSUSE) + message(STATUS "Build openSUSE specific") + endif() + endif() + elseif(CMAKE_SYSTEM_NAME MATCHES "kFreeBSD") + set(kFreeBSD TRUE PARENT_SCOPE) + elseif(CMAKE_SYSTEM_NAME STREQUAL "GNU") + set(GNU TRUE PARENT_SCOPE) + endif() + endif() +endfunction() function(write_svnrev_h) find_package(Git) diff --git a/cmake/SearchForStuff.cmake b/cmake/SearchForStuff.cmake index 0e950c0799..9b3cfd37bd 100644 --- a/cmake/SearchForStuff.cmake +++ b/cmake/SearchForStuff.cmake @@ -32,7 +32,9 @@ include(FindLibc) ## Use CheckLib package to find module include(CheckLib) -check_lib(AIO aio aio.h) +if(Linux) + check_lib(AIO aio libaio.h) +endif() check_lib(EGL EGL EGL/egl.h) check_lib(GLESV2 GLESv2 GLES3/gl3ext.h) # NOTE: looking for GLESv3, not GLESv2 check_lib(PORTAUDIO portaudio portaudio.h pa_linux_alsa.h) @@ -46,7 +48,7 @@ else() find_package(SDL) endif() -if (Linux) +if(UNIX) find_package(X11) # Most plugins (if not all) and PCSX2 core need gtk2, so set the required flags if (GTK3_API) @@ -63,7 +65,7 @@ endif() #---------------------------------------- # Use system include #---------------------------------------- -if(Linux) +if(UNIX) if(GTK2_FOUND) include_directories(${GTK2_INCLUDE_DIRS}) elseif(GTK3_FOUND) diff --git a/cmake/SelectPcsx2Plugins.cmake b/cmake/SelectPcsx2Plugins.cmake index 70cfc63a0c..b4f7f11af5 100644 --- a/cmake/SelectPcsx2Plugins.cmake +++ b/cmake/SelectPcsx2Plugins.cmake @@ -56,7 +56,7 @@ endif() # -aio #--------------------------------------- # Common dependancy -if(wxWidgets_FOUND AND ZLIB_FOUND AND common_libs AND AIO_FOUND) +if(wxWidgets_FOUND AND ZLIB_FOUND AND common_libs AND NOT (Linux AND NOT AIO_FOUND)) set(pcsx2_core TRUE) elseif(NOT EXISTS "${CMAKE_SOURCE_DIR}/pcsx2") set(pcsx2_core FALSE) @@ -66,7 +66,7 @@ else() message(STATUS "${msg_dep_pcsx2}") endif() # Linux need also gtk2 -if(Linux AND pcsx2_core AND NOT GTKn_FOUND) +if(UNIX AND pcsx2_core AND NOT GTKn_FOUND) set(pcsx2_core FALSE) message(STATUS "Skip build of pcsx2 core: miss some dependencies") message(STATUS "${msg_dep_pcsx2}") diff --git a/plugins/zerogs/CMakeLists.txt b/plugins/zerogs/CMakeLists.txt index 1afb1cfa8e..983441e079 100644 --- a/plugins/zerogs/CMakeLists.txt +++ b/plugins/zerogs/CMakeLists.txt @@ -4,4 +4,4 @@ # zerogs plugin opengl if(UNIX) add_subdirectory(opengl) -endif(UNIX) +endif()