@@ -24,7 +24,15 @@ add_library(mbed-nfc INTERFACE)
24
24
add_library (mbed-ppp INTERFACE )
25
25
add_library (mbed-wifi INTERFACE )
26
26
27
- if (${CMAKE_CROSSCOMPILING} )
27
+ if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING )
28
+ # Add these subdirectories for tests
29
+ add_subdirectory (cellular )
30
+ add_subdirectory (FEATURE_BLE )
31
+ add_subdirectory (libraries )
32
+ add_subdirectory (lorawan )
33
+ add_subdirectory (mbedtls )
34
+ add_subdirectory (netsocket )
35
+ else ()
28
36
# The directories below contain optional target libraries
29
37
add_subdirectory (FEATURE_BLE EXCLUDE_FROM_ALL )
30
38
add_subdirectory (cellular EXCLUDE_FROM_ALL )
@@ -36,12 +44,4 @@ if(${CMAKE_CROSSCOMPILING})
36
44
add_subdirectory (nanostack EXCLUDE_FROM_ALL )
37
45
add_subdirectory (netsocket EXCLUDE_FROM_ALL )
38
46
add_subdirectory (nfc EXCLUDE_FROM_ALL )
39
- else ()
40
- # Add these subdirectories for the Unit test
41
- add_subdirectory (cellular )
42
- add_subdirectory (lorawan )
43
- add_subdirectory (netsocket )
44
- add_subdirectory (mbedtls )
45
- add_subdirectory (libraries )
46
- add_subdirectory (FEATURE_BLE )
47
47
endif ()
0 commit comments