SL-957: Use tar -C instead of changing tar's WORKING_DIRECTORY.

Seems VIEWER_SYMBOL_FILE arrives from build.sh as a relative pathname, so
passing that pathname to tar when we run tar with WORKING_DIRECTORY confuses
it. But if we use tar's -C switch, we can achieve the effect we want (no
leading directory prefixes in the tarball) without WORKING_DIRECTORY. Thing
is, we have to run the desired directory through cygpath first, which is why
we went with WORKING_DIRECTORY in the first place.
meow-7.2.2
Nat Goodspeed 2018-08-31 14:17:00 -04:00
parent aa6d178b69
commit 822e3b15e2
1 changed files with 5 additions and 1 deletions

View File

@ -2271,6 +2271,9 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE
execute_process(COMMAND "cygpath" "-u" "${VIEWER_SYMBOL_FILE}"
OUTPUT_VARIABLE VIEWER_SYMBOL_FILE_CYGWIN
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND "cygpath" "-u" "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}"
OUTPUT_VARIABLE PARENT_DIRECTORY_CYGWIN
OUTPUT_STRIP_TRAILING_WHITESPACE)
add_custom_command(OUTPUT "${VIEWER_SYMBOL_FILE}"
# Use of 'tar ...j' here assumes VIEWER_SYMBOL_FILE endswith .tar.bz2;
# testing a string suffix is painful enough in CMake language that
@ -2279,8 +2282,9 @@ if (PACKAGE AND (RELEASE_CRASH_REPORTING OR NON_RELEASE_CRASH_REPORTING) AND VIE
ARGS
"cjf"
"${VIEWER_SYMBOL_FILE_CYGWIN}"
"-C"
"${PARENT_DIRECTORY_CYGWIN}"
"secondlife-bin.pdb"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}"
DEPENDS "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/secondlife-bin.pdb"
COMMENT "Packing viewer PDB into ${VIEWER_SYMBOL_FILE_CYGWIN}"
)