Skip to content

Commit 7cb60cf

Browse files
authored
Move options to global.conf (#15)
1 parent 128c7a2 commit 7cb60cf

File tree

3 files changed

+17
-23
lines changed

3 files changed

+17
-23
lines changed

docker/debian/Dockerfile

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,11 +135,10 @@ rm -rf /tmp/*
135135
EOF
136136

137137
# Fix the C++ dialect.
138-
RUN sed -i -e 's|^compiler\.cppstd=.*$|compiler.cppstd=20|' ~/.conan2/profiles/default
138+
RUN sed -i -e 's|^compiler\.cppstd=.*$|compiler.cppstd=20|' $(conan config home)/profiles/default
139139
# Explicitly set the compiler flags.
140140
RUN <<EOF
141-
cat >>~/.conan2/profiles/default <<EOT
142-
[conf]
141+
cat >> $(conan config home)/global.conf <<EOT
143142
tools.build:compiler_executables={"c": "${CC}", "cpp": "${CXX}"}
144143
EOT
145144
EOF
@@ -209,20 +208,19 @@ rm -rf /tmp/*
209208
EOF
210209

211210
# Fix the C++ dialect.
212-
RUN sed -i -e 's|^compiler\.cppstd=.*$|compiler.cppstd=20|' ~/.conan2/profiles/default
211+
RUN sed -i -e 's|^compiler\.cppstd=.*$|compiler.cppstd=20|' $(conan config home)/profiles/default
213212
# Explicitly set the compiler flags. To ensure compatibility with a range of
214213
# Clang compilers, we must also add extra flags that apply to certain versions
215214
# of Clang.
216215
# TODO: Move extra flags into the rippled repository as a custom Conan profile.
217216
RUN <<EOF
218217
CXX_VER=$(${CXX} -dumpversion)
219218
CXX_VER=${CXX_VER%%.*}
220-
cat >>~/.conan2/profiles/default <<EOT
221-
[conf]
219+
cat >> $(conan config home)/global.conf <<EOT
222220
tools.build:compiler_executables={"c": "${CC}", "cpp": "${CXX}"}
223221
EOT
224222
if [[ ${CXX_VER} -ge 19 ]]; then
225-
cat >>~/.conan2/profiles/default <<EOT
223+
cat >> $(conan config home)/global.conf <<EOT
226224
tools.build:cxxflags=['-Wno-missing-template-arg-list-after-template-kw']
227225
EOT
228226
fi

docker/rhel/Dockerfile

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,10 @@ rm -rf /tmp/*
9898
EOF
9999

100100
# Fix the C++ dialect.
101-
RUN sed -i -e 's|^compiler\.cppstd=.*$|compiler.cppstd=20|' ${CONAN_HOME}/profiles/default
101+
RUN sed -i -e 's|^compiler\.cppstd=.*$|compiler.cppstd=20|' $(conan config home)/profiles/default
102102
# Explicitly set the compiler flags.
103103
RUN <<EOF
104-
cat >>${CONAN_HOME}/profiles/default <<EOT
105-
[conf]
104+
cat >> $(conan config home)/global.conf <<EOT
106105
tools.build:compiler_executables={"c": "${CC}", "cpp": "${CXX}"}
107106
EOT
108107
EOF
@@ -117,7 +116,7 @@ std::string f() { return "_" + std::string(" "); }
117116
EOT
118117
${CXX} -std=c++20 -Wall -Werror -O3 -c main.cpp || touch fail
119118
if [[ -f fail ]]; then
120-
cat >>~/.conan2/profiles/default <<EOT
119+
cat >> $(conan config home)/global.conf <<EOT
121120
tools.build:cxxflags=['-Wno-restrict']
122121
EOT
123122
fi
@@ -181,20 +180,19 @@ rm -rf /tmp/*
181180
EOF
182181

183182
# Fix the C++ dialect.
184-
RUN sed -i -e 's|^compiler\.cppstd=.*$|compiler.cppstd=20|' ${CONAN_HOME}/profiles/default
183+
RUN sed -i -e 's|^compiler\.cppstd=.*$|compiler.cppstd=20|' $(conan config home)/profiles/default
185184
# Explicitly set the compiler flags. To ensure compatibility with a range of
186185
# Clang compilers, we must also add extra flags that apply to certain versions
187186
# of Clang.
188187
# TODO: Move extra flags into the rippled repository as a custom Conan profile.
189188
RUN <<EOF
190189
CXX_VER=$(${CXX} -dumpversion)
191190
CXX_VER=${CXX_VER%%.*}
192-
cat >>${CONAN_HOME}/profiles/default <<EOT
193-
[conf]
191+
cat >> $(conan config home)/global.conf <<EOT
194192
tools.build:compiler_executables={"c": "${CC}", "cpp": "${CXX}"}
195193
EOT
196194
if [[ ${CXX_VER} -ge 19 ]]; then
197-
cat >>${CONAN_HOME}/profiles/default <<EOT
195+
cat >> $(conan config home)/global.conf <<EOT
198196
tools.build:cxxflags=['-Wno-missing-template-arg-list-after-template-kw']
199197
EOT
200198
fi

docker/ubuntu/Dockerfile

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,10 @@ rm -rf /tmp/*
115115
EOF
116116

117117
# Fix the C++ dialect.
118-
RUN sed -i -e 's|^compiler\.cppstd=.*$|compiler.cppstd=20|' ~/.conan2/profiles/default
118+
RUN sed -i -e 's|^compiler\.cppstd=.*$|compiler.cppstd=20|' $(conan config home)/profiles/default
119119
# Explicitly set the compiler flags.
120120
RUN <<EOF
121-
cat >>~/.conan2/profiles/default <<EOT
122-
[conf]
121+
cat >> $(conan config home)/global.conf <<EOT
123122
tools.build:compiler_executables={"c": "${CC}", "cpp": "${CXX}"}
124123
EOT
125124
EOF
@@ -134,7 +133,7 @@ std::string f() { return "_" + std::string(" "); }
134133
EOT
135134
${CXX} -std=c++20 -Wall -Werror -O3 -c main.cpp || touch fail
136135
if [[ -f fail ]]; then
137-
cat >>~/.conan2/profiles/default <<EOT
136+
cat >> $(conan config home)/global.conf <<EOT
138137
tools.build:cxxflags=['-Wno-restrict']
139138
EOT
140139
fi
@@ -202,20 +201,19 @@ rm -rf /tmp/*
202201
EOF
203202

204203
# Fix the C++ dialect.
205-
RUN sed -i -e 's|^compiler\.cppstd=.*$|compiler.cppstd=20|' ~/.conan2/profiles/default
204+
RUN sed -i -e 's|^compiler\.cppstd=.*$|compiler.cppstd=20|' $(conan config home)/profiles/default
206205
# Explicitly set the compiler flags. To ensure compatibility with a range of
207206
# Clang compilers, we must also add extra flags that apply to certain versions
208207
# of Clang.
209208
# TODO: Move extra flags into the rippled repository as a custom Conan profile.
210209
RUN <<EOF
211210
CXX_VER=$(${CXX} -dumpversion)
212211
CXX_VER=${CXX_VER%%.*}
213-
cat >>~/.conan2/profiles/default <<EOT
214-
[conf]
212+
cat >> $(conan config home)/global.conf <<EOT
215213
tools.build:compiler_executables={"c": "${CC}", "cpp": "${CXX}"}
216214
EOT
217215
if [[ ${CXX_VER} -ge 19 ]]; then
218-
cat >>~/.conan2/profiles/default <<EOT
216+
cat >> $(conan config home)/global.conf <<EOT
219217
tools.build:cxxflags=['-Wno-missing-template-arg-list-after-template-kw']
220218
EOT
221219
fi

0 commit comments

Comments
 (0)