From 4a4c64b3eaa139a7597fbe6db1a4b6721597e47b Mon Sep 17 00:00:00 2001 From: Mark Lobodzinski Date: Mon, 23 Jan 2017 09:08:20 -0700 Subject: [PATCH] cmake: Add common targets/rules for helper files Change-Id: I26244eaf04451fd7c3755563953c7b8ad3715613 --- CMakeLists.txt | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a22b4f..eea9b3a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -252,7 +252,7 @@ endif() set (PYTHON_CMD ${PYTHON_EXECUTABLE}) -# Define macros used across all subdirectories +# Define macro used for building vkxml generated files macro(run_vk_xml_generate dependency output) add_custom_command(OUTPUT ${output} COMMAND ${PYTHON_CMD} ${SCRIPTS_DIR}/lvl_genvk.py -registry ${SCRIPTS_DIR}/vk.xml ${output} @@ -260,6 +260,24 @@ macro(run_vk_xml_generate dependency output) ) endmacro() +# Custom target for generated vulkan helper file dependencies +add_custom_target(generate_helper_files DEPENDS + vk_dispatch_table_helper.h + vk_enum_string_helper.h + vk_struct_size_helper.h + vk_struct_size_helper.c + vk_safe_struct.h + vk_safe_struct.cpp + ) + +# Rules to build generated helper files +run_vk_xml_generate(helper_file_generator.py vk_safe_struct.h) +run_vk_xml_generate(helper_file_generator.py vk_safe_struct.cpp) +run_vk_xml_generate(helper_file_generator.py vk_struct_size_helper.h) +run_vk_xml_generate(helper_file_generator.py vk_struct_size_helper.c) +run_vk_xml_generate(helper_file_generator.py vk_enum_string_helper.h) +run_vk_xml_generate(dispatch_table_generator.py vk_dispatch_table_helper.h) + if(NOT WIN32) include(GNUInstallDirs) -- 2.7.4