File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -16,12 +16,15 @@ elseif(STEP STREQUAL "pp2")
1616 if (NOT DEFINED GASP_TOOL)
1717 message (FATAL_ERROR "GASP_TOOL not defined" )
1818 endif ()
19+ # Use wrapper script for better error handling
1920 execute_process (
20- COMMAND ${GASP_TOOL} -c ";" -I ${SOURCE_DIR} /vu1 -o ${OUTPUT} ${INPUT}
21+ COMMAND ${SOURCE_DIR} /cmake/run_masp.sh ${ GASP_TOOL} ${SOURCE_DIR} /vu1 ${OUTPUT} ${INPUT}
2122 RESULT_VARIABLE result
23+ OUTPUT_VARIABLE output
24+ ERROR_VARIABLE error
2225 )
2326 if (NOT result EQUAL 0)
24- message (FATAL_ERROR "Step 2 preprocessing (${GASP_TOOL} ) failed" )
27+ message (FATAL_ERROR "Step 2 preprocessing (${GASP_TOOL} ) failed\n Output: ${output} \n Error: ${error} \n Input: ${INPUT} \n Output: ${OUTPUT} " )
2528 endif ()
2629
2730elseif (STEP STREQUAL "pp3" )
@@ -36,8 +39,11 @@ elseif(STEP STREQUAL "pp3")
3639
3740elseif (STEP STREQUAL "pp4" )
3841 # Step 4: C preprocessor with memory layout
42+ # Use -w to suppress warnings about unmatched quotes in assembly comments
43+ # Escape backslashes before preprocessing, then restore them after
44+ # This preserves masp/gasp local labels like \xformed_vert while allowing normal C preprocessing
3945 execute_process (
40- COMMAND /bin/bash -c "cat ${INPUT} | ${COMPILER} -E -P -I${SOURCE_DIR} /vu1 -imacros ${MEM_HEADER} -o ${OUTPUT} - "
46+ COMMAND /bin/bash -c "sed 's/ \\\\ / \\\\\\\\ /g' ${INPUT} | ${COMPILER} -E -P -w - I${SOURCE_DIR} /vu1 -imacros ${MEM_HEADER} - | sed 's/ \\\\\\\\ / \\\\ /g' > ${OUTPUT} "
4147 RESULT_VARIABLE result
4248 )
4349 if (NOT result EQUAL 0)
You can’t perform that action at this time.
0 commit comments