blob: 4711a193cc87358b4687b559f909365e0be51a96 [file] [log] [blame]
Kristofer Jonsson116a6352020-08-20 17:25:23 +02001#
Per Åstrand87ca5da2021-04-15 09:47:03 +02002# Copyright (c) 2020-2021 Arm Limited. All rights reserved.
Kristofer Jonsson116a6352020-08-20 17:25:23 +02003#
4# SPDX-License-Identifier: Apache-2.0
5#
6# Licensed under the Apache License, Version 2.0 (the License); you may
7# not use this file except in compliance with the License.
8# You may obtain a copy of the License at
9#
10# www.apache.org/licenses/LICENSE-2.0
11#
12# Unless required by applicable law or agreed to in writing, software
13# distributed under the License is distributed on an AS IS BASIS, WITHOUT
14# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15# See the License for the specific language governing permissions and
16# limitations under the License.
17#
18
19cmake_minimum_required(VERSION 3.0.2)
20
21# Set the project name and version
22project("linux_driver_stack" VERSION 1.0)
23
24# Default options
25option(BUILD_KERNEL "Build the kernel driver" ON)
26option(BUILD_MAILBOX "Build the MHU mailbox kernel module" ON)
Per Åstrand87ca5da2021-04-15 09:47:03 +020027option(BUILD_REMOTEPROC "Build the remoteproc kernel module" ON)
Kristofer Jonsson116a6352020-08-20 17:25:23 +020028
29# Add rpath to library directory
30set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
31
32# Add include directory
33include_directories("kernel")
34
35# Add sub directories
36if(BUILD_KERNEL)
37 add_subdirectory(kernel)
38endif()
39
40if (BUILD_MAILBOX)
41 add_subdirectory(mailbox)
42endif()
43
Per Åstrand87ca5da2021-04-15 09:47:03 +020044if (BUILD_REMOTEPROC)
45add_subdirectory(remoteproc)
46endif()
47
Kristofer Jonssonb74492c2020-09-10 13:26:01 +020048# Build flatbuffers
49unset(PROJECT_VERSION)
50unset(PROJECT_VERSION_MAJOR)
51unset(PROJECT_VERSION_MINOR)
52option(FLATBUFFERS_BUILD_TESTS OFF)
53option(FLATBUFFERS_INSTALL OFF)
54option(FLATBUFFERS_BUILD_FLATC OFF)
55option(FLATBUFFERS_BUILD_FLATHASH OFF)
56add_subdirectory(flatbuffers)
57
58# Build driver library
Kristofer Jonsson116a6352020-08-20 17:25:23 +020059add_subdirectory(driver_library)
Kristofer Jonssonb74492c2020-09-10 13:26:01 +020060
61# Build utils
Kristofer Jonsson116a6352020-08-20 17:25:23 +020062add_subdirectory(utils)