meson: Don't search for python3 twice
authorNirbheek Chauhan <nirbheek@centricular.com>
Fri, 16 Dec 2016 18:15:08 +0000 (23:45 +0530)
committerNirbheek Chauhan <nirbheek@centricular.com>
Fri, 16 Dec 2016 18:30:11 +0000 (00:00 +0530)
gst/parse/meson.build
meson.build

index 5370397..3b88321 100644 (file)
@@ -1,11 +1,5 @@
 cc = meson.get_compiler('c')
 
-py3 = find_program('python3', required : false)
-if not py3.found()
-  # Maybe 'python' is Python 3
-  py3 = find_program('python')
-endif
-
 # Find flex, configure lex generator
 flex_cdata = configuration_data()
 
index 034c740..d5be4c5 100644 (file)
@@ -364,6 +364,13 @@ if libtype == 'static'
   gst_c_args += ['-DGST_STATIC_COMPILATION']
 endif
 
+# Used in gst/parse/meson.build and below
+py3 = find_program('python3', required : false)
+if not py3.found()
+  # Maybe 'python' is Python 3
+  py3 = find_program('python')
+endif
+
 subdir('gst')
 subdir('libs')
 subdir('plugins')
@@ -384,5 +391,4 @@ else
   endif
 endif
 
-python3 = find_program('python3')
-run_command(python3, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")')
+run_command(py3, '-c', 'import shutil; shutil.copy("hooks/pre-commit.hook", ".git/hooks/pre-commit")')