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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cmake cleanup #187

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Cmake cleanup #187

wants to merge 4 commits into from

Conversation

jwinarske
Copy link

Adds CMake support.

Builds on x86_64 host for both, as well as cross compiling with AGL SDK 10.0.0 aarch64.

dbus-cplusplus dispatcher .h changes are from this.

Only able to test on Ubuntu 20 Desktop with an Android 11 device. I don't own the Mazda in question. Connectivity with device was not dead solid, but I can get it to work 馃憤

@jwinarske jwinarske force-pushed the cmake_cleanup branch 14 times, most recently from 376b02f to 3aa19db Compare October 20, 2020 23:54
@jwinarske jwinarske force-pushed the cmake_cleanup branch 3 times, most recently from 7f73193 to 1811b0b Compare October 27, 2020 23:31
    build matrix
    clang warning fixes
@jwinarske
Copy link
Author

Current build can be found here

Only build issues with this PR are related to dbus-cplusplus and clang.

SDL and GTK can both be factored out using GLFW3. If this repo is active I'll consider doing the refactor work.

@silverchris
Copy link

I took a quick look, and can't tell if this is being built with the m3-toolchain, or not? I will have to test it out, but I know the Mazda 3 CMU is pretty outdated library wise, which may give us some trouble? All the libraries on it are from around 2012, and I doubt we can update them without the factory software getting very upset with us :)

@jwinarske
Copy link
Author

I will add m3 build to the pipeline matrix.

@silverchris
Copy link

silverchris commented Nov 10, 2020

I was doing some playing with this, and I think our toolchain needs both libunwind, and protobuf libraries installed.
I added them, and pushed the changes to my fork https://github.com/silverchris/m3-toolchain
The version of protobuf is up to date, so the protoc compiler used by the system will need to match 3.14.0-rc1

And this is what I did to your cmake files to make them work for the toolchain https://github.com/silverchris/headunit/tree/cmake
There are probably a lot of mistakes/non-optimal things in mine, as I don't really know cmake that well, and are mostly the result of trying things and seeing what sticks. Hopefully it is somewhat helpful to you

@jwinarske
Copy link
Author

@silverchris cool I'll keep your changes in mind

@jwinarske
Copy link
Author

@silverchris there are quite a few more missing dependencies. List is below. For Mazda build it's currently failing to find SDL2. I think the proper way is to have the headunit app as an external project. This would allow building all the dependencies correctly.

In theory quite a bit of the binaries are not needed to cross compile for Mazda. They should be built as a dependency of headunit.

The X11 and GTK3 dependency can be factored out with some minor re-work.

find_package(Threads REQUIRED)
find_package(OpenSSL REQUIRED)
find_package(Protobuf REQUIRED)
find_package(SDL2 REQUIRED)
find_package(ALSA REQUIRED)
find_package(X11 REQUIRED)

find_package(PkgConfig REQUIRED)
if(PKG_CONFIG_EXECUTABLE)

pkg_check_modules(GST REQUIRED gstreamer-1.0
                            gstreamer-video-1.0
                            gstreamer-app-1.0
                            gstreamer-audio-1.0
                            gstreamer-codecparsers-1.0)

pkg_check_modules(USB REQUIRED libusb-1.0)
pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
pkg_check_modules(UNWIND REQUIRED libunwind)
pkg_check_modules(UDEV REQUIRED libudev)

endif()

@silverchris
Copy link

@jwinarske Ya, we do not need SDL2, X11 or GTK on the Mazda build. They are only used for running on Ubuntu.
We only need for the Mazda target

  • Threads
  • OpenSSL
  • Protobuf
  • ALSA
  • gstreamer-0.10
  • libusb
  • libunwind
  • libudev
  • dbus-1
  • dbus-c++-1
  • dbus-c++-glib-1

The rest are only needed when compiling for Ubuntu.

We are somewhat limited on what libraries we can use for the Mazda build, as it shipped with glibc 2.11.1, which is rather dated now. Our toolchain also features a nice and ancient version of gcc at 4.9.1.

On an unrelated note, I have been trying to get glibc 2.11.1 to compile with a newer GCC, so I can try to build aasdk for the Mazda, as our dated GCC doesn't have proper support for C++14!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants