Skip to content

Commit 841e7fd

Browse files
committed
Move compiler options from profiles/default to global.conf
1 parent 128c7a2 commit 841e7fd

File tree

3 files changed

+11
-17
lines changed

3 files changed

+11
-17
lines changed

docker/debian/Dockerfile

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,7 @@ EOF
138138
RUN sed -i -e 's|^compiler\.cppstd=.*$|compiler.cppstd=20|' ~/.conan2/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
@@ -217,12 +216,11 @@ RUN sed -i -e 's|^compiler\.cppstd=.*$|compiler.cppstd=20|' ~/.conan2/profiles/d
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: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,7 @@ EOF
101101
RUN sed -i -e 's|^compiler\.cppstd=.*$|compiler.cppstd=20|' ${CONAN_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
@@ -189,12 +188,11 @@ RUN sed -i -e 's|^compiler\.cppstd=.*$|compiler.cppstd=20|' ${CONAN_HOME}/profil
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: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,7 @@ EOF
118118
RUN sed -i -e 's|^compiler\.cppstd=.*$|compiler.cppstd=20|' ~/.conan2/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
@@ -210,12 +209,11 @@ RUN sed -i -e 's|^compiler\.cppstd=.*$|compiler.cppstd=20|' ~/.conan2/profiles/d
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)