Ensure private directory exists for custom targets (#13196)
* Ensure private directory exists for custom targets Some custom target commands will expect the `@PRIVATE_DIR@` to already exist, such as with `make -C @PRIVATE_DIR@ ...` * Prefer `exist_ok` over catching exceptionpull/12043/merge
parent
a28dde40b5
commit
f5ec07e7c3
3 changed files with 21 additions and 8 deletions
@ -0,0 +1,16 @@ |
||||
project('277 custom target private dir') |
||||
|
||||
python = find_program('python3') |
||||
|
||||
custom_target( |
||||
'check-private-dir', |
||||
command: [ |
||||
python, |
||||
'-c', |
||||
'import os, sys; os.chdir(sys.argv[1]); open(sys.argv[2], "w")', |
||||
'@PRIVATE_DIR@', |
||||
'@OUTPUT@', |
||||
], |
||||
output: 'check-private-dir', |
||||
build_by_default: true, |
||||
) |
Loading…
Reference in new issue