Skip to content

Commit 7c5291f

Browse files
committed
loader_test: Adjust runtime manifest generation so it works and produces a valid manifest.
This combined with earlier changes lets you run list against it.
1 parent 3bb0e8e commit 7c5291f

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

src/scripts/generate_runtime_manifest.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,19 @@ def main(argv):
4545
elif opt in ("-b", "--bad"):
4646
generate_badjson_jsons = True
4747

48+
file_text = '{\n'
49+
file_text += ' "file_format_version": "%s",\n' % cur_runtime_json_version
50+
file_text += ' "runtime": {\n'
51+
file_text += ' "library_path": "%s",\n' % library_location
52+
file_text += ' "functions": {\n'
53+
file_text += ' "xrNegotiateLoaderRuntimeInterface":\n'
54+
file_text += ' "xrNegotiateLoaderRuntimeInterface"\n'
55+
file_text += ' }\n'
56+
file_text += ' }\n'
57+
file_text += '}\n'
58+
with open(output_file, 'w') as f:
59+
f.write(file_text)
60+
4861
if generate_badjson_jsons:
4962
# Bad File format versions
5063
####################################

src/tests/loader_test/test_runtimes/CMakeLists.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ set_target_properties(test_runtime PROPERTIES FOLDER ${TESTS_FOLDER})
3434
add_dependencies(test_runtime
3535
xr_global_generated_files
3636
generate_openxr_header
37-
generated_rt_json_files
3837
)
3938
target_include_directories(test_runtime
4039
PRIVATE ${PROJECT_SOURCE_DIR}/src
@@ -85,8 +84,5 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
8584
)
8685
endif()
8786

88-
add_custom_target(generated_rt_json_files DEPENDS
89-
${PROJECT_BINARY_DIR}/src/tests/loader_test/resources/runtimes/test_runtime.json
90-
)
91-
set_target_properties(generated_rt_json_files PROPERTIES FOLDER ${CODEGEN_FOLDER})
92-
87+
# Add generated file to our sources so we depend on it, and thus trigger geenration.
88+
target_sources(test_runtime PRIVATE ${PROJECT_BINARY_DIR}/src/tests/loader_test/resources/runtimes/test_runtime.json)

0 commit comments

Comments
 (0)