Skip to content

Add support for relative compilerPath #1982

Closed

Description

@timedroid

Feature Request:
It appears compilerPath currently only supports an absolute path to the compiler.
Please add the ability to specify a path relative to ${workspaceRoot}.

Activity

  1. sean-mcmanus commented on May 11, 2018

    @sean-mcmanus
    Contributor

    Should be easy to add.

  2. ai-chen2050 commented on May 12, 2018

    @ai-chen2050

    you could temp to add ""${workspaceRoot}"", maybe it will work !

  3. raggi commented on Jul 3, 2018

    @raggi

    I would like this too, but I need a bit more than just the compiler path.

    Starting the string with e.g. ${workspaceRoot} to get to the clang binary works ok, but I also need to specify --sysroot and --target to get correct behavior.

    I would like for these settings to be split out a bit more:

    • minimally compilerPath: support repeated replacement of ${workspaceFolder} (this would enable me to make this work for e.g. a Zircon checkout).
    • consider adding "target" and "sysroot" as specific options in clang configuration.

    Example setting for me:

    {
                "compilerPath": "${workspaceFolder}/zircon/prebuilt/downloads/clang/bin/clang++ --sysroot=${workspaceFolder}/out/build-zircon/build-x64/sysroot --target=x86_64-fuchsia",
    }

    In my working version of the above setting, I have to hardcode the --sysroot path to my workspace folder.

    In the ideal case I would be able to parameterize out the x64 and x86_64 parts too.

  4. added
    fixedCheck the Milestone for the release in which the fix is or will be available.
    and removed
    help wantedCan be fixed in the public (open source) repo.
    on Aug 10, 2018
  5. sean-mcmanus commented on Aug 10, 2018

    @sean-mcmanus
    Contributor

    We've added the ability to use ${workspaceRoot}, ${workspaceFolder}, or ${vcpkgRoot} variables in the compilerPath for the next release...using ".." also works with those.

    James Tucker (@raggi) The sysroot/target in compile commands is being tracked in #1575 . The current workaround is to add the sysroot and target options to the compilerPath, which should work unless you have files that use different settings.

  6. sean-mcmanus commented on Aug 13, 2018

    @sean-mcmanus
    Contributor

    We're using #2397 to track enabling relative paths without explicitly using ${workspaceFolder}.

  7. sean-mcmanus commented on Aug 17, 2018

    @sean-mcmanus
    Contributor

    Fixed with 0.18.0 (requires usage of ${workspaceFolder}).

  8. locked and limited conversation to collaborators on Oct 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Language ServicebugfixedCheck the Milestone for the release in which the fix is or will be available.quick fix

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions