Skip to content

Commit 7964eb3

Browse files
authored
build: add support for OpenHarmony operating system
PR-URL: #58350 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Darshan Sen <raisinten@gmail.com> Reviewed-By: Michael Dawson <midawson@redhat.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
1 parent 8d603d5 commit 7964eb3

23 files changed

+632
-59
lines changed

BUILDING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ platforms. This is true regardless of entries in the table below.
122122
| SmartOS | x64 | >= 18 | Tier 2 | |
123123
| AIX | ppc64be >=power8 | >= 7.2 TL04 | Tier 2 | |
124124
| FreeBSD | x64 | >= 13.2 | Experimental | |
125+
| OpenHarmony | arm64 | >= 5.0 | Experimental | |
125126

126127
<!--lint disable final-definition-->
127128

common.gypi

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
['target_arch in "ppc64 s390x"', {
121121
'v8_enable_backtrace': 1,
122122
}],
123-
['OS=="linux"', {
123+
['OS=="linux" or OS=="openharmony"', {
124124
'node_section_ordering_info%': ''
125125
}],
126126
['OS == "zos"', {
@@ -202,7 +202,7 @@
202202
'LLVM_LTO': 'YES',
203203
},
204204
}],
205-
['OS=="linux"', {
205+
['OS=="linux" or OS=="openharmony"', {
206206
'conditions': [
207207
['node_section_ordering_info!=""', {
208208
'cflags': [
@@ -230,7 +230,7 @@
230230
# frames otherwise, even with --call-graph dwarf.
231231
'cflags': [ '-fno-omit-frame-pointer' ],
232232
}],
233-
['OS=="linux"', {
233+
['OS=="linux" or OS=="openharmony"', {
234234
'conditions': [
235235
['enable_pgo_generate=="true"', {
236236
'cflags': ['<(pgo_generate)'],
@@ -495,11 +495,11 @@
495495
'NOMINMAX',
496496
],
497497
}],
498-
[ 'OS in "linux freebsd openbsd solaris aix os400"', {
498+
[ 'OS in "linux freebsd openbsd solaris aix os400 openharmony"', {
499499
'cflags': [ '-pthread' ],
500500
'ldflags': [ '-pthread' ],
501501
}],
502-
[ 'OS in "linux freebsd openbsd solaris android aix os400 cloudabi"', {
502+
[ 'OS in "linux freebsd openbsd solaris android aix os400 cloudabi openharmony"', {
503503
'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
504504
'cflags_cc': [
505505
'-fno-rtti',

configure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
parser = argparse.ArgumentParser()
4646

4747
valid_os = ('win', 'mac', 'solaris', 'freebsd', 'openbsd', 'linux',
48-
'android', 'aix', 'cloudabi', 'os400', 'ios')
48+
'android', 'aix', 'cloudabi', 'os400', 'ios', 'openharmony')
4949
valid_arch = ('arm', 'arm64', 'ia32', 'mips', 'mipsel', 'mips64el',
5050
'ppc64', 'x64', 'x86', 'x86_64', 's390x', 'riscv64', 'loong64')
5151
valid_arm_float_abi = ('soft', 'softfp', 'hard')

deps/cares/cares.gyp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,10 @@
248248
'-lnsl'
249249
]
250250
}
251+
}],
252+
[ 'OS=="openharmony"', {
253+
'include_dirs': [ 'config/openharmony' ],
254+
'sources': [ 'config/openharmony/ares_config.h' ],
251255
}]
252256
]
253257
}

0 commit comments

Comments
 (0)