diff options
Diffstat (limited to 'meson/test cases/common/215 source set realistic example/boards')
9 files changed, 119 insertions, 0 deletions
diff --git a/meson/test cases/common/215 source set realistic example/boards/arm/aarch64.cc b/meson/test cases/common/215 source set realistic example/boards/arm/aarch64.cc new file mode 100644 index 000000000..386c771d8 --- /dev/null +++ b/meson/test cases/common/215 source set realistic example/boards/arm/aarch64.cc @@ -0,0 +1,8 @@ +#include "common.h" +#include <iostream> + +void initialize_target() +{ + std::cout << ANSI_START << "some " << THE_TARGET + << " initialization" << ANSI_END << std::endl; +} diff --git a/meson/test cases/common/215 source set realistic example/boards/arm/arm.cc b/meson/test cases/common/215 source set realistic example/boards/arm/arm.cc new file mode 100644 index 000000000..b463ebe7a --- /dev/null +++ b/meson/test cases/common/215 source set realistic example/boards/arm/arm.cc @@ -0,0 +1,10 @@ +#include "arm.h" + +const char *ARMBoard::target() +{ + return THE_TARGET; +} + +void ARMBoard::some_arm_thing() +{ +} diff --git a/meson/test cases/common/215 source set realistic example/boards/arm/arm.h b/meson/test cases/common/215 source set realistic example/boards/arm/arm.h new file mode 100644 index 000000000..4dd6b694f --- /dev/null +++ b/meson/test cases/common/215 source set realistic example/boards/arm/arm.h @@ -0,0 +1,12 @@ +#ifndef ARM_H +#define ARM_H 1 + +#include "common.h" + +struct ARMBoard: Board { + const char *target(); + void some_arm_thing(); +}; + + +#endif diff --git a/meson/test cases/common/215 source set realistic example/boards/arm/arm32.cc b/meson/test cases/common/215 source set realistic example/boards/arm/arm32.cc new file mode 100644 index 000000000..72a24274a --- /dev/null +++ b/meson/test cases/common/215 source set realistic example/boards/arm/arm32.cc @@ -0,0 +1,8 @@ +#include "common.h" +#include <iostream> + +void initialize_target() +{ + std::cout << ANSI_START << "a different " << THE_TARGET + << " initialization" << ANSI_END << std::endl; +} diff --git a/meson/test cases/common/215 source set realistic example/boards/arm/versatilepb.cc b/meson/test cases/common/215 source set realistic example/boards/arm/versatilepb.cc new file mode 100644 index 000000000..3d1a9fe7c --- /dev/null +++ b/meson/test cases/common/215 source set realistic example/boards/arm/versatilepb.cc @@ -0,0 +1,16 @@ +#include <iostream> +#include "common.h" +#include "arm.h" + +struct VersatilePBBoard: ARMBoard { + void say_hello(); +}; + +void VersatilePBBoard::say_hello() +{ + some_arm_thing(); + std::cout << ANSI_START << "I am the versatilepb board" + << ANSI_END << std::endl; +} + +static VersatilePBBoard versatilepb; diff --git a/meson/test cases/common/215 source set realistic example/boards/arm/virt.cc b/meson/test cases/common/215 source set realistic example/boards/arm/virt.cc new file mode 100644 index 000000000..6f9a1ca94 --- /dev/null +++ b/meson/test cases/common/215 source set realistic example/boards/arm/virt.cc @@ -0,0 +1,16 @@ +#include <iostream> +#include "common.h" +#include "arm.h" + +struct VirtBoard: ARMBoard { + void say_hello(); +}; + +void VirtBoard::say_hello() +{ + some_arm_thing(); + std::cout << ANSI_START << "I am the virt board" + << ANSI_END << std::endl; +} + +static VirtBoard virt; diff --git a/meson/test cases/common/215 source set realistic example/boards/arm/xlnx_zcu102.cc b/meson/test cases/common/215 source set realistic example/boards/arm/xlnx_zcu102.cc new file mode 100644 index 000000000..8921e0074 --- /dev/null +++ b/meson/test cases/common/215 source set realistic example/boards/arm/xlnx_zcu102.cc @@ -0,0 +1,16 @@ +#include <iostream> +#include "common.h" +#include "arm.h" + +struct XlnxZCU102Board: ARMBoard { + void say_hello(); +}; + +void XlnxZCU102Board::say_hello() +{ + some_arm_thing(); + std::cout << ANSI_START << "I am the xlnx_zcu102 board" + << ANSI_END << std::endl; +} + +static XlnxZCU102Board xlnx_zcu102; diff --git a/meson/test cases/common/215 source set realistic example/boards/meson.build b/meson/test cases/common/215 source set realistic example/boards/meson.build new file mode 100644 index 000000000..41ead4c3e --- /dev/null +++ b/meson/test cases/common/215 source set realistic example/boards/meson.build @@ -0,0 +1,7 @@ +specific.add(when: 'TARGET_ARM', if_true: files('arm/arm.cc', 'arm/arm32.cc')) +specific.add(when: 'TARGET_AARCH64', if_true: files('arm/arm.cc', 'arm/aarch64.cc')) +specific.add(when: 'CONFIG_VIRT', if_true: files('arm/virt.cc')) +specific.add(when: 'CONFIG_XLNX_ZCU102', if_true: files('arm/xlnx_zcu102.cc')) +specific.add(when: 'CONFIG_VERSATILEPB', if_true: files('arm/versatilepb.cc')) + +specific.add(when: 'TARGET_X86', if_true: files('x86/pc.cc')) diff --git a/meson/test cases/common/215 source set realistic example/boards/x86/pc.cc b/meson/test cases/common/215 source set realistic example/boards/x86/pc.cc new file mode 100644 index 000000000..04ec39262 --- /dev/null +++ b/meson/test cases/common/215 source set realistic example/boards/x86/pc.cc @@ -0,0 +1,26 @@ +#include <iostream> +#include "common.h" + +struct X86Board: Board { + const char *target(); + void say_hello(); +}; + +const char *X86Board::target() +{ + return THE_TARGET; +} + +void X86Board::say_hello() +{ + std::cout << ANSI_START << "I am a 1996 PC" + << ANSI_END << std::endl; +} + +void initialize_target() +{ + std::cout << ANSI_START << "ready, set, go" + << ANSI_END << std::endl; +} + +static X86Board pc; |