Comments (7)
To use C++20 in your project, either
- pass
-DCMAKE_CXX_STANDARD=20
tocmake
configure invocation, or - add
set(CMAKE_CXX_STANDARD 20)
to the beginning of yourCMakeLists.txt
.
Same with C++23.
from userver.
Continue investigation:
libuserver-core.a
has userver::enigne::impl::DoWaitAllChecked
entry
I do not add any additional linker options for this target (I guess)
verbose compile string:
[518/861] /usr/bin/ccache /usr/bin/c++ -DBOOST_ALL_NO_LIB -DBOOST_ATOMIC_DYN_LINK -DBOOST_CHRONO_DYN_LINK -DBOOST_ENABLE_ASSERT_HANDLER -DBOOST_FILESYSTEM_DYN_LINK -DBOOST_IOSTREAMS_DYN_LINK -DBOOST_LOCALE_DYN_LINK -DBOOST_PROGRAM_OPTIONS_DYN_LINK -DBOOST_REGEX_DYN_LINK -DBOOST_STACKTRACE_GNU_SOURCE_NOT_REQUIRED=1 -DBOOST_STACKTRACE_LINK -DBOOST_SYSTEM_DYN_LINK -DBOOST_THREAD_DYN_LINK -DCARES_STATICLIB -DPIC -DUSERVER -DUSERVER_NAMESPACE=userver -DUSERVER_NAMESPACE_BEGIN="namespace userver {" -DUSERVER_NAMESPACE_END=} -DUSERVER_USE_BOOST_DWCAS=1 -D_GLIBCXX_ASSERTIONS -I/home/ws/_build/_deps/userver-src/core/uboost_coro/include -I/home/ws/_build/_deps/userver-src/core/include -I/home/ws/_build/_deps/userver-src/third_party/pfr/include -I/home/ws/_build/_deps/userver-src/core/../universal/src -I/home/ws/_build/_deps/userver-src/core/src -I/home/ws/_build/userver/core -I/home/ws/_build/_deps/userver-src/universal/include -I/home/ws/_build/_deps/userver-src/third_party/date/include -I/home/ws/_build/_deps/userver-src/third_party/function_backports/include -I/home/ws/_build/_deps/fmt-src/include -I/home/ws/_build/_deps/cctz-src/include -I/home/ws/_build/_deps/userver-src/third_party/boost_stacktrace/include -I/home/ws/_build/_deps/userver-src/third_party/uboost_coro/include -I/home/ws/_build/_deps/c-ares-build -I/home/ws/_build/_deps/c-ares-src -I/home/ws/_build/_deps/c-ares-src/include -I/home/ws/_build/_deps/userver-src/universal -I/home/ws/_build/_deps/cryptopp-cmake-build/cryptopp -I/home/ws/_build/_deps/cryptopp-cmake-build -isystem /home/ws/_build/_deps/userver-src/core/libc_include_fixes -isystem /home/ws/_build/_deps/userver-src/third_party/moodycamel/include -g -std=c++17 -fvisibility-inlines-hidden -pipe -g -gz -fPIC -Wall -Wextra -Wpedantic -mcx16 -ftemplate-backtrace-limit=0 -Wdisabled-optimization -Winvalid-pch -Wlogical-op -Wformat=2 -Wno-error=deprecated-declarations -Wimplicit-fallthrough -Wno-useless-cast -fmacro-prefix-map=/home/ws//= -fmacro-prefix-map=/home/ws/_build//= -fmacro-prefix-map=/home/ws/= -MD -MT userver/core/CMakeFiles/userver-core.dir/src/engine/wait_all_checked.cpp.o -MF userver/core/CMakeFiles/userver-core.dir/src/engine/wait_all_checked.cpp.o.d -o userver/core/CMakeFiles/userver-core.dir/src/engine/wait_all_checked.cpp.o -c /home/ws/_build/_deps/userver-src/core/src/engine/wait_all_checked.cpp
In file included from /home/ws/_build/_deps/userver-src/core/src/engine/task/task_counter.hpp:9,
from /home/ws/_build/_deps/userver-src/core/src/engine/task/counted_coroutine_ptr.hpp:6,
from /home/ws/_build/_deps/userver-src/core/src/engine/task/task_context.hpp:15,
from /home/ws/_build/_deps/userver-src/core/src/engine/impl/wait_any_utils.hpp:7,
from /home/ws/_build/_deps/userver-src/core/src/engine/wait_all_checked.cpp:5:
/home/ws/_build/_deps/userver-src/core/src/concurrent/impl/interference_shield.hpp:12:10: warning: use of ‘std::hardware_destructive_interference_size’ [-Winterference-size]
12 | std::hardware_destructive_interference_size;
| ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/ws/_build/_deps/userver-src/core/src/concurrent/impl/interference_shield.hpp:12:10: note: its value can vary between compiler versions or with different ‘-mtune’ or ‘-mcpu’ flags
/home/ws/_build/_deps/userver-src/core/src/concurrent/impl/interference_shield.hpp:12:10: note: if this use is part of a public ABI, change it to instead use a constant variable you define
/home/ws/_build/_deps/userver-src/core/src/concurrent/impl/interference_shield.hpp:12:10: note: the default value for the current CPU tuning is 64 bytes
/home/ws/_build/_deps/userver-src/core/src/concurrent/impl/interference_shield.hpp:12:10: note: you can stabilize this value with ‘--param hardware_destructive_interference_size=64’, or disable this warning with ‘-Wno-interference-size’
from userver.
userver/core$ grep -r DoWaitAllChecked .
grep: ./libuserver-core.a: binary file matches
grep: ./CMakeFiles/userver-core.dir/src/engine/wait_all_checked.cpp.o: binary file matches
as expected
from userver.
I found it!
target_compile_features(${PRJ_TARGET} PUBLIC cxx_std_20)
break all the linking
there is minimal project
from userver.
Looks like my code with C++20 after header parsing expected std::span<> usage, but userver compiles with internal span class (userver-src/universal/include/userver/utils/span.hpp)
Can I use C++20 with userver? Can I set C++20 through CPM?
from userver.
target_compile_features(userver-universal PUBLIC cxx_std_20)
target_compile_features(userver-core PUBLIC cxx_std_20)
fixes it
but... maybe
Should userver build system use system-wide settings if it satisfies, for example, C++STD not less than 17? Then use system wide, if not - use C++17 at least to build
from userver.
ok. Think it is not bug, but consider it somewhere in documentation, which standard use and how.
from userver.
Related Issues (20)
- Fix the test_network_limit_time* tests
- Get rid of default-secdist-provider component
- Support `#file` in YamlConfig to read values from file
- Support zstd compression in HTTP client and server
- Implement a redis_grpc_service_template
- Implement a mongo_grpc_service_template
- Add support to get `grpc::StatusCode` from `stream.Finish()`
- Is there best approach to add my custom env variables for my project?
- Force update cache for auth via postgresql
- CPack
- Teach GetAll and WaitAny to work with SharedTaskWithResult HOT 1
- BUG: MacOS arm64
- BUG 2: MacOS arm64
- BUG: Turn off `USERVER_FEATURE_UBOOST_CORO` when install `userver`
- USERVER_FEATURE_PATCH_LIBPQ fails to build with Postgresql16 HOT 1
- Support minItems and maxItems array properties in static config
- SpscQueue race condition bug HOT 2
- Link static all
- Update mongo-c driver version
- Account for PATH in ProcessStarter::Exec
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from userver.