From 5e736e0e98c9da79761fcfdc5c13b765d9581143 Mon Sep 17 00:00:00 2001 From: Stefano Moioli Date: Thu, 2 May 2024 00:17:46 +0200 Subject: [PATCH] build combined .o file change xzre_code build flags to be closer to the real thing --- xzre_code/CMakeLists.txt | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/xzre_code/CMakeLists.txt b/xzre_code/CMakeLists.txt index 5bad8f7..7392cd5 100644 --- a/xzre_code/CMakeLists.txt +++ b/xzre_code/CMakeLists.txt @@ -15,4 +15,22 @@ add_library(xzre_code secret_data_get_decrypted.c sha256.c sshd_patch_variables.c -) \ No newline at end of file +) +target_compile_options(xzre_code PRIVATE + -Os -fomit-frame-pointer +) + +add_custom_command( + OUTPUT ${CMAKE_BINARY_DIR}/xzre_merged.o + DEPENDS $ + COMMAND ${CMAKE_LINKER} + -relocatable $ + -o ${CMAKE_BINARY_DIR}/xzre_merged.o + COMMAND_EXPAND_LISTS + VERBATIM +) + +add_custom_target(make_object_file ALL + DEPENDS ${CMAKE_BINARY_DIR}/xzre_merged.o +) +add_dependencies(make_object_file xzre_code)