Skip to content

Commit 0b4056c

Browse files
hqzingtargos
authored andcommitted
build: add support for OpenHarmony operating system
PR-URL: #58350 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Darshan Sen <[email protected]> Reviewed-By: Michael Dawson <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]>
1 parent ef9ecbe commit 0b4056c

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
@@ -122,7 +122,7 @@
122122
['target_arch in "ppc64 s390x"', {
123123
'v8_enable_backtrace': 1,
124124
}],
125-
['OS=="linux"', {
125+
['OS=="linux" or OS=="openharmony"', {
126126
'node_section_ordering_info%': ''
127127
}],
128128
['OS == "zos"', {
@@ -204,7 +204,7 @@
204204
'LLVM_LTO': 'YES',
205205
},
206206
}],
207-
['OS=="linux"', {
207+
['OS=="linux" or OS=="openharmony"', {
208208
'conditions': [
209209
['node_section_ordering_info!=""', {
210210
'cflags': [
@@ -232,7 +232,7 @@
232232
# frames otherwise, even with --call-graph dwarf.
233233
'cflags': [ '-fno-omit-frame-pointer' ],
234234
}],
235-
['OS=="linux"', {
235+
['OS=="linux" or OS=="openharmony"', {
236236
'conditions': [
237237
['enable_pgo_generate=="true"', {
238238
'cflags': ['<(pgo_generate)'],
@@ -503,11 +503,11 @@
503503
'NOMINMAX',
504504
],
505505
}],
506-
[ 'OS in "linux freebsd openbsd solaris aix os400"', {
506+
[ 'OS in "linux freebsd openbsd solaris aix os400 openharmony"', {
507507
'cflags': [ '-pthread' ],
508508
'ldflags': [ '-pthread' ],
509509
}],
510-
[ 'OS in "linux freebsd openbsd solaris android aix os400 cloudabi"', {
510+
[ 'OS in "linux freebsd openbsd solaris android aix os400 cloudabi openharmony"', {
511511
'cflags': [ '-Wall', '-Wextra', '-Wno-unused-parameter', ],
512512
'cflags_cc': [
513513
'-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)