Skip to content

Commit

Permalink
Improve output of create_pbp_file command to specify target
Browse files Browse the repository at this point in the history
Right now it's a bit of a mess when running builds in parallel.
  • Loading branch information
sharkwouter committed Oct 31, 2024
1 parent 64ea2da commit 7a57149
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions src/base/CreatePBP.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -80,27 +80,27 @@ macro(create_pbp_file)
TARGET ${ARG_TARGET}
POST_BUILD COMMAND
"${PSPDEV}/bin/psp-strip" "$<TARGET_FILE:${ARG_TARGET}>"
COMMENT "Stripping binary"
COMMENT "Stripping binary for target ${ARG_TARGET}"
)
elseif(${ARG_BUILD_PRX})
add_custom_command(
TARGET ${ARG_TARGET}
POST_BUILD COMMAND
${CMAKE_COMMAND} -E cmake_echo_color --cyan "Not stripping binary because building PRX."
${CMAKE_COMMAND} -E cmake_echo_color --cyan "Not stripping binary for target ${ARG_TARGET} because building PRX."
)
else()
add_custom_command(
TARGET ${ARG_TARGET}
POST_BUILD COMMAND
${CMAKE_COMMAND} -E cmake_echo_color --cyan "Not stripping binary, build type is ${CMAKE_BUILD_TYPE}."
${CMAKE_COMMAND} -E cmake_echo_color --cyan "Not stripping binary for target ${ARG_TARGET}, build type is ${CMAKE_BUILD_TYPE}."
)
endif()

add_custom_command(
TARGET ${ARG_TARGET}
POST_BUILD COMMAND
"$ENV{PSPDEV}/bin/psp-fixup-imports" "$<TARGET_FILE:${ARG_TARGET}>"
COMMENT "Calling psp-fixup-imports"
COMMENT "Calling psp-fixup-imports for target ${ARG_TARGET}"
)

if (${ARG_BUILD_PRX})
Expand All @@ -109,7 +109,7 @@ macro(create_pbp_file)
POST_BUILD COMMAND
"${PSPDEV}/bin/psp-prxgen" "$<TARGET_FILE:${ARG_TARGET}>"
"$<TARGET_FILE:${ARG_TARGET}>.prx"
COMMENT "Calling prxgen"
COMMENT "Calling prxgen for target ${ARG_TARGET}"
)

if(${ARG_ENC_PRX})
Expand All @@ -118,46 +118,46 @@ macro(create_pbp_file)
POST_BUILD COMMAND
"${PSPDEV}/bin/PrxEncrypter" "$<TARGET_FILE_DIR:${ARG_TARGET}>/$<TARGET_FILE_NAME:${ARG_TARGET}>.prx"
"$<TARGET_FILE:${ARG_TARGET}>.prx"
COMMENT "Calling PrxEncrypter"
COMMENT "Calling PrxEncrypter for target ${ARG_TARGET}"
)
else()
add_custom_command(
TARGET ${ARG_TARGET}
POST_BUILD COMMAND
${CMAKE_COMMAND} -E cmake_echo_color --cyan "Not encrypting PRX, use ENC_PRX flag if you need to."
${CMAKE_COMMAND} -E cmake_echo_color --cyan "Not encrypting PRX for target ${ARG_TARGET}, use ENC_PRX flag if you need to."
)
endif()

else()
add_custom_command(
TARGET ${ARG_TARGET}
POST_BUILD COMMAND
${CMAKE_COMMAND} -E cmake_echo_color --cyan "Not building PRX"
${CMAKE_COMMAND} -E cmake_echo_color --cyan "Not building PRX for target ${ARG_TARGET}"
)
endif()

add_custom_command(
TARGET ${ARG_TARGET}
POST_BUILD COMMAND
"${PSPDEV}/bin/mksfoex" "-d" "MEMSIZE=1" "-s" "APP_VER=${ARG_VERSION}" "${ARG_TITLE}" "$<TARGET_FILE_DIR:${ARG_TARGET}>/PARAM.SFO"
COMMENT "Calling mksfoex"
"${PSPDEV}/bin/mksfoex" "-d" "MEMSIZE=1" "-s" "APP_VER=${ARG_VERSION}" "${ARG_TITLE}" "${ARG_OUTPUT_DIR}/PARAM.SFO"
COMMENT "Calling mksfoex for target ${ARG_TARGET}"
)

if(${ARG_BUILD_PRX})
add_custom_command(
TARGET ${ARG_TARGET}
POST_BUILD COMMAND
"${PSPDEV}/bin/pack-pbp" "$<TARGET_FILE_DIR:${ARG_TARGET}>/EBOOT.PBP" "$<TARGET_FILE_DIR:${ARG_TARGET}>/PARAM.SFO" "${ARG_ICON_PATH}" "NULL" "${ARG_PREVIEW_PATH}"
"${PSPDEV}/bin/pack-pbp" "${ARG_OUTPUT_DIR}/EBOOT.PBP" "${ARG_OUTPUT_DIR}/PARAM.SFO" "${ARG_ICON_PATH}" "NULL" "${ARG_PREVIEW_PATH}"
"${ARG_BACKGROUND_PATH}" "${ARG_MUSIC_PATH}" "$<TARGET_FILE:${ARG_TARGET}>.prx" "NULL"
COMMENT "Calling pack-pbp with PRX file"
COMMENT "Calling pack-pbp with PRX file for target ${ARG_TARGET}"
)
else()
add_custom_command(
TARGET ${ARG_TARGET}
POST_BUILD COMMAND
"${PSPDEV}/bin/pack-pbp" "$<TARGET_FILE_DIR:${ARG_TARGET}>/EBOOT.PBP" "$<TARGET_FILE_DIR:${ARG_TARGET}>/PARAM.SFO" "${ARG_ICON_PATH}" "NULL" "${ARG_PREVIEW_PATH}"
"${PSPDEV}/bin/pack-pbp" "${ARG_OUTPUT_DIR}/EBOOT.PBP" "${ARG_OUTPUT_DIR}/PARAM.SFO" "${ARG_ICON_PATH}" "NULL" "${ARG_PREVIEW_PATH}"
"${ARG_BACKGROUND_PATH}" "${ARG_MUSIC_PATH}" "$<TARGET_FILE:${ARG_TARGET}>" "NULL"
COMMENT "Calling pack-pbp with ELF file"
COMMENT "Calling pack-pbp with ELF file for target ${ARG_TARGET}"
)
endif()

Expand All @@ -171,7 +171,7 @@ macro(create_pbp_file)
add_custom_command(
TARGET ${ARG_TARGET}
POST_BUILD COMMAND
${CMAKE_COMMAND} -E cmake_echo_color --cyan "EBOOT.PBP file created."
)
${CMAKE_COMMAND} -E cmake_echo_color --cyan "EBOOT.PBP file created for target ${ARG_TARGET}."
)

endmacro()

0 comments on commit 7a57149

Please sign in to comment.