blob: aca3b63ca9d109f80e12a64e895ceac20769bd08 [file] [log] [blame]
David Beck10b4dfd2018-09-19 12:03:20 +01001#
2# Copyright © 2017 Arm Ltd. All rights reserved.
3# SPDX-License-Identifier: MIT
4#
5
David Beck10b4dfd2018-09-19 12:03:20 +01006# single place to use wildcards, so we can include
David Beck711fa312018-09-24 10:46:38 +01007# yet unknown backend modules and corresponding common libraries
Matteo Martincigh49124022019-01-11 13:25:59 +00008file(GLOB commonIncludes ${PROJECT_SOURCE_DIR}/src/backends/*/common.cmake)
9file(GLOB backendIncludes ${PROJECT_SOURCE_DIR}/src/backends/*/backend.cmake)
David Beck10b4dfd2018-09-19 12:03:20 +010010
David Beck3cc9a622018-10-12 10:38:31 +010011# prefer to include common code first
12foreach(includeFile ${commonIncludes})
Rob Hughes721b82f2019-11-15 09:04:17 +000013 message(STATUS "Including backend common library into the build: ${includeFile}")
David Beck3cc9a622018-10-12 10:38:31 +010014 include(${includeFile})
15endforeach()
16
17# now backends can depend on common code included first
18foreach(includeFile ${backendIncludes})
Rob Hughes721b82f2019-11-15 09:04:17 +000019 message(STATUS "Including backend into the build: ${includeFile}")
David Beck0dbe0ee2018-09-24 15:59:27 +010020 include(${includeFile})
David Beck10b4dfd2018-09-19 12:03:20 +010021endforeach()
Matteo Martincigh4e73b422019-08-08 13:46:32 +010022
23# parse dynamic backend sub-directories
24file(GLOB dynamicBackendDirs ${PROJECT_SOURCE_DIR}/src/backends/dynamic/*)
25foreach(dynamicBackendDir ${dynamicBackendDirs})
26 if (EXISTS ${dynamicBackendDir} AND IS_DIRECTORY ${dynamicBackendDir})
27 add_subdirectory(${dynamicBackendDir})
28 endif()
29endforeach()