The version of the Vulkan-Headers used to generate the source code is what should be
used to set the version of the binary, rather than the version of the Vulkan-Headers
that is currently available. This commit checks that version into the repo so that
it is used, and adds the necessary python code to update it.
This behavior was previously in the repo but was broken by the update to use the
version parsing logic from the Vulkan-Headers.
project(Vulkan-Loader)
+# Gets the header version used during code generation
+include(cmake/generated_header_version.cmake)
+
if (UPDATE_DEPS)
find_package(PythonInterp 3 REQUIRED)
get_target_property(VulkanRegistry_DIR Vulkan::Registry INTERFACE_INCLUDE_DIRECTORIES)
add_custom_target(VulkanLoader_generated_source
COMMAND ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/scripts/generate_source.py
- ${VulkanRegistry_DIR} --incremental
- )
+ ${VulkanRegistry_DIR}
+ --generated-version ${VulkanHeaders_VERSION}
+ --incremental)
else()
message("WARNING: VulkanLoader_generated_source target requires python 3")
endif()
--- /dev/null
+# *** THIS FILE IS GENERATED - DO NOT EDIT ***
+# See generate_source.py for modifications
+set(LOADER_GENERATED_HEADER_VERSION 1.3.238)
\ No newline at end of file
add_dependencies(vulkan loader_asm_gen_files)
set_target_properties(vulkan
PROPERTIES SOVERSION "1"
- VERSION ${VulkanHeaders_VERSION})
+ VERSION ${LOADER_GENERATED_HEADER_VERSION})
target_link_libraries(vulkan PRIVATE ${CMAKE_DL_LIBS} m)
if (NOT ANDROID)
target_link_libraries(vulkan PRIVATE Threads::Threads)
OUTPUT_NAME vulkan
FRAMEWORK TRUE
FRAMEWORK_VERSION A
- VERSION "${VulkanHeaders_VERSION}" # "current version"
+ VERSION "${LOADER_GENERATED_HEADER_VERSION}" # "current generated version"
SOVERSION "1.0.0" # "compatibility version"
MACOSX_FRAMEWORK_IDENTIFIER com.lunarg.vulkanFramework
PUBLIC_HEADER "${FRAMEWORK_HEADERS}"
# Generate pkg-config file.
find_package(PkgConfig QUIET)
if(PKG_CONFIG_FOUND)
- set(VK_API_VERSION "${VulkanHeaders_VERSION}")
+ set(VK_API_VERSION "${LOADER_GENERATED_HEADER_VERSION}")
set(PRIVATE_LIBS "")
if (APPLE AND BUILD_STATIC_LOADER)
# Libs.private should only be present when building a static loader
def main(argv):
parser = argparse.ArgumentParser(description='Generate source code for this repository')
parser.add_argument('registry', metavar='REGISTRY_PATH', help='path to the Vulkan-Headers registry directory')
+ parser.add_argument('--generated-version', help='sets the header version used to generate the repo')
group = parser.add_mutually_exclusive_group()
group.add_argument('-i', '--incremental', action='store_true', help='only update repo files that change')
group.add_argument('-v', '--verify', action='store_true', help='verify repo files match generator output')
print('update', repo_filename)
shutil.copyfile(temp_filename, repo_filename)
+ # write out the header version used to generate the code to a checked in CMake FIle
+ if args.generated_version:
+ f = open(common_codegen.repo_relative('cmake/generated_header_version.cmake'), "w")
+ f.write('# *** THIS FILE IS GENERATED - DO NOT EDIT ***\n')
+ f.write('# See generate_source.py for modifications\n')
+ f.write(f'set(LOADER_GENERATED_HEADER_VERSION {args.generated_version})')
+ f.close()
+
return 0
if __name__ == '__main__':