aboutsummaryrefslogtreecommitdiff
path: root/src/backends/backends.cmake
blob: 98af2716e3930c09c5b5be1d6833c9c5b42ea099 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#
# Copyright © 2017 Arm Ltd. All rights reserved.
# SPDX-License-Identifier: MIT
#

# single place to use wildcards, so we can include
# yet unknown backend modules and corresponding common libraries
file(GLOB commonIncludes ${PROJECT_SOURCE_DIR}/src/backends/*/common.cmake)
file(GLOB backendIncludes ${PROJECT_SOURCE_DIR}/src/backends/*/backend.cmake)

# prefer to include common code first
foreach(includeFile ${commonIncludes})
    message(STATUS "Including backend common library into the build: ${includeFile}")
    include(${includeFile})
endforeach()

# now backends can depend on common code included first
foreach(includeFile ${backendIncludes})
    message(STATUS "Including backend into the build: ${includeFile}")
    include(${includeFile})
endforeach()
if(NOT DISABLE_DYNAMIC_BACKENDS)
    # parse dynamic backend sub-directories
    file(GLOB dynamicBackendDirs ${PROJECT_SOURCE_DIR}/src/backends/dynamic/*)
    foreach(dynamicBackendDir ${dynamicBackendDirs})
        if (EXISTS ${dynamicBackendDir} AND IS_DIRECTORY ${dynamicBackendDir})
            add_subdirectory(${dynamicBackendDir})
        endif()
    endforeach()
endif()