Skip to content

Commit

Permalink
build combined .o file
Browse files Browse the repository at this point in the history
change xzre_code build flags to be closer to the real thing
  • Loading branch information
smx-smx committed May 1, 2024
1 parent 7de6566 commit 5e736e0
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion xzre_code/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,22 @@ add_library(xzre_code
secret_data_get_decrypted.c
sha256.c
sshd_patch_variables.c
)
)
target_compile_options(xzre_code PRIVATE
-Os -fomit-frame-pointer
)

add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/xzre_merged.o
DEPENDS $<TARGET_OBJECTS:xzre_code>
COMMAND ${CMAKE_LINKER}
-relocatable $<TARGET_OBJECTS:xzre_code>
-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)

0 comments on commit 5e736e0

Please sign in to comment.