Add missing mkdir in programs compilation flow. Add check for executables in script.

This commit is contained in:
Enrico Fraccaroli (Galfurian)
2022-07-07 10:51:25 -04:00
parent 1e4a43e0f2
commit 821135d686
3 changed files with 7 additions and 2 deletions
+1
View File
@@ -102,6 +102,7 @@ foreach(PROGRAM ${PROGRAMS})
# Add the final target that strips the debugging symbols from the program.
add_custom_command(TARGET ${TARGET_NAME}
BYPRODUCTS ${MENTOS_BIN_DIR}/${PROGRAM_NAME}
COMMAND mkdir -p ${MENTOS_BIN_DIR}
COMMAND strip --strip-debug ${PROJECT_BINARY_DIR}/${TARGET_NAME} -o ${MENTOS_BIN_DIR}/${PROGRAM_NAME}
DEPENDS ${TARGET_NAME}
)
+1
View File
@@ -102,6 +102,7 @@ foreach(TEST ${TESTS})
# Add the final target that strips the debugging symbols from the program.
add_custom_command(TARGET ${TARGET_NAME}
BYPRODUCTS ${MENTOS_TESTS_DIR}/${TEST_NAME}
COMMAND mkdir -p ${MENTOS_TESTS_DIR}
COMMAND strip --strip-debug ${PROJECT_BINARY_DIR}/${TARGET_NAME} -o ${MENTOS_TESTS_DIR}/${TEST_NAME}
DEPENDS ${TARGET_NAME}
)
+5 -2
View File
@@ -1,6 +1,9 @@
#!/bin/bash
for obj_file in "$@"
do
ADDR=$(readelf -WS $obj_file | grep .text | awk '{ print "0x"$5 }')
echo "add-symbol-file $obj_file ${ADDR}"
if [[ -x "$obj_file" ]]
then
ADDR=$(readelf -WS $obj_file | grep .text | awk '{ print "0x"$5 }')
echo "add-symbol-file $obj_file ${ADDR}"
fi
done