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

Cross compile support for cpptools integration. #636

Merged

Conversation

bjosa
Copy link
Contributor

@bjosa bjosa commented Jan 19, 2019

Cross Compile support for cpptools integration

Added compile flags and sysroot to the compiler path for cpptools.

This change addresses [#637]

Generally all cross compiling toolchains that depend on special compiler flags and a sysroot. These flags have to be published to the cpptools compilePath option. The cpptools extension then parses the compiler with These flags for the right include paths and defines.

This changes cpptools integration

The following changes are proposed:

  • Add compile flags to cpptools compilePath
  • Add sysroot to cpptools compilePath

Added compile flags and sysroot to the compiler path
for cpptools.
@bjosa
Copy link
Contributor Author

bjosa commented Jan 19, 2019

Maybe related to #604, #599

src/cpptools.ts Show resolved Hide resolved
@msftclas
Copy link

msftclas commented Jul 15, 2019

CLA assistant check
All CLA requirements met.

@bobbrow bobbrow merged commit b3b6adf into microsoft:develop Jul 18, 2019
@icegood
Copy link

icegood commented Dec 2, 2020

I don't get how to use it. Please, update official documentation. At least I don't see any way to set sysroot somewhere in options.

@bjosa
Copy link
Contributor Author

bjosa commented Dec 2, 2020

Just provide a cmake-kits.json file with the specific settings for your toolchain. See the cmake-kits section of the documentation for more information.

Example cmake-kits entry with an CMake toolchain file. The CMake toolchain file of the sdk then defines the sysroot path and all neccessary compiler flags:

{
    "name": "arm-linux-gnueabihf",
    "toolchainFile": "/home/user/sdk/toolchain.cmake",
    "cmakeSettings": {
        "CMAKE_EXPORT_COMPILE_COMMANDS": "ON",
        "CMAKE_STAGING_PREFIX": "${workspaceFolder}/build/${buildKit}/out",
        "CMAKE_PREFIX_PATH": [
            "${workspaceFolder}/build/${buildKit}/out"
        ]
    },
    "preferredGenerator": {
        "name": "Ninja"
    }
}

@github-actions github-actions bot locked and limited conversation to collaborators Jan 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants