-
Notifications
You must be signed in to change notification settings - Fork 172
layers:Remove includes of vk_safe_struct.cpp #1866
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like it's getting there (finally clean on travis!).
build-android/jni/Android.mk
Outdated
@@ -38,6 +38,7 @@ LOCAL_SRC_FILES += $(SRC_DIR)/layers/descriptor_sets.cpp | |||
LOCAL_SRC_FILES += $(SRC_DIR)/layers/buffer_validation.cpp | |||
LOCAL_SRC_FILES += $(SRC_DIR)/layers/shader_validation.cpp | |||
LOCAL_SRC_FILES += $(SRC_DIR)/layers/vk_layer_table.cpp | |||
LOCAL_SRC_FILES += $(LAYER_DIR)/include/vk_safe_struct.cpp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't much like .cpp files in include/
46cf072
to
e67f6c8
Compare
I updated android codegen to put vk_safe_struct.cpp into "common" dir instead of "include" and use it from there in layer libs. |
0e0b433
to
96b139f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, the weird use of include for vk_safe_struct.cpp is still required to prevent visual studio from doing conflict file generation during parallel builds.
Perhaps the file should be changed to a generated .h header to match the way it is used.
@stroyan or we can move this down a level into a static lib, and have the layers depend on that? |
@stroyan, any reply to @chrisforbes? |
It would be nice to get back to using a proper add_library rule for using vk_safe_struct.cpp.
I don't have a system available right now to confirm if visual studio does the right thing with that additional rule. |
96b139f
to
8e6e00e
Compare
Updated with WA suggested by @stroyan and re-testing. |
8e6e00e
to
9ed7746
Compare
After looking at these includes of vk_safe_struct.cpp I believe it was just a hack that worked and has persisted in the code. This change pulls the source into the layers that depend on it at build time and is a better solution, in my opinion. The one quirk is that the we now generate vk_struct.cpp in the base dir and in the layers dir. Since the file is required by some layer shared libs I had to generate in the layers dir, but there are also some dependencies on the file in the top-level dir that I didn't care to investigate further so I just genrate it in two places. I'm sure this could be cleaned up if someone with more cmake knowledge and/or patience than me cares to look into it further. For the android build updated the codegen to put vk_safe_struct.cpp in common dir so it could be added to libs from there.
Core validation and unique_objects layers both use generated safe_struct.cpp file. To prevent a potential build race condition on the windows build, add a dependency between those two layers.
9ed7746
to
88070f9
Compare
@tobine, this repository will close for write access on Sunday, 5/13/2018. If it is pushed before that time it will be present in the follow-on Vulkan-ValidationLayers repository on Monday, otherwise a new PR will be required in the new repo. |
After looking at these includes of vk_safe_struct.cpp I believe it was
just a hack that worked and has persisted in the code. This change
pulls the source into the layers that depend on it at build time and is
a better solution, in my opinion.
The one quirk is that the we now generate vk_struct.cpp in the base dir
and in the layers dir. Since the file is required by some layer shared
libs I had to generate in the layers dir, but there are also some
dependencies on the file in the top-level dir that I didn't care to
investigate further so I just genrate it in two places.
I'm sure this could be cleaned up if someone with more cmake knowledge
and/or patience than me cares to look into it further.