Skip to content

Specifying Language with Internal Dependencies #5723

@phillipjohnston

Description

@phillipjohnston

I have an internal dep which provides some compiler arguments. However, they should only be used with .cpp files and produce warning when applied to .c files.

Is there a good way for specifying a language with an internal dependency? I don't want to add to the global project options because you should only use the flags if you're consuming that particular dependency. If you set the flags and don't use the dependency, the build will fail.

libcxxabi_dep = declare_dependency(
	include_directories: include_directories('include/c++abi', is_system: true),
	link_with: libcxxabi,
	compile_args: stdlib_compiler_flags + cpp_stdlib_compiler_flags,
	link_args: stdlib_link_flags
)

Warning:

[656/1262] Compiling C object 'src/pro...rtos_src_portable_MemMang_heap_3.c.o'.
cc1: warning: command line option '-nostdinc++' is valid for C++/ObjC++ but not for C

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions