aboutsummaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
authorLukas Rusak <lorusak@gmail.com>2018-02-17 10:54:47 -0800
committerLukas Rusak <lorusak@gmail.com>2018-06-22 11:19:12 -0700
commite1d7eeedbea882086ccffa546fe6fac59c15ad1a (patch)
treed40a5c55a6449b8fdaf59d5cc171bc1be16121f5 /cmake
parentaf0064213e375beb6f1a4cc1a13a86e47dbdb906 (diff)
utils: add class CGBMBufferObject
Diffstat (limited to 'cmake')
-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}"