aboutsummaryrefslogtreecommitdiff
path: root/libpsn00b/cmake/internal_setup.cmake
diff options
context:
space:
mode:
authorJohn "Lameguy" Wilbert Villamor <lameguy64@gmail.com>2021-10-25 08:18:23 +0800
committerGitHub <noreply@github.com>2021-10-25 08:18:23 +0800
commit8d17a5abe3c600b603f1910239d5df0fff9f4eed (patch)
tree20d3110363ab468e99502337c0a46852662bb365 /libpsn00b/cmake/internal_setup.cmake
parent0a7f59de1eb079930e7c25ad35adc39c9946958c (diff)
parent4e0d5bceb24042a6d31c76958ce2c6157369ac68 (diff)
downloadpsn00bsdk-8d17a5abe3c600b603f1910239d5df0fff9f4eed.tar.gz
Merge pull request #41 from spicyjpeg/cmake
CMake fixes, Windows build instructions
Diffstat (limited to 'libpsn00b/cmake/internal_setup.cmake')
-rw-r--r--libpsn00b/cmake/internal_setup.cmake17
1 files changed, 16 insertions, 1 deletions
diff --git a/libpsn00b/cmake/internal_setup.cmake b/libpsn00b/cmake/internal_setup.cmake
index e3d4be7..377afbc 100644
--- a/libpsn00b/cmake/internal_setup.cmake
+++ b/libpsn00b/cmake/internal_setup.cmake
@@ -79,6 +79,12 @@ function(psn00bsdk_add_executable name type)
message(FATAL_ERROR "Invalid executable type: ${type} (must be STATIC or DYNAMIC)")
endif()
+ # Throw an error if elf2x was not found (which should never happen if the
+ # SDK is installed properly).
+ if(ELF2X STREQUAL "ELF2X-NOTFOUND")
+ message(FATAL_ERROR "Failed to locate elf2x. Check your PATH environment variable.")
+ endif()
+
add_executable (${name} ${ARGN})
target_link_libraries(${name} psn00bsdk_${_type}_exe)
set_target_properties(${name} PROPERTIES PREFIX "" SUFFIX ".elf")
@@ -146,6 +152,13 @@ endfunction()
# [additional options passed to add_custom_target()]
# )
function(psn00bsdk_add_cd_image name image_name config_file)
+ # Throw an error if mkpsxiso was not found. Performing this check manually
+ # (instead of just marking mkpsxiso as required) allows simple projects to
+ # be built even if mkpsxiso is not installed.
+ if(MKPSXISO STREQUAL "MKPSXISO-NOTFOUND")
+ message(FATAL_ERROR "Failed to locate mkpsxiso. If mkpsxiso wasn't installed alongside the SDK, check your PATH environment variable.")
+ endif()
+
set(CD_IMAGE_NAME ${image_name})
configure_file(${config_file} _gen_${config_file})
@@ -158,4 +171,6 @@ function(psn00bsdk_add_cd_image name image_name config_file)
)
endfunction()
-## Helper functions for assets (TODO)
+## Helper functions for assets
+
+# TODO: add them