Skip to content

Commit cd90834

Browse files
Search for system mcpp on Linux
1 parent 5a00fa9 commit cd90834

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Malt/GL/Shader.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,14 @@ def shader_preprocessor(shader_source, include_directories=[], definitions=[]):
169169
dependencies_path = os.path.join(os.path.dirname(__file__), '..', f'.Dependencies-{py_version}')
170170
mcpp = os.path.join(dependencies_path, f'mcpp-{platform.system()}')
171171

172+
if platform.system() == "Linux":
173+
# Search for system mcpp
174+
for directory in os.get_exec_path():
175+
path = os.path.join(directory, "mcpp")
176+
if os.path.isfile(path) and os.access(path, os.X_OK):
177+
mcpp = path
178+
179+
172180
command = f'"{mcpp}"'
173181
command += ' -C' #keep comments
174182
for directory in include_directories:

0 commit comments

Comments
 (0)