Blob Blame History Raw
From 7fdea0243db634c7ea2262826778d4eac3e8eb29 Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Wed, 12 Oct 2016 20:58:33 -0400
Subject: [PATCH 10/10] Split generator @BASENAME@ at the first extension.

(cherry picked from commit 779788ad82166db028488f68ec90258d4ca63c7d)
---
 mesonbuild/build.py                           | 4 ++--
 test cases/common/118 allgenerate/meson.build | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 1ef183b..23a5f4c 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -733,14 +733,14 @@ class Generator():
 
     def get_base_outnames(self, inname):
         plainname = os.path.split(inname)[1]
-        basename = plainname.split('.')[0]
+        basename = os.path.splitext(plainname)[0]
         return [x.replace('@BASENAME@', basename).replace('@PLAINNAME@', plainname) for x in self.outputs]
 
     def get_dep_outname(self, inname):
         if self.depfile is None:
             raise InvalidArguments('Tried to get dep name for rule that does not have dependency file defined.')
         plainname = os.path.split(inname)[1]
-        basename = plainname.split('.')[0]
+        basename = os.path.splitext(plainname)[0]
         return self.depfile.replace('@BASENAME@', basename).replace('@PLAINNAME@', plainname)
 
     def get_arglist(self):
diff --git a/test cases/common/118 allgenerate/meson.build b/test cases/common/118 allgenerate/meson.build
index 1ec93e6..36abbe9 100644
--- a/test cases/common/118 allgenerate/meson.build	
+++ b/test cases/common/118 allgenerate/meson.build	
@@ -5,7 +5,7 @@ project('all sources generated', 'c', 'cpp')
 comp = find_program('converter.py')
 
 g = generator(comp,
-  output : '@BASENAME@.cpp',
+  output : '@BASENAME@',
   arguments : ['@INPUT@', '@OUTPUT@'])
 
 c = g.process('foobar.cpp.in')
@@ -17,4 +17,4 @@ c2 = custom_target('c2gen',
   input : 'foobar.cpp.in',
   command : [comp, '@INPUT@', '@OUTPUT@'])
 
-prog2 = executable('genexe2', c2)
\ No newline at end of file
+prog2 = executable('genexe2', c2)
-- 
2.10.1