Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. No gn found for cross-compilation
QtWS25 Last Chance

No gn found for cross-compilation

Scheduled Pinned Locked Moved Unsolved QtWebEngine
qtwebenginecrosscompilingraspberrypi
4 Posts 2 Posters 1.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    Wycer
    wrote on 2 Nov 2023, 19:06 last edited by Wycer 11 Feb 2023, 19:12
    #1

    Hi, I am trying to compile "qt-everywhere-src-6.6.0" and it fails at QtWebEngine module with the error "No gn found for cross-compilation".
    At first I had different errors which just were some missing packages. Now I try installing gn (generate-ninja) package but it didn't seem to solve it, also tried installing some packages I saw people on the internet telling it was required but still no luck.

    Here is my cmake code in case it is related:

    cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DQT_FEATURE_eglfs_egldevice=ON -DQT_FEATURE_eglfs_gbm=ON -DQT_BUILD_TOOLS_WHEN_CROSSCOMPILING=ON  -DQT_BUILD_EXAMPLES=OFF -DQT_BUILD_TESTS=OFF -DQT_HOST_PATH=/home/speeder/qt6Host -DCMAKE_STAGING_PREFIX=/home/speeder/qt6rpi -DCMAKE_INSTALL_PREFIX=/home/speeder/qt6crosspi -DCMAKE_PREFIX_PATH=/home/speeder/rpi-sdk/sysroot/usr/lib/ -DCMAKE_TOOLCHAIN_FILE=/home/speeder/qt-cross/toolchain.cmake /home/speeder/qt-cross/qt-everywhere-src-6.6.0/
    

    and here is my toolchain.cmake file code:

    cmake_minimum_required(VERSION 3.16)
    include_guard(GLOBAL)
    
    set(CMAKE_SYSTEM_NAME Linux)
    
    set(CMAKE_SYSTEM_PROCESSOR arm)
    
    set(TARGET_SYSROOT /home/speeder/rpi-sdk/sysroot)
    
    set(CROSS_COMPILER /opt/rpi/rpi-gcc-8.3.0/bin/arm-linux-gnueabihf)
    
    set(CMAKE_SYSROOT ${TARGET_SYSROOT})
    
    set(CMAKE_C_COMPILER ${CROSS_COMPILER}-gcc)
    set(CMAKE_CXX_COMPILER ${CROSS_COMPILER}-g++)
    
    set(CMAKE_LIBRARY_ARCHITECTURE arm-linux-gnueabihf)
    
    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fPIC -Wl,-rpath-link,${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} -L${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}")
    
    set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wl,-rpath-link,${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} -L${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}")
    
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wl,-rpath-link,${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE} -L${CMAKE_SYSROOT}/usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}")
    
    set(QT_COMPILER_FLAGS "-march=armv8-a -mfpu=crypto-neon-fp-armv8 -mtune=cortex-a72 -mfloat-abi=hard")
    set(QT_COMPILER_FLAGS_RELEASE "-O2 -pipe")
    set(QT_LINKER_FLAGS "-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed")
    
    set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
    set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
    set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
    set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
    
    set(CMAKE_THREAD_LIBS_INIT "-lpthread")
    set(CMAKE_HAVE_THREADS_LIBRARY 1)
    set(CMAKE_USE_WIN32_THREADS_INIT 0)
    set(CMAKE_USE_PTHREADS_INIT 1)
    set(THREADS_PREFER_PTHREAD_FLAG ON)
    

    I am clueless, forgive me if it's a dumb question as I am new to this all. Thank you for reading this far even if you didn't came up with a solution, appreciate the effort!

    Edit: if that's relevant I am using a Raspberry Pi 3 Model B+ running Bullseye. Here is the tutorial I used as my main guideline for the whole process

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SamiV123
      wrote on 2 Nov 2023, 19:12 last edited by
      #2

      gn is a Google build tool used to build the chromium/chrome project.

      https://gn.googlesource.com/gn

      If you don't need QtWebView it'll be 1000000x easier to just disable QtWebView in the build than start messing with gn and chromium build...

      W 1 Reply Last reply 2 Nov 2023, 19:19
      0
      • S SamiV123
        2 Nov 2023, 19:12

        gn is a Google build tool used to build the chromium/chrome project.

        https://gn.googlesource.com/gn

        If you don't need QtWebView it'll be 1000000x easier to just disable QtWebView in the build than start messing with gn and chromium build...

        W Offline
        W Offline
        Wycer
        wrote on 2 Nov 2023, 19:19 last edited by
        #3

        @SamiV123 I do need, main module of my project.
        I googled a lot and eventually found that link too, however I am not sure what to do next. I tried following their install process but still got the error, I tried installing using apt and also didn't work.
        If you can guilde me a little more that would be great! And thanks a lot for your time and effort :)

        S 1 Reply Last reply 2 Nov 2023, 19:24
        0
        • W Wycer
          2 Nov 2023, 19:19

          @SamiV123 I do need, main module of my project.
          I googled a lot and eventually found that link too, however I am not sure what to do next. I tried following their install process but still got the error, I tried installing using apt and also didn't work.
          If you can guilde me a little more that would be great! And thanks a lot for your time and effort :)

          S Offline
          S Offline
          SamiV123
          wrote on 2 Nov 2023, 19:24 last edited by
          #4

          @Wycer said in No gn found for cross-compilation:

          @SamiV123 I do need, main module of my project.
          I googled a lot and eventually found that link too, however I am not sure what to do next. I tried following their install process but still got the error, I tried installing using apt and also didn't work.
          If you can guilde me a little more that would be great! And thanks a lot for your time and effort :)

          Sorry, all I can offer is try following the chromium build instructions, if you can get your env to a point where you can build the chromium source then it should hopefully work for Qt as well.

          https://www.chromium.org/developers/how-tos/get-the-code/

          1 Reply Last reply
          0

          2/4

          2 Nov 2023, 19:12

          • Login

          • Login or register to search.
          2 out of 4
          • First post
            2/4
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved