--- a/gst-libs/gst/vulkan/vulkan_mkenum.py
+++ b/gst-libs/gst/vulkan/vulkan_mkenum.py
@@ -5,7 +5,7 @@
 # make special characters such as \n go through all
 # backends is a fool's errand.
 
-import sys, subprocess
+import sys, subprocess, os
 
 h_array = ['--fhead',
            "#pragma once\n\n#include <gst/gst.h>\n#include <gst/vulkan/vulkan_fwd.h>\nG_BEGIN_DECLS\n",
@@ -37,7 +37,7 @@
 for arg in sys.argv[1:]:
     cmd.append(arg)
     argn += 1
-    if arg.endswith('glib-mkenums'):
+    if os.path.splitext(os.path.basename(arg))[0] == 'glib-mkenums':
         break
 ofilename = sys.argv[argn]
 headers = sys.argv[argn + 1:]
