summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Hoosier <matt.hoosier@garmin.com>2019-11-19 06:28:07 -0600
committerMatt Hoosier <matt.hoosier@garmin.com>2019-11-20 08:29:53 -0600
commita0c68eb89a3feebc550e7941d22f852a7be1db5a (patch)
tree5b3d1c6f0bb3c0342c49bb3a477e5e53360459de
parent1132d14177277b4e20cb7e23653e252ff85b9845 (diff)
Add configure-time option to disable libdrm-omap usage
Add an build option to allow explicitly shutting off libdrm-omap features. This is useful for packaging situations to prevent accidental unexpected features. To deactivate the drm-omap specific functionality that was activated unconditionally if present until now, use: cmake -DKMSXX_ENABLE_LIBDRMOMAP=OFF Signed-off-by: Matt Hoosier <matt.hoosier@garmin.com>
-rw-r--r--CMakeLists.txt8
-rw-r--r--README.md15
2 files changed, 15 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3f0084c..9e2f492 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -26,6 +26,7 @@ set(KMSXX_PYTHON_VERSION "python3;python2" CACHE STRING "Python pkgconfig packag
set(KMSXX_ENABLE_KMSCUBE OFF CACHE BOOL "Enable kmscube")
set(KMSXX_ENABLE_THREADING ON CACHE BOOL "Enable threading for parallelized drawing")
+set(KMSXX_ENABLE_LIBDRMOMAP ON CACHE BOOL "Enable OMAP-specific extensions")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 -Wall")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wextra -Wno-unused-parameter")
@@ -68,7 +69,12 @@ endif()
find_package(PkgConfig REQUIRED)
pkg_check_modules(LIBDRM libdrm>=2.4.71 REQUIRED)
-pkg_check_modules(LIBDRM_OMAP libdrm_omap)
+if (KMSXX_ENABLE_LIBDRMOMAP)
+ pkg_check_modules(LIBDRM_OMAP libdrm_omap)
+else()
+ set(LIBDRM_OMAP_FOUND FALSE)
+endif()
+
if(LIBDRM_OMAP_FOUND)
add_definitions(-DHAS_LIBDRM_OMAP)
endif()
diff --git a/README.md b/README.md
index feb43d7..4e402f8 100644
--- a/README.md
+++ b/README.md
@@ -72,13 +72,14 @@ SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
You can use the following cmake flags to control the build. Use `-DFLAG=VALUE` to set them.
-Option name | Values | Default | Notes
---------------------- | ------------- | --------------- | --------
-CMAKE_BUILD_TYPE | Release/Debug | Release |
-BUILD_SHARED_LIBS | ON/OFF | OFF |
-KMSXX_ENABLE_PYTHON | ON/OFF | ON |
-KMSXX_ENABLE_KMSCUBE | ON/OFF | OFF |
-KMSXX_PYTHON_VERSION | python3/python2 | python3;python2 | Name of the python pkgconfig file
+Option name | Values | Default | Notes
+------------------------ | ------------- | --------------- | --------
+CMAKE_BUILD_TYPE | Release/Debug | Release |
+BUILD_SHARED_LIBS | ON/OFF | OFF |
+KMSXX_ENABLE_PYTHON | ON/OFF | ON |
+KMSXX_ENABLE_KMSCUBE | ON/OFF | OFF |
+KMSXX_ENABLE_LIBDRMOMAP | ON/OFF | OFF |
+KMSXX_PYTHON_VERSION | python3/python2 | python3;python2 | Name of the python pkgconfig file
## Env variables