From 929c2f7e1997347a7d644177a7b25f90e1eaada4 Mon Sep 17 00:00:00 2001 From: ms Date: Thu, 23 Jun 2022 23:32:00 +0800 Subject: [PATCH] 11-hello-2 Change-Id: Ib163e8ce93ef399b00ce7d75882f5a03fadd7cba --- app/my_first_app/BUILD.gn | 20 ++++++++++++++++++++ app/my_first_app/hello_world.c | 9 +++++++++ 2 files changed, 29 insertions(+) create mode 100644 app/my_first_app/BUILD.gn create mode 100644 app/my_first_app/hello_world.c diff --git a/app/my_first_app/BUILD.gn b/app/my_first_app/BUILD.gn new file mode 100644 index 0000000..24941d3 --- /dev/null +++ b/app/my_first_app/BUILD.gn @@ -0,0 +1,20 @@ +# Copyright (c) 2020-2022 Huawei Device Co., Ltd. +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +static_library("myapp") { + sources = [ "hello_world.c" ] + + include_dirs = [ + "//utils/native/lite/include" + ] +} diff --git a/app/my_first_app/hello_world.c b/app/my_first_app/hello_world.c new file mode 100644 index 0000000..8464718 --- /dev/null +++ b/app/my_first_app/hello_world.c @@ -0,0 +1,9 @@ +#include +#include "ohos_init.h" +#include "ohos_types.h" + +void HelloWorld(void) +{ + printf("[DEMO] hello, world!\n"); +} +SYS_RUN(HelloWorld); -- Gitee