#! python3 import os from pathlib import Path import shutil from umake import make class Config: CC = 'g++' APPS = ['test/example_gl'] IGNORE_APPS = [] JOB_COUNT = int(os.cpu_count() * 0.8) BIN_DIR = Path('bin') INCLUDE_DIR = Path('include') OBJECT_DIR = Path('obj') SOURCE_DIR = Path('src') COMMON_FLAGS = '-std=c++17 -fno-semantic-interposition' COMMON_DEBUG_FLAGS = '-g -DDEBUG' COMMON_RELEASE_FLAGS = '-O2' # -flto' COMPILE_FLAGS = f'-Wall -I{INCLUDE_DIR} `pkg-config --cflags glfw3 vulkan gl x11`' LINK_FLAGS = '-lpthread -ldl `pkg-config --libs glfw3 vulkan gl x11`' PRE_COMPILE_FUNCTION = None CPP_SOURCES = [filepath for filepath in SOURCE_DIR.rglob('*.cpp') if not filepath.name.startswith('.')] def main(): def pre_compile(): # Copying OpenGL shaders src_opengl_shader_path = Config.SOURCE_DIR / 'uui' / 'opengl' / 'shaders' for shader_path in ( list(src_opengl_shader_path.rglob('*.vert')) + list(src_opengl_shader_path.rglob('*.frag'))): out_path = (Config.BIN_DIR / shader_path.relative_to(Config.SOURCE_DIR)) if not out_path.parent.exists(): out_path.parent.mkdir(parents=True) shutil.copy(shader_path, out_path) # Config.PRE_COMPILE_FUNCTION = pre_compile make(Config) if __name__ == '__main__': main()