David Beck | 10b4dfd | 2018-09-19 12:03:20 +0100 | [diff] [blame] | 1 | # |
| 2 | # Copyright © 2017 Arm Ltd. All rights reserved. |
| 3 | # SPDX-License-Identifier: MIT |
| 4 | # |
| 5 | |
David Beck | 10b4dfd | 2018-09-19 12:03:20 +0100 | [diff] [blame] | 6 | # single place to use wildcards, so we can include |
David Beck | 711fa31 | 2018-09-24 10:46:38 +0100 | [diff] [blame] | 7 | # yet unknown backend modules and corresponding common libraries |
Matteo Martincigh | 4912402 | 2019-01-11 13:25:59 +0000 | [diff] [blame] | 8 | file(GLOB commonIncludes ${PROJECT_SOURCE_DIR}/src/backends/*/common.cmake) |
| 9 | file(GLOB backendIncludes ${PROJECT_SOURCE_DIR}/src/backends/*/backend.cmake) |
David Beck | 10b4dfd | 2018-09-19 12:03:20 +0100 | [diff] [blame] | 10 | |
David Beck | 3cc9a62 | 2018-10-12 10:38:31 +0100 | [diff] [blame] | 11 | # prefer to include common code first |
| 12 | foreach(includeFile ${commonIncludes}) |
Rob Hughes | 721b82f | 2019-11-15 09:04:17 +0000 | [diff] [blame] | 13 | message(STATUS "Including backend common library into the build: ${includeFile}") |
David Beck | 3cc9a62 | 2018-10-12 10:38:31 +0100 | [diff] [blame] | 14 | include(${includeFile}) |
| 15 | endforeach() |
| 16 | |
| 17 | # now backends can depend on common code included first |
| 18 | foreach(includeFile ${backendIncludes}) |
Rob Hughes | 721b82f | 2019-11-15 09:04:17 +0000 | [diff] [blame] | 19 | message(STATUS "Including backend into the build: ${includeFile}") |
David Beck | 0dbe0ee | 2018-09-24 15:59:27 +0100 | [diff] [blame] | 20 | include(${includeFile}) |
David Beck | 10b4dfd | 2018-09-19 12:03:20 +0100 | [diff] [blame] | 21 | endforeach() |
Ryan OShea | a3dc95e | 2023-03-20 11:10:40 +0000 | [diff] [blame] | 22 | if(NOT DISABLE_DYNAMIC_BACKENDS) |
| 23 | # parse dynamic backend sub-directories |
| 24 | file(GLOB dynamicBackendDirs ${PROJECT_SOURCE_DIR}/src/backends/dynamic/*) |
| 25 | foreach(dynamicBackendDir ${dynamicBackendDirs}) |
| 26 | if (EXISTS ${dynamicBackendDir} AND IS_DIRECTORY ${dynamicBackendDir}) |
| 27 | add_subdirectory(${dynamicBackendDir}) |
| 28 | endif() |
| 29 | endforeach() |
| 30 | endif() |