File tree 5 files changed +80
-0
lines changed
5 files changed +80
-0
lines changed Original file line number Diff line number Diff line change
1
+ # SPDX-License-Identifier: Apache-2.0
2
+
3
+ cmake_minimum_required (VERSION 3.20.0)
4
+
5
+ find_package (Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE} )
6
+ project (hello_cpp_world)
7
+
8
+ target_sources (app PRIVATE src/main.cpp)
Original file line number Diff line number Diff line change
1
+ .. _hello_cpp_world :
2
+
3
+ Hello C++ World
4
+ ###############
5
+
6
+ Overview
7
+ ********
8
+
9
+ A simple :ref: `C++ <language_cpp >` sample that can be used with many supported board and prints
10
+ "Hello, C++ world!" to the console.
11
+
12
+ Building and Running
13
+ ********************
14
+
15
+ This configuration can be built and executed on QEMU as follows:
16
+
17
+ .. zephyr-app-commands ::
18
+ :zephyr-app: samples/cpp/hello_world
19
+ :host-os: unix
20
+ :board: qemu_riscv32
21
+ :goals: run
22
+ :compact:
23
+
24
+ To build for another board, change "qemu_riscv32" above to that board's name.
25
+
26
+ Sample Output
27
+ =============
28
+
29
+ .. code-block :: console
30
+
31
+ Hello C++, world! qemu_riscv32
32
+
33
+ Exit QEMU by pressing :kbd: `CTRL + C `
Original file line number Diff line number Diff line change
1
+ CONFIG_CPP=y
2
+ CONFIG_REQUIRES_FULL_LIBCPP=y
Original file line number Diff line number Diff line change
1
+ sample :
2
+ description : Hello World C++ sample, the simplest C++ Zephyr application
3
+ name : hello cpp world
4
+ common :
5
+ tags : introduction
6
+ integration_platforms :
7
+ - qemu_riscv32
8
+ harness : console
9
+ harness_config :
10
+ type : one_line
11
+ regex :
12
+ - " Hello, C\\ +\\ + world! (.*)"
13
+ tests :
14
+ sample.cpp.helloworld :
15
+ min_ram : 128
16
+ arch_exclude :
17
+ # See #66027
18
+ - xtensa
19
+ platform_exclude :
20
+ # See zephyrproject-rtos/sdk-ng#593
21
+ - qemu_x86
22
+ - intel_ish_5_4_1
23
+ - intel_ish_5_6_0
24
+ - intel_ish_5_8_0
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright (c) 2023, Meta
3
+ *
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+
7
+ #include < iostream>
8
+
9
+ int main (void )
10
+ {
11
+ std::cout << " Hello, C++ world! " << CONFIG_BOARD << std::endl;
12
+ return 0 ;
13
+ }
You can’t perform that action at this time.
0 commit comments