aboutsummaryrefslogtreecommitdiff
path: root/cmake/modules
diff options
context:
space:
mode:
authorGarrett Brown <themagnificentmrb@gmail.com>2018-06-22 13:01:10 -0700
committerGitHub <noreply@github.com>2018-06-22 13:01:10 -0700
commit83c0d4aa3430997b6b9ae0373b0f64a9643c5e10 (patch)
treee8c5db10a937128e16b8eaaf0f81b001e237b810 /cmake/modules
parent37d0c49749a33dfde7359dec30704fbd13d906e5 (diff)
parentdfde36b394c1c9622553f84ab987f6f5de2ab34b (diff)
Merge pull request #14079 from lrusak/opengl-egl
[RetroPlayer][Linux] add RPRendererGBM
Diffstat (limited to 'cmake/modules')
-rw-r--r--cmake/modules/FindGBM.cmake15
1 files changed, 14 insertions, 1 deletions
diff --git a/cmake/modules/FindGBM.cmake b/cmake/modules/FindGBM.cmake
index 1e4436d8cd..18df89e1a4 100644
--- a/cmake/modules/FindGBM.cmake
+++ b/cmake/modules/FindGBM.cmake
@@ -29,11 +29,24 @@ find_package_handle_standard_args(GBM
REQUIRED_VARS GBM_LIBRARY GBM_INCLUDE_DIR
VERSION_VAR GBM_VERSION)
+include(CheckCSourceCompiles)
+set(CMAKE_REQUIRED_LIBRARIES ${GBM_LIBRARY})
+check_c_source_compiles("#include <gbm.h>
+
+ int main()
+ {
+ gbm_bo_map(NULL, 0, 0, 0, 0, GBM_BO_TRANSFER_WRITE, NULL, NULL);
+ }
+ " GBM_HAS_BO_MAP)
+
if(GBM_FOUND)
set(GBM_LIBRARIES ${GBM_LIBRARY})
set(GBM_INCLUDE_DIRS ${GBM_INCLUDE_DIR})
set(GBM_DEFINITIONS -DHAVE_GBM=1)
- if(NOT TARGET GBM::GBM)
+ if(GBM_HAS_BO_MAP)
+ list(APPEND GBM_DEFINITIONS -DHAS_GBM_BO_MAP=1)
+ endif()
+ if(NOT TARGET GBM::GBM)
add_library(GBM::GBM UNKNOWN IMPORTED)
set_target_properties(GBM::GBM PROPERTIES
IMPORTED_LOCATION "${GBM_LIBRARY}"