Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build with c++17 support #18403

Merged
merged 7 commits into from
Sep 19, 2020
Merged

Build with c++17 support #18403

merged 7 commits into from
Sep 19, 2020

Conversation

lrusak
Copy link
Contributor

@lrusak lrusak commented Sep 10, 2020

Let's see how this goes. Now with the RPi toolchain out of the way we only may have to update the one build box to Ubuntu 18.04. (done).

@lrusak lrusak added Type: Improvement non-breaking change which improves existing functionality Component: Depends CMake v19 Matrix labels Sep 10, 2020
@lrusak lrusak added this to the Matrix 19.0-alpha 2 milestone Sep 10, 2020
@garbear
Copy link
Member

garbear commented Sep 11, 2020

you'll want garbear@cpp17

@garbear
Copy link
Member

garbear commented Sep 11, 2020

I tried building on ubuntu 18.04. I'm getting the following error building libinput:

The Meson build system
Version: 0.55.1
Source dir: tools/depends/target/libinput/x86_64-linux-gnu-debug
Build dir: tools/depends/target/libinput/x86_64-linux-gnu-debug/build
Build type: cross build
Project name: libinput
Project version: 1.10.5
C compiler for the build machine: ccache cc (gcc 7.5.0 "cc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0")
C linker for the build machine: cc ld.bfd 2.30
C++ compiler for the build machine: ccache c++ (gcc 7.5.0 "c++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0")
C++ linker for the build machine: c++ ld.bfd 2.30
Using 'CFLAGS' from environment with value: ''
C compiler for the host machine: /usr/bin/gcc (gcc 7.5.0 "gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0")
C linker for the host machine: /usr/bin/gcc ld.bfd 2.30

meson.build:1:0: ERROR: Unknown compiler(s): [['-std=c++17']]
The follow exceptions were encountered:
Running "-std=c++17 --version" gave "[Errno 2] No such file or directory: '-std=c++17'"

A full log can be found at tools/depends/target/libinput/x86_64-linux-gnu-debug/build/meson-logs/meson-log.txt
Makefile:38: recipe for target 'x86_64-linux-gnu-debug' failed
make: *** [x86_64-linux-gnu-debug] Error 1

When I revert this PR libinput builds successfully.

@lrusak
Copy link
Contributor Author

lrusak commented Sep 11, 2020

@garbear I just pushed a commit before you commented that should fix that issue (hopefully)

@garbear
Copy link
Member

garbear commented Sep 11, 2020

I believe I tried with 5d80d13 and it didn't fix the problem.

@lrusak
Copy link
Contributor Author

lrusak commented Sep 11, 2020

I believe I tried with 5d80d13 and it didn't fix the problem.

You'll need to rerun ./bootstrap and your ./configure command in order for it to be regenerated

@garbear
Copy link
Member

garbear commented Sep 11, 2020

I found I had to do a git clean -xdf tools/depends. I'll let you know how this goes

@garbear
Copy link
Member

garbear commented Sep 11, 2020

Runtime tested on x11. macos is building as we speak.

I get build warnings when building target depends, but I get the same warnings on master too:

Makefile:200: warning: overriding recipe for target 'linux-system-libs'
Makefile:160: warning: ignoring old recipe for target 'linux-system-libs'
Makefile:222: warning: overriding recipe for target 'meson-cross-file'
Makefile:160: warning: ignoring old recipe for target 'meson-cross-file'

@lrusak
Copy link
Contributor Author

lrusak commented Sep 12, 2020

Yay!, we had a good build.

I'm not happy with the configure.ac changes though. I'm using the upstream ax_cxx_compile_stdcxx.m4 and it does some weird things like appends -std=c++17 to the CXX variable instead of the CXXFLAGS. So that is why I had to cache the CXX variable before running the macro. I also had to move the macro to be called later so that the CXXFLAGS can be set for platforms already (needed for -isysroot on apple platforms).

I also still need approval for some upstream package changes:

@fuzzard
Copy link
Contributor

fuzzard commented Sep 13, 2020

Let me have a play with the apple side of things. In Big Sur (and xcode 12) sysroot will be required for both native and target building, therefore we will possibly need to change some of the apple ordering. This may make relocating the search unnecessary.

@fuzzard
Copy link
Contributor

fuzzard commented Sep 13, 2020

Im thinking something along these lines

https://paste.kodi.tv/efayisigik

As mentioned above, the apple world WILL need isysroot to be set for native depends in the very near future. Still have to use a temp cache for the CXXFLAGS, as we dont want it to pollute flags for the build. ie all flags, (CFLAGS, CXXFLAGS, LDFLAGS) end up being passed through to target platform flags. we only want it for testing the compiler capabilities initially. We then AC_SUBST the native sysroot, and add that sysroot to our config.native.in for our dependencies to use later

docs/README.FreeBSD.md Outdated Show resolved Hide resolved
docs/README.Linux.md Outdated Show resolved Hide resolved
@lrusak
Copy link
Contributor Author

lrusak commented Sep 18, 2020

Objections?

ksooo added a commit to ksooo/xbmc that referenced this pull request Oct 22, 2020
ksooo added a commit to ksooo/xbmc that referenced this pull request Oct 23, 2020
ksooo added a commit to ksooo/xbmc that referenced this pull request Oct 24, 2020
ksooo added a commit to ksooo/xbmc that referenced this pull request Oct 24, 2020
ksooo added a commit to ksooo/xbmc that referenced this pull request Oct 24, 2020
ksooo added a commit to ksooo/xbmc that referenced this pull request Oct 24, 2020
ksooo added a commit to ksooo/xbmc that referenced this pull request Oct 25, 2020
ksooo added a commit to ksooo/xbmc that referenced this pull request Oct 25, 2020
ksooo added a commit to ksooo/xbmc that referenced this pull request Oct 26, 2020
ksooo added a commit to ksooo/xbmc that referenced this pull request Oct 26, 2020
ksooo added a commit to ksooo/xbmc that referenced this pull request Oct 26, 2020
ksooo added a commit to ksooo/xbmc that referenced this pull request Oct 26, 2020
ksooo added a commit to ksooo/xbmc that referenced this pull request Oct 28, 2020
ksooo added a commit to ksooo/xbmc that referenced this pull request Oct 31, 2020
ksooo added a commit to ksooo/xbmc that referenced this pull request Oct 31, 2020
ksooo added a commit to ksooo/xbmc that referenced this pull request Oct 31, 2020
ksooo added a commit to ksooo/xbmc that referenced this pull request Nov 5, 2020
ksooo added a commit to ksooo/xbmc that referenced this pull request Nov 6, 2020
ksooo added a commit to ksooo/xbmc that referenced this pull request Nov 8, 2020
lrusak added a commit to lrusak/xbmc that referenced this pull request Dec 18, 2021
@lrusak lrusak mentioned this pull request Dec 19, 2021
lrusak added a commit to lrusak/xbmc that referenced this pull request Dec 19, 2021
howie-f pushed a commit to howie-f/xbmc that referenced this pull request Dec 19, 2021
howie-f pushed a commit to howie-f/xbmc that referenced this pull request Dec 19, 2021
lrusak added a commit to lrusak/xbmc that referenced this pull request Dec 19, 2021
lrusak added a commit to lrusak/xbmc that referenced this pull request Dec 19, 2021
lrusak added a commit to lrusak/xbmc that referenced this pull request Dec 19, 2021
lrusak added a commit to lrusak/xbmc that referenced this pull request Dec 19, 2021
lrusak added a commit to lrusak/xbmc that referenced this pull request Dec 21, 2021
This reverts commit bd6818f.

This also includes a fix for the following:

    CLog: fix SPDLOG_LEVEL_NAMES to allow compiling

    Otherwise the following error occurs:

    xbmc/utils/log.h:12:89: error: ‘constexpr fmt::v8::basic_string_view<Char>::basic_string_view(const Char*) [with Char = char]’ called in a constant expression
       12 | #define SPDLOG_LEVEL_NAMES {"TRACE", "DEBUG", "INFO", "WARNING", "ERROR", "FATAL", "OFF"};
          |                                                                                         ^
    In file included from /usr/include/fmt/format.h:44,
                     from xbmc/utils/StringUtils.h:37,
                     from xbmc/utils/log.h:19,
    /usr/include/fmt/core.h:460:3: note: ‘constexpr fmt::v8::basic_string_view<Char>::basic_string_view(const Char*) [with Char = char]’ is not usable as a ‘constexpr’ function because:
      460 |   basic_string_view(const Char* s) : data_(s) {
          |   ^~~~~~~~~~~~~~~~~
    /usr/include/fmt/core.h:460:3: error: member ‘fmt::v8::basic_string_view<char>::size_’ must be initialized by mem-initializer in ‘constexpr’ constructor
    /usr/include/fmt/core.h:439:10: note: declared here
      439 |   size_t size_;
          |          ^~~~~
joseluismarti pushed a commit to joseluismarti/xbmc that referenced this pull request Apr 15, 2022
This reverts commit bd6818f.

This also includes a fix for the following:

    CLog: fix SPDLOG_LEVEL_NAMES to allow compiling

    Otherwise the following error occurs:

    xbmc/utils/log.h:12:89: error: ‘constexpr fmt::v8::basic_string_view<Char>::basic_string_view(const Char*) [with Char = char]’ called in a constant expression
       12 | #define SPDLOG_LEVEL_NAMES {"TRACE", "DEBUG", "INFO", "WARNING", "ERROR", "FATAL", "OFF"};
          |                                                                                         ^
    In file included from /usr/include/fmt/format.h:44,
                     from xbmc/utils/StringUtils.h:37,
                     from xbmc/utils/log.h:19,
    /usr/include/fmt/core.h:460:3: note: ‘constexpr fmt::v8::basic_string_view<Char>::basic_string_view(const Char*) [with Char = char]’ is not usable as a ‘constexpr’ function because:
      460 |   basic_string_view(const Char* s) : data_(s) {
          |   ^~~~~~~~~~~~~~~~~
    /usr/include/fmt/core.h:460:3: error: member ‘fmt::v8::basic_string_view<char>::size_’ must be initialized by mem-initializer in ‘constexpr’ constructor
    /usr/include/fmt/core.h:439:10: note: declared here
      439 |   size_t size_;
          |          ^~~~~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CMake Component: Depends Type: Improvement non-breaking change which improves existing functionality v19 Matrix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants