1 Star 0 Fork 55

wcleungaj/clang

forked from src-openEuler/clang 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0003-add-BUILD_FOR_OPENEULER-build-option-to-clang.patch 1.35 KB
一键复制 编辑 原始数据 按行查看 历史
liyunfei 提交于 2024-02-05 11:07 . add BUILD_FOR_OPENEULER to clang
From 752af60afc7fd9cc986adf280d4d03714228fb04 Mon Sep 17 00:00:00 2001
From: liyunfei <liyunfei33@huawei.com>
Date: Tue, 16 Jan 2024 14:47:02 +0800
Subject: [PATCH] add BUILD_FOR_OPENEULER build option to clang
---
clang/CMakeLists.txt | 5 +++++
clang/include/clang/Driver/CMakeLists.txt | 4 ++++
2 files changed, 9 insertions(+)
diff --git a/clang/CMakeLists.txt b/clang/CMakeLists.txt
index f7936d72e088..d558b0522e82 100644
--- a/clang/CMakeLists.txt
+++ b/clang/CMakeLists.txt
@@ -317,6 +317,11 @@ if (LLVM_COMPILER_IS_GCC_COMPATIBLE)
endif()
endif ()
+option(BUILD_FOR_OPENEULER "Add gcc compatible options for openEuler toolchain" OFF)
+if (BUILD_FOR_OPENEULER)
+ add_definitions( -DBUILD_FOR_OPENEULER )
+endif()
+
# Determine HOST_LINK_VERSION on Darwin.
set(HOST_LINK_VERSION)
if (APPLE AND NOT CMAKE_LINKER MATCHES ".*lld.*")
diff --git a/clang/include/clang/Driver/CMakeLists.txt b/clang/include/clang/Driver/CMakeLists.txt
index a9d988047920..ea55ba0f1f27 100644
--- a/clang/include/clang/Driver/CMakeLists.txt
+++ b/clang/include/clang/Driver/CMakeLists.txt
@@ -1,3 +1,7 @@
set(LLVM_TARGET_DEFINITIONS Options.td)
+if (BUILD_FOR_OPENEULER)
+tablegen(LLVM Options.inc -gen-opt-parser-defs -DBUILD_FOR_OPENEULER)
+else()
tablegen(LLVM Options.inc -gen-opt-parser-defs)
+endif()
add_public_tablegen_target(ClangDriverOptions)
--
Gitee
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wcleungaj/clang.git
git@gitee.com:wcleungaj/clang.git
wcleungaj
clang
clang
master

搜索帮助

D67c1975 1850385 1daf7b77 1850385