Skip to content

Commit b02401a

Browse files
committed
patch root to build llvm with c++17
1 parent 70a0c7b commit b02401a

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

root-llvm-cxx17.patch

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
diff --git a/interpreter/CMakeLists.txt b/interpreter/CMakeLists.txt
2+
index de5056d..8f993f7 100644
3+
--- a/interpreter/CMakeLists.txt
4+
+++ b/interpreter/CMakeLists.txt
5+
@@ -229,6 +229,11 @@ if(builtin_llvm)
6+
7+
set(LLVM_ENABLE_PROJECTS "clang" CACHE STRING "")
8+
9+
+ # Always build LLVM with C++17. It is not necessary to compile with the same
10+
+ # C++ standard as the rest of ROOT and sometimes it doesn't even work.
11+
+ set(_cxx_standard ${CMAKE_CXX_STANDARD})
12+
+ set(CMAKE_CXX_STANDARD 17)
13+
+
14+
#---Add the sub-directory excluding all the targets from all-----------------------------------------
15+
if(CMAKE_GENERATOR MATCHES "Xcode")
16+
add_subdirectory(llvm-project/llvm)
17+
@@ -236,6 +241,8 @@ if(builtin_llvm)
18+
add_subdirectory(llvm-project/llvm EXCLUDE_FROM_ALL)
19+
endif()
20+
21+
+ set(CMAKE_CXX_STANDARD ${_cxx_standard})
22+
+
23+
set(LLVM_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/interpreter/llvm-project/llvm/include
24+
${CMAKE_BINARY_DIR}/interpreter/llvm-project/llvm/include
25+
CACHE STRING "LLVM include directories."
26+
@@ -446,7 +453,14 @@ else()
27+
# Disable linking against shared LLVM
28+
set(LLVM_LINK_LLVM_DYLIB OFF)
29+
30+
+ # Always build LLVM with C++17. It is not necessary to compile with the same
31+
+ # C++ standard as the rest of ROOT and sometimes it doesn't even work.
32+
+ set(_cxx_standard ${CMAKE_CXX_STANDARD})
33+
+ set(CMAKE_CXX_STANDARD 17)
34+
+
35+
add_subdirectory(llvm-project/clang EXCLUDE_FROM_ALL)
36+
+
37+
+ set(CMAKE_CXX_STANDARD ${_cxx_standard})
38+
endif(builtin_clang)
39+
40+
set( CLANG_BUILT_STANDALONE 1 )

root.spec

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
%define github_user cms-sw
1010
Source: git+https://github.com/%{github_user}/root.git?obj=%{branch}/%{tag}&export=%{n}-%{realversion}&output=/%{n}-%{realversion}-%{tag}.tgz
11+
Patch0: root-llvm-cxx17
1112

1213
BuildRequires: cmake ninja
1314

@@ -27,6 +28,7 @@ Requires: dcap
2728

2829
%prep
2930
%setup -n %{n}-%{realversion}
31+
%patch0 -p1
3032
%get_config_sub graf2d/asimage/src/libAfterImage/config.sub
3133
%get_config_guess graf2d/asimage/src/libAfterImage/config.guess
3234
chmod +x graf2d/asimage/src/libAfterImage/config.{sub,guess}

0 commit comments

Comments
 (0)