Permalink
Browse files

cmake: add an option to enable openCL

Note: nothing work
  • Loading branch information...
1 parent d0b1162 commit c232f90d6e7be76af5e976fdcce41b148eb29f45 @gregory38 gregory38 committed Feb 3, 2017
Showing with 23 additions and 20 deletions.
  1. +1 −0 cmake/BuildParameters.cmake
  2. +11 −20 cmake/CheckLib.cmake
  3. +3 −0 cmake/SearchForStuff.cmake
  4. +8 −0 plugins/GSdx/CMakeLists.txt
@@ -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
@@ -17,34 +17,25 @@ 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)
find_path(${var}_INCLUDE ${_arg_list})
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()
@@ -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)
@@ -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)

0 comments on commit c232f90

Please sign in to comment.