From a14eba27a9d68fa128dbcb9d4f4fd4d4a4e70f09 Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Fri, 3 Feb 2017 17:21:08 +0530 Subject: ninja: Delete output static lib before calling `ar` Otherwise if the list of sources changes on reconfigure after building, the static library will contain both the old and new objects. Closes https://github.com/mesonbuild/meson/issues/1355 --- test cases/common/3 static/libfile2.c | 3 +++ test cases/common/3 static/meson.build | 3 ++- test cases/common/3 static/meson_options.txt | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 test cases/common/3 static/libfile2.c create mode 100644 test cases/common/3 static/meson_options.txt (limited to 'test cases') diff --git a/test cases/common/3 static/libfile2.c b/test cases/common/3 static/libfile2.c new file mode 100644 index 000000000..86bbb2c35 --- /dev/null +++ b/test cases/common/3 static/libfile2.c @@ -0,0 +1,3 @@ +int libfunc2() { + return 4; +} diff --git a/test cases/common/3 static/meson.build b/test cases/common/3 static/meson.build index 3dee93b78..e53995649 100644 --- a/test cases/common/3 static/meson.build +++ b/test cases/common/3 static/meson.build @@ -1,3 +1,4 @@ project('static library test', 'c') -lib = static_library('mylib', 'libfile.c', + +lib = static_library('mylib', get_option('source'), link_args : '-THISMUSTNOBEUSED') # Static linker needs to ignore all link args. diff --git a/test cases/common/3 static/meson_options.txt b/test cases/common/3 static/meson_options.txt new file mode 100644 index 000000000..7261a1992 --- /dev/null +++ b/test cases/common/3 static/meson_options.txt @@ -0,0 +1 @@ +option('source', type : 'combo', choices : ['libfile.c', 'libfile2.c'], value : 'libfile.c') -- cgit v1.2.3