File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- cmake_minimum_required (VERSION 3.20 )
1+ # See: https://cmake.org/cmake/help/latest/prop_sf/GENERATED.html
2+ cmake_minimum_required (VERSION 3.30 )
23
34project (TrustZone LANGUAGES C )
45
56add_subdirectory (secure )
67add_subdirectory (non-secure )
78
8- # TODO 1: Add `secure-import-lib` as a dependency for `non-secure`
9- add_custom_target ()
10- add_dependencies ()
11-
Original file line number Diff line number Diff line change 11add_executable (non-secure )
22
3- target_sources ( non- secure PRIVATE non-secure-hello.c )
3+ # TODO 5: Add ` secure-import-lib` as a dependency for ` non-secure`
44
5+
6+ target_sources (non-secure PRIVATE
7+ non-secure-hello.c
8+ )
59target_compile_options (non-secure PRIVATE
610 --cpu=$<TARGET_PROPERTY:secure,CPU>
711 --no_wrap_diagnostics
812)
913
1014target_include_directories (non-secure PRIVATE
11- # TODO 4: Make use of the `secure` include directories
15+ # TODO 6: Make use of the `secure` include directories
16+
1217)
1318
1419target_link_options (non-secure PRIVATE
1520 --cpu=$<TARGET_PROPERTY:secure,CPU>
1621 --config ${CMAKE_CURRENT_SOURCE_DIR } /v2m-mps2_ns.icf
1722 --semihosting
18- # TODO 5: Link against the import library generated from the `secure` target
19- # TODO 6: Specify "no entry point" for the `non-secure` target
23+ # TODO 7a: Add the generated import library to the `non-secure` target
24+
25+ # TODO 7b: Specify "no entry point" for the `non-secure` target
26+
2027)
Original file line number Diff line number Diff line change @@ -3,12 +3,13 @@ add_executable(secure)
33target_sources (secure PRIVATE secure-hello.c )
44
55set_target_properties (secure PROPERTIES
6- CPU cortex-m33
6+ CPU cortex-m33
77)
88
99target_compile_options (secure PRIVATE
1010 --cpu=$<TARGET_PROPERTY:CPU>
11- # TODO 2: Enable the CMSE in the compiler flags
11+ # TODO 1: Enable the CMSE in the compiler flags
12+
1213)
1314
1415target_include_directories (secure PUBLIC
@@ -19,5 +20,20 @@ target_link_options(secure PRIVATE
1920 --semihosting
2021 --cpu=$<TARGET_PROPERTY:CPU>
2122 --config ${CMAKE_CURRENT_SOURCE_DIR } /v2m-mps2_s.icf
22- # TODO 3: Set the linker to produce an import library, consumed by the `non-secure` target
23+ # TODO 2: Set the linker to produce an import library object file
24+
2325)
26+
27+ # TODO 3: Add a custom target for explicitly marking the secure import library as `GENERATED`
28+ # (required for Ninja targets)
29+
30+
31+
32+
33+
34+
35+ # TODO 4: Include the secure import library in the generator's clean target
36+ # (clean with: cmake --build build --target clean)
37+
38+
39+
You can’t perform that action at this time.
0 commit comments