Uploaded image for project: 'Qt Visual Studio Tools'
  1. Qt Visual Studio Tools
  2. QTVSADDINBUG-1144

Add environment variables during build via WSL

XMLWordPrintable

    • Icon: Suggestion Suggestion
    • Resolution: Won't Do
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 3.0.2 (rev.02)
    • None
    • All

      Problem

      I am using Yocto Project to generate an sdk for the build. The sdk is in WSL and to use the sdk, you need to define many variables. When I build a project from Visual Studio, I only specify the path to sysroot and the path to the compiler, some cpp arguments, some ld arguments. This is not enough and the project is not compiled. The build failed at the qmake stage

      In the project settings, I didn't find where to set the WSL variables for the build.

      Possible solution

      Add a field to the project settings with the input of variables to be used in WSL or add a field with the path to the project settings.sh file with the necessary variables. Before starting the build, use these variables

      Alternative solution

      As a temporary solution, I made it so that variables are set when starting WSL. this is a solution on the WSL side

      1. Create /etc/profile.d/qt_variables.sh
      2. Add the necessary variables in file(for example export TESTVAR=Hello
      3. wsl --terminate
      4. PROFIT

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            ali.demiralp Ali Can Demiralp (Inactive)
            heimrich Karsten Heimrich
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes