已知 cmake 编译的情况有鸿蒙平台的预定义宏 __OHOS__,gn 编译有类似的HarmonyOS的预定义宏吗?

已知 cmake 编译的情况有鸿蒙平台的预定义宏 __OHOS__,gn 编译有类似的HarmonyOS的预定义宏吗?

HarmonyOS
2024-05-13 21:18:24
浏览
收藏 0
回答 1
回答 1
按赞同
/
按时间
智体美劳全发展

gn编译可参考:https://gitee.com/openharmony/build/issues/I8NG24?from=project-issue

确认当前没有预制ohos平台宏,需要自行添加,比如:

+is_ohos = current_os == “ohos”
is_android = current_os == “android”
is_chromeos = current_os == “chromeos”
is_fuchsia = current_os == “fuchsia”
@@ -373,6 +376,10 @@ if (is_android) {
[ “//build/config/android:default_orderfile_instrumentation” ]
}
+if (is_ohos) {
default_compiler_configs += [ “//build/config/ohos:compiler” ]
+}
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.

参考:https://gitee.com/openharmony/build/issues/I8NG24?from=project-issue

分享
微博
QQ
微信
回复
2024-05-14 16:40:13
相关问题
HarmonyOS debug
642浏览 • 1回复 待解决
HarmonyOS 使用gn编译Skia编译so
1619浏览 • 1回复 待解决
是否提供预定义模板库?
276浏览 • 0回复 待解决
vpp 编译问题
2745浏览 • 1回复 待解决
如何编译底层so
2897浏览 • 1回复 待解决
HarmonyOS 不同架构交叉编译
728浏览 • 1回复 待解决
HarmonyOS webviewbounces类似的属性么
942浏览 • 1回复 待解决
HarmonyOS可以接入crash监控平台
696浏览 • 1回复 待解决
是否编译 OpenSSL so 文件?
945浏览 • 1回复 待解决
HarmonyOS cmake编译存在无意义warning
1194浏览 • 1回复 待解决