changes so that cmake builds for now

This commit is contained in:
2026-03-11 19:13:10 +01:00
parent a75db78425
commit 1117527a02
2 changed files with 66 additions and 7 deletions

View File

@@ -0,0 +1,41 @@
if(NOT DEFINED COMPILER)
message(FATAL_ERROR "COMPILER is required")
endif()
if(NOT DEFINED SOURCE)
message(FATAL_ERROR "SOURCE is required")
endif()
if(NOT DEFINED ASM_OUTPUT)
message(FATAL_ERROR "ASM_OUTPUT is required")
endif()
if(NOT DEFINED HEADER_OUTPUT)
message(FATAL_ERROR "HEADER_OUTPUT is required")
endif()
if(NOT DEFINED GENERATE_SCRIPT)
message(FATAL_ERROR "GENERATE_SCRIPT is required")
endif()
execute_process(
COMMAND "${COMPILER}" ${COMPILER_ARG1} ${CFLAG_ARGS} ${INCLUDE_ARGS} ${DEFINE_ARGS} -S -o "${ASM_OUTPUT}" "${SOURCE}"
RESULT_VARIABLE compile_result
OUTPUT_VARIABLE compile_stdout
ERROR_VARIABLE compile_stderr
)
if(NOT compile_result EQUAL 0)
message(FATAL_ERROR "failed to compile asm offsets source\n${compile_stdout}${compile_stderr}")
endif()
execute_process(
COMMAND "${CMAKE_COMMAND}" -DINPUT="${ASM_OUTPUT}" -DOUTPUT="${HEADER_OUTPUT}" -P "${GENERATE_SCRIPT}"
RESULT_VARIABLE generate_result
OUTPUT_VARIABLE generate_stdout
ERROR_VARIABLE generate_stderr
)
if(NOT generate_result EQUAL 0)
message(FATAL_ERROR "failed to generate asm offsets header\n${generate_stdout}${generate_stderr}")
endif()