Skip to content

Commit

Permalink
Fix path quoting in json generator
Browse files Browse the repository at this point in the history
GenerateLayerJson.cmake was wrapping paths with quotes and
add_custom_target COMMAND was escaping spaces in those paths
unconditionally, generating invalid paths:

/has spaces/ -> "/has spaces/" -> "/has\ spaces/"

Remove the extra quotes so the escaped spaces are correctly
interpreted by the shell:

/has spaces/ -> /has\ spaces/

Change-Id: I68e95104c3b470813c843eb68cdc31a4eec6691e
  • Loading branch information
mikes-lunarg authored and dustin-lunarg committed May 22, 2020
1 parent 5460762 commit 18a13b5
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cmake/GenerateLayerJson.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ function(GENERATE_LAYER_JSON_FILE TARGET RELATIVE_PATH_PREFIX LAYER_BINARY IN_FI
math(EXPR GFXRECONSTRUCT_LAYER_JSON_VERSION "${GFXRECONSTRUCT_PROJECT_VERSION_MAJOR} << 22 | ${GFXRECONSTRUCT_PROJECT_VERSION_MINOR} << 12 | ${GFXRECONSTRUCT_PROJECT_VERSION_PATCH}")

set(CONFIG_DEFINES
-DINPUT_FILE="${IN_FILE}"
-DVK_VERSION="${VULKAN_VERSION_MAJOR}.${VULKAN_VERSION_MINOR}.${VULKAN_VERSION_PATCH}"
-DGFXRECONSTRUCT_VERSION="${GFXRECONSTRUCT_LAYER_JSON_VERSION}"
-DGFXRECONSTRUCT_VERSION_STRING="${GFXRECONSTRUCT_PROJECT_VERSION_MAJOR}.${GFXRECONSTRUCT_PROJECT_VERSION_MINOR}.${GFXRECONSTRUCT_PROJECT_VERSION_PATCH}${GFXRECON_PROJECT_VERSION_DESIGNATION}"
-DOUTPUT_FILE="${OUT_FILE}"
-DRELATIVE_LAYER_BINARY="${RELATIVE_PATH_PREFIX}${LAYER_BINARY}"
-DINPUT_FILE=${IN_FILE}
-DVK_VERSION=${VULKAN_VERSION_MAJOR}.${VULKAN_VERSION_MINOR}.${VULKAN_VERSION_PATCH}
-DGFXRECONSTRUCT_VERSION=${GFXRECONSTRUCT_LAYER_JSON_VERSION}
-DGFXRECONSTRUCT_VERSION_STRING=${GFXRECONSTRUCT_PROJECT_VERSION_MAJOR}.${GFXRECONSTRUCT_PROJECT_VERSION_MINOR}.${GFXRECONSTRUCT_PROJECT_VERSION_PATCH}${GFXRECON_PROJECT_VERSION_DESIGNATION}
-DOUTPUT_FILE=${OUT_FILE}
-DRELATIVE_LAYER_BINARY=${RELATIVE_PATH_PREFIX}${LAYER_BINARY}
)
add_custom_target(${TARGET} ALL COMMAND ${CMAKE_COMMAND} ${CONFIG_DEFINES} -P "${CMAKE_CURRENT_BINARY_DIR}/generator.cmake")
endfunction()
Expand Down

0 comments on commit 18a13b5

Please sign in to comment.