cmake: add an option to enable openCL

Note: nothing work
This commit is contained in:
Gregory Hainaut 2017-02-03 23:30:25 +01:00
parent d0b1162b15
commit c232f90d6e
4 changed files with 23 additions and 20 deletions

View File

@ -35,6 +35,7 @@ option(USE_VTUNE "Plug VTUNE to profile GSdx JIT.")
#-------------------------------------------------------------------------------
option(GLSL_API "Replace ZZogl CG backend by GLSL (experimental option)")
option(EGL_API "Use EGL on ZZogl/GSdx (experimental/developer option)")
option(OPENCL_API "Add OpenCL suppport on GSdx")
option(REBUILD_SHADER "Rebuild GLSL/CG shader (developer option)")
option(BUILD_REPLAY_LOADERS "Build GS replayer to ease testing (developer option)")
option(GSDX_LEGACY "Build a GSdx legacy plugin compatible with GL3.3")

View File

@ -17,7 +17,7 @@ macro(check_lib var lib)
# Make sure include directories for headers found using find_path below
# are re-added when reconfiguring
include_directories(${${var}_INCLUDE})
_internal_message("-- ${var} found")
_internal_message("-- ${var} found pkg")
else()
find_library(${var}_LIBRARIES ${lib})
if(_arg_list)
@ -25,26 +25,17 @@ macro(check_lib var lib)
else()
set(${var}_INCLUDE FALSE)
endif()
if (${lib})
if(${var}_LIBRARIES AND ${var}_INCLUDE)
include_directories(${${var}_INCLUDE})
_internal_message("-- ${var} found")
set(${var}_FOUND 1 CACHE INTERNAL "")
elseif(${var}_LIBRARIES)
_internal_message("-- ${var} not found (miss include)")
elseif(${var}_INCLUDE)
_internal_message("-- ${var} not found (miss lib)")
else()
_internal_message("-- ${var} not found")
endif()
if(${var}_LIBRARIES AND ${var}_INCLUDE)
include_directories(${${var}_INCLUDE})
_internal_message("-- ${var} found")
set(${var}_FOUND 1 CACHE INTERNAL "")
elseif(${var}_LIBRARIES)
_internal_message("-- ${var} not found (miss include)")
elseif(${var}_INCLUDE)
_internal_message("-- ${var} not found (miss lib)")
else()
if(${var}_INCLUDE)
include_directories(${${var}_INCLUDE})
_internal_message("-- ${var} found")
set(${var}_FOUND 1 CACHE INTERNAL "")
else()
_internal_message("-- ${var} not found")
endif()
_internal_message("-- ${var} not found")
endif()
endif()
endmacro()

View File

@ -92,6 +92,9 @@ endif()
if(EGL_API)
check_lib(EGL EGL EGL/egl.h)
endif()
if(OPENCL_API)
check_lib(OPENCL OpenCL CL/cl.hpp)
endif()
check_lib(PORTAUDIO portaudio portaudio.h pa_linux_alsa.h)
check_lib(SOUNDTOUCH SoundTouch soundtouch/SoundTouch.h)

View File

@ -39,6 +39,10 @@ if(NOT USE_CLANG)
set(GSdxFinalFlags ${GSdxFinalFlags} -fabi-version=6)
endif()
if(OPENCL_API)
set(GSdxFinalFlags ${GSdxFinalFlags} -DENABLE_OPENCL)
endif()
set(GSdxSources
GLLoader.cpp
GLState.cpp
@ -210,6 +214,10 @@ if(USE_VTUNE)
set(GSdxFinalLibs ${GSdxFinalLibs} ${VTUNE_LIBRARIES})
endif()
if(OPENCL_FOUND)
set(GSdxFinalLibs ${GSdxFinalLibs} ${OPENCL_LIBRARIES})
endif()
# Generate Glsl header file. Protect with REBUILD_SHADER to avoid build-dependency on PERL
if (REBUILD_SHADER)
add_custom_command(OUTPUT res/glsl_source.h COMMAND perl ${CMAKE_SOURCE_DIR}/linux_various/glsl2h.pl)