Skip to content
Discussion options

You must be logged in to vote

You do not need to model this as a dependency of executable() if the directory only has to exist before compilation. It is configuration-time structure, not a generated build artifact.

The most Meson-native portable approach is to mirror the directory in the source tree:

project/
├── meson.build
└── asm/
    └── meson.build

asm/meson.build can be empty. In the root meson.build:

subdir('asm')

asm_dir = join_paths(meson.current_build_dir(), 'asm')

exe = executable(
  'my-program',
  sources,
  c_args: ['--asm-directory=' + asm_dir],
)

Processing subdir('asm') creates the corresponding directory below the build directory during Meson configuration, so it exists before Ninja starts compili…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
2 replies
@btuin
Comment options

@CedricConday
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by btuin
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants