aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/templates/objcpptemplates.py
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2020-02-17 00:42:08 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2020-02-22 06:49:34 +0530
commit7f1d78f30479170baa749e179c70e85a62250b0f (patch)
tree0eb8153caeca9b1b05ca9cabdc26a2b56703f3b6 /mesonbuild/templates/objcpptemplates.py
parentbe486a2ec84f22052fba5ba16de136de00379966 (diff)
downloadmeson-7f1d78f30479170baa749e179c70e85a62250b0f.zip
meson-7f1d78f30479170baa749e179c70e85a62250b0f.tar.gz
meson-7f1d78f30479170baa749e179c70e85a62250b0f.tar.bz2
tests: Ensure that executable and library are named differently
On Windows, the basename is used to determine the name of the PDB file. So for a project called myproject, we will create myproject.dll and myproject.exe, both of which will have myproject.pdb. This is a file collision. Instead, append `_test`, similar to the C# template. Fixes AllPlatformTest.test_templates on MSVC. This became a hard error when we started listing PDBs in the implicit outputs list of ninja targets. Do the same for a test that was making the same mistake.
Diffstat (limited to 'mesonbuild/templates/objcpptemplates.py')
-rw-r--r--mesonbuild/templates/objcpptemplates.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/mesonbuild/templates/objcpptemplates.py b/mesonbuild/templates/objcpptemplates.py
index 329a568..2d71573 100644
--- a/mesonbuild/templates/objcpptemplates.py
+++ b/mesonbuild/templates/objcpptemplates.py
@@ -134,6 +134,7 @@ def create_lib_objcpp_sample(project_name, version):
lowercase_token = re.sub(r'[^a-z0-9]', '_', project_name.lower())
uppercase_token = lowercase_token.upper()
function_name = lowercase_token[0:3] + '_func'
+ test_exe_name = lowercase_token + '_test'
lib_h_name = lowercase_token + '.h'
lib_objcpp_name = lowercase_token + '.mm'
test_objcpp_name = lowercase_token + '_test.mm'
@@ -144,7 +145,7 @@ def create_lib_objcpp_sample(project_name, version):
'header_file': lib_h_name,
'source_file': lib_objcpp_name,
'test_source_file': test_objcpp_name,
- 'test_exe_name': lowercase_token,
+ 'test_exe_name': test_exe_name,
'project_name': project_name,
'lib_name': lowercase_token,
'test_name': lowercase_token,