Rename KERNEL_DIR to KERNEL_HEADER_DIR

Renames KERNEL_DIR to KERNEL_HEADER_DIR to allow getting the kernel
headers from a directory that is not coupled with the kernel source
tree.

Change-Id: Ic98b39dd2ec117ef4bc413cb3bf86eee89ebe4fd
Signed-off-by: Iason Paraskevopoulos <iason.paraskevopoulos@arm.com>
This commit is contained in:
Iason Paraskevopoulos 2024-10-30 15:11:52 +00:00
parent cd19e3827b
commit be2fee5043
2 changed files with 9 additions and 9 deletions

View file

@ -104,18 +104,18 @@ if(NOT SELECT_EXTERNAL_ALLOCATOR STREQUAL "none" AND EXTERNAL_WSIALLOC_LIBRARY S
if(SELECT_EXTERNAL_ALLOCATOR STREQUAL "ion") if(SELECT_EXTERNAL_ALLOCATOR STREQUAL "ion")
target_sources(wsialloc PRIVATE util/wsialloc/wsialloc_ion.c util/wsialloc/wsialloc_helpers.c) target_sources(wsialloc PRIVATE util/wsialloc/wsialloc_ion.c util/wsialloc/wsialloc_helpers.c)
target_link_libraries(wsialloc drm_utils) target_link_libraries(wsialloc drm_utils)
if(DEFINED KERNEL_DIR) if(DEFINED KERNEL_HEADER_DIR)
target_include_directories(wsialloc PRIVATE "${KERNEL_DIR}/drivers/staging/android/uapi") target_include_directories(wsialloc PRIVATE "${KERNEL_HEADER_DIR}")
else() else()
message(FATAL_ERROR "KERNEL_DIR must be defined as the root of the Linux kernel source.") message(FATAL_ERROR "KERNEL_HEADER_DIR must be defined as the directory that includes the kernel headers.")
endif() endif()
elseif(SELECT_EXTERNAL_ALLOCATOR STREQUAL "dma_buf_heaps") elseif(SELECT_EXTERNAL_ALLOCATOR STREQUAL "dma_buf_heaps")
target_sources(wsialloc PRIVATE util/wsialloc/wsialloc_dma_buf_heaps.c util/wsialloc/wsialloc_helpers.c) target_sources(wsialloc PRIVATE util/wsialloc/wsialloc_dma_buf_heaps.c util/wsialloc/wsialloc_helpers.c)
target_link_libraries(wsialloc drm_utils) target_link_libraries(wsialloc drm_utils)
if(DEFINED KERNEL_DIR) if(DEFINED KERNEL_HEADER_DIR)
target_include_directories(wsialloc PRIVATE "${KERNEL_DIR}/usr/include") target_include_directories(wsialloc PRIVATE "${KERNEL_HEADER_DIR}")
else() else()
message(FATAL_ERROR "KERNEL_DIR must be defined as the root of the Linux kernel source.") message(FATAL_ERROR "KERNEL_HEADER_DIR must be defined as the directory that includes the kernel headers.")
endif() endif()
add_definitions(-Ulinux -DWSIALLOC_MEMORY_HEAP_NAME=${WSIALLOC_MEMORY_HEAP_NAME}) add_definitions(-Ulinux -DWSIALLOC_MEMORY_HEAP_NAME=${WSIALLOC_MEMORY_HEAP_NAME})
else() else()

View file

@ -90,7 +90,7 @@ make -C build
In order to build with Wayland support the `BUILD_WSI_WAYLAND` build option In order to build with Wayland support the `BUILD_WSI_WAYLAND` build option
must be used, the `SELECT_EXTERNAL_ALLOCATOR` option has to be set to must be used, the `SELECT_EXTERNAL_ALLOCATOR` option has to be set to
a graphics memory allocator (currently only ion and dma_buf_heaps are supported) and a graphics memory allocator (currently only ion and dma_buf_heaps are supported) and
the `KERNEL_DIR` option must be defined as the root of the Linux kernel the `KERNEL_HEADER_DIR` option must be defined as the directory that includes the kernel headers.
source. source.
``` ```
@ -98,7 +98,7 @@ cmake . -DVULKAN_CXX_INCLUDE="path/to/vulkan-header" \
-DBUILD_WSI_HEADLESS=0 \ -DBUILD_WSI_HEADLESS=0 \
-DBUILD_WSI_WAYLAND=1 \ -DBUILD_WSI_WAYLAND=1 \
-DSELECT_EXTERNAL_ALLOCATOR=ion \ -DSELECT_EXTERNAL_ALLOCATOR=ion \
-DKERNEL_DIR="path/to/linux-kernel-source" -DKERNEL_HEADER_DIR="path/to/linux-kernel-headers"
``` ```
In the command line above, `-DBUILD_WSI_HEADLESS=0` is used to disable support In the command line above, `-DBUILD_WSI_HEADLESS=0` is used to disable support
@ -111,7 +111,7 @@ using the `EXTERNAL_WSIALLOC_LIBRARY` option. For example,
cmake . -DVULKAN_CXX_INCLUDE="path/to/vulkan-header" \ cmake . -DVULKAN_CXX_INCLUDE="path/to/vulkan-header" \
-DBUILD_WSI_WAYLAND=1 \ -DBUILD_WSI_WAYLAND=1 \
-DEXTERNAL_WSIALLOC_LIBRARY="path/to/custom/libwsialloc" \ -DEXTERNAL_WSIALLOC_LIBRARY="path/to/custom/libwsialloc" \
-DKERNEL_DIR="path/to/linux-kernel-source" -DKERNEL_HEADER_DIR="path/to/linux-kernel-headers"
``` ```
The `EXTERNAL_WSIALLOC_LIBRARY` option allows to specify the path to a library The `EXTERNAL_WSIALLOC_LIBRARY` option allows to specify the path to a library