Skip to content

Commit 601f8c6

Browse files
committed
- Remove c++11 flag from CONFIG (added by mkspecs/common/msvc-version.conf for every Visual Studio > 2012) when there is c++14, c++17 or c++20, in order to get homogeneous rules in our template pri files
- Add c++11 error message handling for msvc : conan compiler.cppstd setting doesn't support value = 11 - Add c++20 support for conan compiler.cppstd setting
1 parent d82457b commit 601f8c6

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

bcom_arch_define.pri

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ isEmpty(BCOM_TARGET_PLATFORM) {
9999
# Note : msvc version set to 14.1 for Visual Studio 2017 in order to separate version from msvc 2015!
100100
BCOM_COMPILER_VER = 14.1
101101
}
102+
}
103+
contains(CONFIG,c++14)|contains(CONFIG,c++1z)|contains(CONFIG,c++17)|contains(CONFIG,c++2a)|contains(CONFIG,c++20) {
104+
contains(CONFIG,c++11) {
105+
CONFIG -= c++11
106+
}
102107
}
103108
# note : when icl is used with msvc, the most important is the msvc compiler version!
104109
BCOM_TARGET_PLATFORM = win-$$basename(QMAKE_CC)-$$BCOM_COMPILER_VER

packagedependencies.pri

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,14 +300,21 @@ QMAKE_OBJECTIVE_CFLAGS += $${QMAKE_CXXFLAGS}
300300
}
301301
write_file($$_PRO_FILE_PWD_/build/conanfile.txt, CONANFILECONTENT)
302302
contains(CONFIG,c++11) {
303-
conanCppStd=11
303+
!msvc {
304+
conanCppStd=11
305+
} else {
306+
error("Invalid setting for conan : compiler.cppstd supported values for msvc are 14, 17, 20")
307+
}
304308
}
305309
contains(CONFIG,c++14) {
306310
conanCppStd=14
307311
}
308312
contains(CONFIG,c++1z)|contains(CONFIG,c++17) {
309313
conanCppStd=17
310314
}
315+
contains(CONFIG,c++2a)|contains(CONFIG,c++20) {
316+
conanCppStd=20
317+
}
311318
CONFIG += conan_basic_setup
312319
#conan install -o boost:shared=True -s build_type=Release -s cppstd=14 boost/1.68.0@conan/stable
313320
system(conan install $$_PRO_FILE_PWD_/build/conanfile.txt -s compiler.cppstd=$${conanCppStd} -s build_type=$${CONANBUILDTYPE} --build=missing -if $$_PRO_FILE_PWD_/build)

0 commit comments

Comments
 (0)