From a0c68eb89a3feebc550e7941d22f852a7be1db5a Mon Sep 17 00:00:00 2001 From: Matt Hoosier Date: Tue, 19 Nov 2019 06:28:07 -0600 Subject: 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 --- CMakeLists.txt | 8 +++++++- README.md | 15 ++++++++------- 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 -- cgit v1.2.3