From 89542ab068987f24b806abf2ba0f68ed030c03b5 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Mon, 7 Sep 2020 09:04:58 +0300 Subject: Update README for meson build --- README.md | 64 +++++++++++++++++++++++++++++---------------------------------- 1 file changed, 29 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 4e011a3..9e465ed 100644 --- a/README.md +++ b/README.md @@ -30,56 +30,51 @@ git submodule update --init And to compile: ``` -$ mkdir build -$ cd build -$ cmake .. -$ make -j4 +meson build +ninja -C build ``` ## Cross compiling instructions: -Directions for cross compiling depend on your environment. - -These are for mine with buildroot: - ``` -$ mkdir build -$ cd build -$ cmake -DCMAKE_TOOLCHAIN_FILE=/output/host/usr/share/buildroot/toolchainfile.cmake .. -$ make -j4 +meson build --cross-file= +ninja -C build ``` -Your environment may provide similar toolchainfile. If not, you can create a toolchainfile of your own, something along these lines: +Here is my cross file for arm32 (where ${BROOT} is path to my buildroot output dir): ``` -SET(CMAKE_SYSTEM_NAME Linux) - -SET(BROOT "/output/") +[binaries] +c = ['ccache', '${BROOT}/host/bin/arm-buildroot-linux-gnueabihf-gcc'] +cpp = ['ccache', '${BROOT}/host/bin/arm-buildroot-linux-gnueabihf-g++'] +ar = '${BROOT}/host/bin/arm-buildroot-linux-gnueabihf-ar' +strip = '${BROOT}/host/bin/arm-buildroot-linux-gnueabihf-strip' +pkgconfig = '${BROOT}/host/bin/pkg-config' + +[host_machine] +system = 'linux' +cpu_family = 'arm' +cpu = 'arm' +endian = 'little' +``` -# specify the cross compiler -SET(CMAKE_C_COMPILER ${BROOT}/host/usr/bin/arm-buildroot-linux-gnueabihf-gcc) -SET(CMAKE_CXX_COMPILER ${BROOT}/host/usr/bin/arm-buildroot-linux-gnueabihf-g++) +## Build options -# where is the target environment -SET(CMAKE_FIND_ROOT_PATH ${BROOT}/target ${BROOT}/host) +You can use meson options to configure the build. E.g. -SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM ONLY) -SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) -SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +``` +meson build -Dbuildtype=debug -Dkmscube=true ``` -## Build options +Use `meson configure build` to see all the configuration options and their current values. -You can use the following cmake flags to control the build. Use `-DFLAG=VALUE` to set them. +kms++ specific build options are: -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 | python3 | Name of the python pkgconfig file +Option name | Values | Default | Notes +---------------- | ------------- | --------------- | -------- +pykms | true, false | true | Python bindings +kmscube | true, false | false | GLES kmscube +omap | enabled, disabled, auto | auto | libdrm-omap support ## Env variables @@ -98,5 +93,4 @@ You can run the python code directly from the build dir by defining PYTHONPATH e ``` PYTHONPATH=build/py py/tests/hpd.py - ``` -- cgit v1.2.3