Skip to content

[feature] Cuda flags #16532

Closed
Closed
@danielnilsson9

Description

@danielnilsson9

What is your suggestion?

When setting up conan for cross compiling you must pass a few extra flags when building with clang.

For c and c++ this can be done like this:

tools.build:sysroot=...
tools.build:cflags+=["--target=aarch64-linux-gnu"]
tools.build:cxxflags+=["--target=aarch64-linux-gnu"]
tools.build:exelinkflags+=["--target=aarch64-linux-gnu -fuse-ld=lld"]
tools.build:sharedlinkflags+=["--target=aarch64-linux-gnu -fuse-ld=lld"]

CMake has native language support for CUDA and I'm wondering if it would be a good idea to support passing cuda flags the same way?

tools.build:cudaflags+=["-target-dir aarch64-linux", "-Xcompiler --target=aarch64-linux-gnu"]

tools.build:cudaflags which would map to CMake variable CMAKE_CUDA_FLAGS_INIT.

I have no idea how it would apply to other build generators though..
I figures since cuda is supported in tools.build:compiler_executables it could be reasonable thing to support passing extra flags too.

Workaround for CMake is currently to create a user_toolchain and define it there but it is a bit more cumbersome.

Have you read the CONTRIBUTING guide?

  • I've read the CONTRIBUTING guide

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions