Giter Club home page Giter Club logo

Comments (7)

Anton3 avatar Anton3 commented on June 9, 2024 1

To use C++20 in your project, either

  • pass -DCMAKE_CXX_STANDARD=20 to cmake configure invocation, or
  • add set(CMAKE_CXX_STANDARD 20) to the beginning of your CMakeLists.txt.

Same with C++23.

from userver.

fregate avatar fregate commented on June 9, 2024

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.

fregate avatar fregate commented on June 9, 2024
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.

fregate avatar fregate commented on June 9, 2024

I found it!
target_compile_features(${PRJ_TARGET} PUBLIC cxx_std_20)
break all the linking
there is minimal project

cpmt.zip

from userver.

fregate avatar fregate commented on June 9, 2024

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.

fregate avatar fregate commented on June 9, 2024
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.

fregate avatar fregate commented on June 9, 2024

ok. Think it is not bug, but consider it somewhere in documentation, which standard use and how.

from userver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.