layers: GH1922, Fix out-of-tree builds
authorMark Lobodzinski <mark@lunarg.com>
Mon, 3 Jul 2017 21:50:39 +0000 (15:50 -0600)
committerMark Lobodzinski <mark@lunarg.com>
Tue, 4 Jul 2017 20:52:30 +0000 (14:52 -0600)
Change-Id: I82bd4d1285a7ec69c7b8209937235f538375773a

layers/CMakeLists.txt
scripts/parameter_validation_generator.py

index 35a1b41..b591422 100644 (file)
@@ -60,6 +60,13 @@ if (WIN32)
                     )
             endforeach(config_file)
         endif()
+        # Copy vk_validation_error_messages.h from source to build dir for scripts to pick up
+        FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/vk_validation_error_messages.h src_val_msgs)
+        FILE(TO_NATIVE_PATH ${CMAKE_CURRENT_BINARY_DIR}/vk_validation_error_messages.h dst_val_msgs)
+        add_custom_target(vk_validation_error_messages ALL
+            COMMAND copy ${src_val_msgs} ${dst_val_msgs}
+            VERBATIM
+            )
     endif()
 else()
     # extra setup for out-of-tree builds
@@ -70,6 +77,11 @@ else()
                 VERBATIM
                 )
         endforeach(config_file)
+        # Add link to vk_validation_error_messages.h in build dir for scripts to pick up
+        add_custom_target(vk_validation_error_messages ALL
+            COMMAND ln -sf ${CMAKE_CURRENT_SOURCE_DIR}/vk_validation_error_messages.h
+            VERBATIM
+            )
     endif()
 endif()
 # If a layer has a direcgt dependency on a project with the same name, use it.
@@ -178,7 +190,7 @@ add_vk_layer(object_tracker object_tracker.cpp vk_layer_table.cpp)
 # generated
 add_vk_layer(threading threading.cpp thread_check.h vk_layer_table.cpp)
 add_vk_layer(unique_objects unique_objects.cpp unique_objects_wrappers.h vk_layer_table.cpp)
-add_vk_layer(parameter_validation parameter_validation.cpp parameter_validation.h vk_layer_table.cpp)
+add_vk_layer(parameter_validation parameter_validation.cpp parameter_validation.h vk_layer_table.cpp vk_validation_error_messages.h)
 
 # Core validation has additional dependencies
 target_include_directories(VkLayer_core_validation PRIVATE ${GLSLANG_SPIRV_INCLUDE_DIR})
index 38b0d88..49a002c 100644 (file)
@@ -173,6 +173,7 @@ class ParamCheckerOutputGenerator(OutputGenerator):
         self.vuid_file = None
         # Cover cases where file is built from scripts directory, Lin/Win, or Android build structure
         vuid_filename_locations = [
+            './vk_validation_error_messages.h',
             '../layers/vk_validation_error_messages.h',
             '../../layers/vk_validation_error_messages.h',
             '../../../layers/vk_validation_error_messages.h',