async-iso:

* add cmake plumbing for libaio
* add Native EOL style on cmake file


git-svn-id: http://pcsx2.googlecode.com/svn/branches/async-iso@5479 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
gregory.hainaut 2012-12-13 16:11:53 +00:00
parent 038dbd8401
commit db1cd9a5c5
4 changed files with 38 additions and 20 deletions

27
cmake/FindAio.cmake Normal file
View File

@ -0,0 +1,27 @@
# Try to find AIO
# Once done, this will define
#
# AIO_FOUND - system has AIO
# AIO_INCLUDE_DIR - the AIO include directories
# AIO_LIBRARIES - link these to use AIO
if(AIO_INCLUDE_DIR AND AIO_LIBRARIES)
set(AIO_FIND_QUIETLY TRUE)
endif(AIO_INCLUDE_DIR AND AIO_LIBRARIES)
INCLUDE(CheckCXXSymbolExists)
# include dir
find_path(AIO_INCLUDE_DIR libaio.h)
# finally the library itself
find_library(LIBAIO NAMES aio)
set(AIO_LIBRARIES ${LIBAIO})
# handle the QUIETLY and REQUIRED arguments and set AIO_FOUND to TRUE if
# all listed variables are TRUE
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(AIO DEFAULT_MSG AIO_LIBRARIES AIO_INCLUDE_DIR)
mark_as_advanced(AIO_LIBRARIES AIO_INCLUDE_DIR)

View File

@ -47,6 +47,7 @@ if (EGL_API)
endif()
## Use pcsx2 package to find module
include(FindAio)
## Include cg because of zzogl-cg and zerogs
#if(NOT GLSL_API)
include(FindCg)
@ -73,68 +74,59 @@ include(FindSparseHash_NEW)
# Use system include (if not 3rdparty one)
#----------------------------------------
if(Linux)
# GTK2
if(GTK2_FOUND)
include_directories(${GTK2_INCLUDE_DIRS})
endif(GTK2_FOUND)
# x11
if(X11_FOUND)
include_directories(${X11_INCLUDE_DIR})
endif(X11_FOUND)
endif(Linux)
# ALSA
if(AIO_FOUND)
include_directories(${AIO_INCLUDE_DIR})
endif()
if(ALSA_FOUND)
include_directories(${ALSA_INCLUDE_DIRS})
endif(ALSA_FOUND)
# bzip2
if(BZIP2_FOUND)
include_directories(${BZIP2_INCLUDE_DIR})
endif(BZIP2_FOUND)
# Cg
if(CG_FOUND)
include_directories(${CG_INCLUDE_DIRS})
endif(CG_FOUND)
# EGL
if (EGL_FOUND)
include_directories(${EGL_INCLUDE_DIR})
endif()
# Jpeg
if(JPEG_FOUND)
include_directories(${JPEG_INCLUDE_DIR})
endif(JPEG_FOUND)
# GLEW
if(GLEW_FOUND)
include_directories(${GLEW_INCLUDE_DIR})
endif(GLEW_FOUND)
# OpenGL
if(OPENGL_FOUND)
include_directories(${OPENGL_INCLUDE_DIR})
endif(OPENGL_FOUND)
# PortAudio
if(PORTAUDIO_FOUND)
include_directories(${PORTAUDIO_INCLUDE_DIR})
endif(PORTAUDIO_FOUND)
# SDL
if(SDL_FOUND)
include_directories(${SDL_INCLUDE_DIR})
endif(SDL_FOUND)
# SoundTouch
if(SOUNDTOUCH_FOUND)
include_directories(${SOUNDTOUCH_INCLUDE_DIR})
endif(SOUNDTOUCH_FOUND)
# SPARSEHASH
if(SPARSEHASH_FOUND)
include_directories(${SPARSEHASH_INCLUDE_DIR})
endif(SPARSEHASH_FOUND)
@ -144,7 +136,6 @@ if(SPARSEHASH_NEW_FOUND)
set(SPARSEHASH_FOUND TRUE)
endif(SPARSEHASH_NEW_FOUND)
# Wx
if(wxWidgets_FOUND)
if(Linux)
# Force the use of 32 bit library configuration on
@ -170,7 +161,6 @@ if(wxWidgets_FOUND)
include(${wxWidgets_USE_FILE})
endif(wxWidgets_FOUND)
# Zlib
if(ZLIB_FOUND)
include_directories(${ZLIB_INCLUDE_DIRS})
endif(ZLIB_FOUND)

View File

@ -43,23 +43,24 @@ endif(wxWidgets_FOUND AND SPARSEHASH_FOUND)
# -gtk2 (linux)
# -zlib
# -common_libs
# -aio
#---------------------------------------
# Common dependancy
if(wxWidgets_FOUND AND ZLIB_FOUND AND common_libs)
if(wxWidgets_FOUND AND ZLIB_FOUND AND common_libs AND AIO_FOUND)
set(pcsx2_core TRUE)
elseif(NOT EXISTS "${PROJECT_SOURCE_DIR}/pcsx2")
set(pcsx2_core FALSE)
else(wxWidgets_FOUND AND ZLIB_FOUND AND common_libs)
else()
set(pcsx2_core FALSE)
message(STATUS "Skip build of pcsx2 core: miss some dependencies")
message(STATUS "${msg_dep_pcsx2}")
endif(wxWidgets_FOUND AND ZLIB_FOUND AND common_libs)
endif()
# Linux need also gtk2
if(Linux AND pcsx2_core AND NOT GTK2_FOUND)
set(pcsx2_core FALSE)
message(STATUS "Skip build of pcsx2 core: miss some dependencies")
message(STATUS "${msg_dep_pcsx2}")
endif(Linux AND pcsx2_core AND NOT GTK2_FOUND)
endif()
#-------------------------------------------------------------------------------

View File

@ -694,7 +694,7 @@ endif(Linux)
# link target with zlib
target_link_libraries(${Output} ${ZLIB_LIBRARIES})
target_link_libraries(${Output} "aio")
target_link_libraries(${Output} ${AIO_LIBRARIES})
# User flags options
if(NOT USER_CMAKE_LD_FLAGS STREQUAL "")