From 7bc57d03a59f0148ea84210ea3b424697c32fe3b Mon Sep 17 00:00:00 2001 From: Denis Fortin <71126069+DFOVIT@users.noreply.github.com> Date: Wed, 23 Jun 2021 09:33:38 +0200 Subject: build: fix object path for vs backend --- .../common/121 object only target/meson.build | 4 +++- .../121 object only target/objdir/meson.build | 27 ++++++++++++++++++++++ .../common/121 object only target/objdir/source4.c | 3 +++ .../common/121 object only target/objdir/source5.c | 3 +++ .../common/121 object only target/objdir/source6.c | 3 +++ test cases/common/121 object only target/prog.c | 6 ++++- 6 files changed, 44 insertions(+), 2 deletions(-) create mode 100644 test cases/common/121 object only target/objdir/meson.build create mode 100644 test cases/common/121 object only target/objdir/source4.c create mode 100644 test cases/common/121 object only target/objdir/source5.c create mode 100644 test cases/common/121 object only target/objdir/source6.c (limited to 'test cases/common') diff --git a/test cases/common/121 object only target/meson.build b/test cases/common/121 object only target/meson.build index e2ce43e..c3c4e52 100644 --- a/test cases/common/121 object only target/meson.build +++ b/test cases/common/121 object only target/meson.build @@ -43,7 +43,9 @@ generated2 = gen2.process(['source3.c']) stc = static_library('stc', generated2) -e = executable('prog', 'prog.c', link_with : [obj, shr, stc], +subdir('objdir') + +e = executable('prog', 'prog.c', link_with : [obj, shr, stc, subdirfilebuilt_obj, subdirfile_obj, subdirstr_obj], install : true) test('objgen', e) diff --git a/test cases/common/121 object only target/objdir/meson.build b/test cases/common/121 object only target/objdir/meson.build new file mode 100644 index 0000000..631c1a1 --- /dev/null +++ b/test cases/common/121 object only target/objdir/meson.build @@ -0,0 +1,27 @@ + +#mesonlib.File built +source4 = configure_file(input : 'source4.c', + output : 'source4' + ext, + command : [comp, cc, files('source4.c'), + join_paths(meson.current_build_dir(), 'source4' + ext)]) + +subdirfilebuilt_obj = static_library('subdirfilebuilt_obj', objects : source4) + + +#mesonlib.File not built +configure_file(input : 'source5.c', + output : 'source5' + ext, + command : [comp, cc, files('source5.c'), + join_paths(meson.current_build_dir(), 'source5' + ext)]) + +subdirfile_obj = static_library('subdirfile_obj', objects : files(meson.current_build_dir()/'source5' + ext)) + + +#str +configure_file(input : 'source6.c', + output : 'source6' + ext, + command : [comp, cc, files('source6.c'), + join_paths(meson.current_build_dir(), 'source6' + ext)]) + + +subdirstr_obj = static_library('subdirstr_obj', objects : meson.current_build_dir()/'source6' + ext) diff --git a/test cases/common/121 object only target/objdir/source4.c b/test cases/common/121 object only target/objdir/source4.c new file mode 100644 index 0000000..83f4fab --- /dev/null +++ b/test cases/common/121 object only target/objdir/source4.c @@ -0,0 +1,3 @@ +int func4_in_obj(void) { + return 0; +} diff --git a/test cases/common/121 object only target/objdir/source5.c b/test cases/common/121 object only target/objdir/source5.c new file mode 100644 index 0000000..c512fc3 --- /dev/null +++ b/test cases/common/121 object only target/objdir/source5.c @@ -0,0 +1,3 @@ +int func5_in_obj(void) { + return 0; +} diff --git a/test cases/common/121 object only target/objdir/source6.c b/test cases/common/121 object only target/objdir/source6.c new file mode 100644 index 0000000..adcf2cd --- /dev/null +++ b/test cases/common/121 object only target/objdir/source6.c @@ -0,0 +1,3 @@ +int func6_in_obj(void) { + return 0; +} diff --git a/test cases/common/121 object only target/prog.c b/test cases/common/121 object only target/prog.c index 9841180..a27663b 100644 --- a/test cases/common/121 object only target/prog.c +++ b/test cases/common/121 object only target/prog.c @@ -1,7 +1,11 @@ int func1_in_obj(void); int func2_in_obj(void); int func3_in_obj(void); +int func4_in_obj(void); +int func5_in_obj(void); +int func6_in_obj(void); int main(void) { - return func1_in_obj() + func2_in_obj() + func3_in_obj(); + return func1_in_obj() + func2_in_obj() + func3_in_obj() + + func4_in_obj() + func5_in_obj() + func6_in_obj(); } -- cgit v1.1