Skip to content

Commit 2397395

Browse files
committed
upgraded to new docker images
* added clang 14 tests * added clang with libstdc++ * fixed clang 14 build
1 parent f2d74d8 commit 2397395

File tree

9 files changed

+82
-20
lines changed

9 files changed

+82
-20
lines changed

.github/workflows/cmake_tests.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,13 @@ jobs:
3535
fail-fast: false
3636
matrix:
3737
include:
38-
- image: "arbmind/cmake-clang12:latest"
38+
- image: "arbmind/cmake-clang:3.22.3-13"
3939
preset: "clang"
40-
- image: "arbmind/cmake-clang13:latest"
40+
- image: "arbmind/cmake-clang:3.22.3-14"
4141
preset: "clang"
42-
- image: "arbmind/cmake-gcc11:latest"
42+
- image: "arbmind/cmake-clang-libstdcpp:3.22.3-14-11"
43+
preset: "clang-libstdcpp"
44+
- image: "arbmind/cmake-gcc:3.22.3-11"
4345
preset: "gcc"
4446

4547
steps:

.github/workflows/qbs_tests.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,12 @@ jobs:
1111
fail-fast: false
1212
matrix:
1313
include:
14-
- image: arbmind/qbs-clang10:qbs_v1.20.1
14+
- image: arbmind/qbs-clang:1.21.0-13
1515
build_args: "modules.cpp.cxxStandardLibrary:libc++ modules.cpp.staticLibraries:c++,c++abi"
16-
- image: arbmind/qbs-clang11:qbs_v1.20.1
16+
- image: arbmind/qbs-clang:1.21.0-14
1717
build_args: "modules.cpp.cxxStandardLibrary:libc++ modules.cpp.staticLibraries:c++,c++abi"
18-
- image: arbmind/qbs-clang12:qbs_v1.20.1
19-
build_args: "modules.cpp.cxxStandardLibrary:libc++ modules.cpp.staticLibraries:c++,c++abi"
20-
- image: arbmind/qbs-gcc11:qbs_v1.20.1
21-
build_args: ''
18+
- image: arbmind/qbs-clang-libstdcpp:1.21.0-14-11
19+
- image: arbmind/qbs-gcc:1.21.0-11
2220

2321
steps:
2422
- uses: actions/checkout@v2
@@ -28,7 +26,7 @@ jobs:
2826

2927
- name: Build and run Tests
3028
run: >-
31-
docker run --rm -v ${GITHUB_WORKSPACE}:/build -w /build
29+
docker run --rm -v ${GITHUB_WORKSPACE}:/project -w /project
3230
${{ matrix.image }}
3331
build
3432
--build-directory /tmp/build

.github/workflows/static_analyse.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
fail-fast: false
1212
matrix:
1313
include:
14-
- image: arbmind/cmake-clang12:latest
14+
- image: arbmind/cmake-clang:3.22.3-14
1515
preset: clang-analyze
1616

1717
steps:

CMakePresets.json

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,24 @@
3131
"name": "clang",
3232
"inherits": "multi-config",
3333
"displayName": "Clang",
34-
"description": "Recommended configuration for Clang",
34+
"description": "Recommended configuration for Clang with libc++",
3535
"cacheVariables": {
3636
"CMAKE_CXX_COMPILER": "clang++",
3737
"CMAKE_CXX_EXTENSIONS": false,
3838
"CMAKE_CXX_FLAGS": "-stdlib=libc++ -fsized-deallocation -Wall -Wextra -Werror --pedantic -ftemplate-backtrace-limit=0 -Wno-gnu-zero-variadic-macro-arguments"
3939
}
4040
},
41+
{
42+
"name": "clang-libstdcpp",
43+
"inherits": "multi-config",
44+
"displayName": "Clang",
45+
"description": "Recommended configuration for Clang with libstdcpp",
46+
"cacheVariables": {
47+
"CMAKE_CXX_COMPILER": "clang++",
48+
"CMAKE_CXX_EXTENSIONS": false,
49+
"CMAKE_CXX_FLAGS": "-stdlib=libstdc++ -fsized-deallocation -Wall -Wextra -Werror --pedantic -ftemplate-backtrace-limit=0 -Wno-gnu-zero-variadic-macro-arguments"
50+
}
51+
},
4152
{
4253
"name": "clang-analyze",
4354
"inherits": "multi-config",
@@ -84,6 +95,18 @@
8495
"configurePreset": "clang",
8596
"configuration": "Release"
8697
},
98+
{
99+
"name": "clang-libstdcpp-debug",
100+
"displayName": "Clang libstdc++ Debug Build",
101+
"configurePreset": "clang-libstdcpp",
102+
"configuration": "Debug"
103+
},
104+
{
105+
"name": "clang-libstdcpp-release",
106+
"displayName": "Clang libstdc++ Release Build",
107+
"configurePreset": "clang-libstdcpp",
108+
"configuration": "Release"
109+
},
87110
{
88111
"name": "gcc-debug",
89112
"displayName": "G++ Debug Build",
@@ -144,6 +167,20 @@
144167
"configurePreset": "clang",
145168
"configuration": "Release"
146169
},
170+
{
171+
"name": "test-clang-libstdcpp-debug",
172+
"inherits": "test-base",
173+
"displayName": "Test Clang libstdc++ Debug Build",
174+
"configurePreset": "clang-libstdcpp",
175+
"configuration": "Debug"
176+
},
177+
{
178+
"name": "test-clang-libstdcpp-release",
179+
"inherits": "test-base",
180+
"displayName": "Test Clang libstdc++ Release Build",
181+
"configurePreset": "clang-libstdcpp",
182+
"configuration": "Release"
183+
},
147184
{
148185
"name": "test-gcc-debug",
149186
"inherits": "test-base",

co-cpp19.qbs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,12 @@ Project {
7777
"helpers/partial19_natvis.sh",
7878
"helpers/tuple19_natvis.sh",
7979
"helpers/variant19_natvis.sh",
80+
"script/build_cmake.sh",
81+
"script/docker_run_cmake_clang.bat",
82+
"script/docker_run_cmake_gcc.bat",
83+
"script/docker_run_qbs_clang_autotest-runner.bat",
84+
"script/test_cmake.bat",
85+
"script/test_cmake.sh",
8086
]
8187
}
8288
}

src/coro19.lib/coro19/coroutine.h

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@
3434
# include <memory>
3535
# include <new>
3636
# endif // _STL_COMPILER_PREPROCESSOR
37-
# include <stddef.h>
3837
# include <cstdint>
3938
# include <exception> // std::current_exception
4039
# include <functional> // std::hash
40+
# include <stddef.h>
4141
# include <type_traits>
4242

4343
struct portable_coro_prefix;
@@ -226,9 +226,13 @@ template<class _Ret> struct coro_traits_sfinae<_Ret, void_t<typename _Ret::promi
226226
// there is no way but to define in `std::experimental` since compilers are checking it
227227
namespace experimental {
228228

229+
# if !defined(__clang__) || (__clang_major__ < 14)
230+
229231
// STRUCT TEMPLATE coroutine_traits
230232
template<typename _Ret, typename... _Ts> struct coroutine_traits : coro_traits_sfinae<_Ret> {};
231233

234+
# endif
235+
232236
# if defined(__clang__)
233237

234238
// clang: std::experimental::coroutine_handle must be a class template
@@ -272,10 +276,19 @@ template<typename _Ret, typename... _Ts> struct _Resumable_helper_traits {
272276

273277
} // namespace experimental
274278

279+
# if !defined(__clang__) || (__clang_major__ < 14)
280+
275281
// STRUCT TEMPLATE coroutine_traits
276282
template<typename _Ret, typename... _Param>
277283
using coroutine_traits = std::experimental::coroutine_traits<_Ret, _Param...>;
278284

285+
# else
286+
287+
// STRUCT TEMPLATE coroutine_traits
288+
template<typename _Ret, typename... _Ts> struct coroutine_traits : coro_traits_sfinae<_Ret> {};
289+
290+
# endif
291+
279292
// 17.12.3.7, hash support
280293
template<typename _PromiseT> struct hash<coroutine_handle<_PromiseT>> {
281294
// deprecated in C++17

src/enum19.lib/enum19/Enum.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ using string19::StringView;
3030

3131
template<class T> constexpr void metaEnumFor(ADL*, T*) {
3232
static_assert(std::is_enum_v<T>, "metaEnumFor can only work for an enum declared with ENUM19 macro!");
33-
static_assert((sizeof(T), false), "Declare enum class with ENUM19 macro to get access to metaEnum!");
33+
static_assert(sizeof(T) && false, "Declare enum class with ENUM19 macro to get access to metaEnum!");
3434
}
3535

3636
template<class T> constexpr auto meta_enum_for = metaEnumFor(adl, nullptr_to<T>);

src/meta19.lib/meta19/Type.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ namespace meta19 {
88
/// - nesting Type<Type<X>> is not allowed
99
/// - intentionally left without implementation to avoid compiler overhead for that
1010
template<class> struct Type;
11-
template<class T> struct Type<Type<T>> { static_assert((sizeof(T), false), "nested Type!"); };
11+
template<class T> struct Type<Type<T>> { static_assert(sizeof(T) && false, "nested Type!"); };
1212

1313
/// type value wrapper for any C++ type
1414
/// notes:

third_party/googletest.qbs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,17 @@ StaticLibrary {
4242

4343
Properties {
4444
condition: qbs.toolchain.contains('clang') || qbs.toolchain.contains('gcc')
45-
cpp.cxxFlags: base.concat(
46-
"-Wno-unused-parameter",
47-
"-Wno-missing-field-initializers",
48-
"-Wno-deprecated-copy"
49-
)
45+
cpp.cxxFlags: {
46+
var flags = base.concat(
47+
"-Wno-unused-parameter",
48+
"-Wno-missing-field-initializers",
49+
"-Wno-deprecated-copy"
50+
);
51+
if (qbs.toolchain.contains('gcc')) {
52+
flags.push("-Wno-maybe-uninitialized")
53+
}
54+
return flags;
55+
}
5056
}
5157

5258
Export {

0 commit comments

Comments
 (0)