From 8b09040cf56bf732eccfc8a4bb1193d9ef0b10ac Mon Sep 17 00:00:00 2001 From: spicyjpeg <88942473+spicyjpeg@users.noreply.github.com> Date: Sun, 31 Oct 2021 15:17:39 +0100 Subject: Added mkpsxiso and tinyxml2 as submodules --- CMakeLists.txt | 63 +++++++++++++--------------------------------------------- 1 file changed, 14 insertions(+), 49 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 431e95b..2c44c09 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,6 @@ include(ExternalProject) project( PSn00bSDK LANGUAGES NONE - # IMPORTANT TODO: set a version number VERSION 0.1.0 DESCRIPTION "Open source PlayStation 1 SDK" HOMEPAGE_URL "http://lameguy64.net/?page=psn00bsdk" @@ -35,14 +34,6 @@ set( CACHE STRING "GCC toolchain target triplet" ) -set( - SKIP_TINYXML2 OFF - CACHE BOOL "Skip downloading and building tinyxml2 (if already installed)" -) -set( - SKIP_MKPSXISO OFF - CACHE BOOL "Skip downloading and building mkpsxiso (if already installed)" -) set( SKIP_EXAMPLES OFF CACHE BOOL "Skip building SDK examples (not required for installation)" @@ -60,12 +51,6 @@ set( -DPSN00BSDK_TARGET:STRING=${PSN00BSDK_TARGET} -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE} ) -set( - EXT_LIBRARY_ARGS - -DCMAKE_TOOLCHAIN_FILE:FILEPATH=${CMAKE_TOOLCHAIN_FILE} - -DCMAKE_INSTALL_PREFIX:PATH=${PROJECT_BINARY_DIR}/install_temp - -DCMAKE_MSVC_RUNTIME_LIBRARY:STRING=MultiThreaded$<$:Debug> -) set( SUBPROJECT_ARGS -DCMAKE_TOOLCHAIN_FILE:FILEPATH=${CMAKE_TOOLCHAIN_FILE} @@ -77,50 +62,30 @@ set( -DCMAKE_INSTALL_PREFIX:PATH=${PROJECT_BINARY_DIR}/examples ) -## External dependencies - -if(NOT SKIP_TINYXML2) - list(APPEND SUBPROJECT_ARGS -Dtinyxml2_ROOT:PATH=${PROJECT_BINARY_DIR}/install_temp) - - ExternalProject_Add( - tinyxml2 - GIT_REPOSITORY "https://github.com/leethomason/tinyxml2" - CMAKE_CACHE_ARGS ${COMMON_ARGS} ${EXT_LIBRARY_ARGS} - INSTALL_DIR install_temp - ) -else() - list(APPEND SUBPROJECT_ARGS -Dtinyxml2_ROOT:PATH=${tinyxml2_ROOT}) - - # Create a dummy target so CMake doesn't throw missing dependency errors. - add_library(tinyxml2 INTERFACE) -endif() +## Subprojects -if(NOT SKIP_MKPSXISO) - ExternalProject_Add( - mkpsxiso - GIT_REPOSITORY "https://github.com/Lameguy64/mkpsxiso" - CMAKE_CACHE_ARGS ${COMMON_ARGS} ${SUBPROJECT_ARGS} - INSTALL_DIR install_tree - DEPENDS tinyxml2 - ) -else() - add_library(mkpsxiso INTERFACE) +if(NOT EXISTS ${PROJECT_SOURCE_DIR}/tools/mkpsxiso/CMakeLists.txt) + message(FATAL_ERROR "The mkpsxiso directory is empty. Run 'git submodule update --init --recursive' to populate it.") endif() -## Subprojects - ExternalProject_Add( - libpsn00b - SOURCE_DIR ${PROJECT_SOURCE_DIR}/libpsn00b + tools + SOURCE_DIR ${PROJECT_SOURCE_DIR}/tools CMAKE_CACHE_ARGS ${COMMON_ARGS} ${SUBPROJECT_ARGS} INSTALL_DIR install_tree ) ExternalProject_Add( - tools - SOURCE_DIR ${PROJECT_SOURCE_DIR}/tools + mkpsxiso + SOURCE_DIR ${PROJECT_SOURCE_DIR}/tools/mkpsxiso + CMAKE_CACHE_ARGS ${COMMON_ARGS} ${SUBPROJECT_ARGS} + INSTALL_DIR install_tree +) +ExternalProject_Add( + libpsn00b + SOURCE_DIR ${PROJECT_SOURCE_DIR}/libpsn00b CMAKE_CACHE_ARGS ${COMMON_ARGS} ${SUBPROJECT_ARGS} INSTALL_DIR install_tree - DEPENDS tinyxml2 + #DEPENDS tools ) ExternalProject_Add( examples -- cgit v1.2.3 From c61d83010a1d83513623724f908f0903e90966e2 Mon Sep 17 00:00:00 2001 From: spicyjpeg <88942473+spicyjpeg@users.noreply.github.com> Date: Mon, 8 Nov 2021 13:59:21 +0100 Subject: Rolled back minimum required CMake version to 3.20 --- CMakeLists.txt | 2 +- cpack/fakeroot_fix.cmake | 2 +- cpack/setup.cmake | 2 +- examples/CMakeLists.txt | 2 +- examples/beginner/cppdemo/CMakeLists.txt | 2 +- examples/beginner/hello/CMakeLists.txt | 2 +- examples/cdrom/cdbrowse/CMakeLists.txt | 2 +- examples/cdrom/cdxa/CMakeLists.txt | 2 +- examples/demos/n00bdemo/CMakeLists.txt | 2 +- examples/graphics/balls/CMakeLists.txt | 2 +- examples/graphics/billboard/CMakeLists.txt | 2 +- examples/graphics/fpscam/CMakeLists.txt | 2 +- examples/graphics/gte/CMakeLists.txt | 2 +- examples/graphics/hdtv/CMakeLists.txt | 2 +- examples/graphics/render2tex/CMakeLists.txt | 2 +- examples/graphics/rgb24/CMakeLists.txt | 2 +- examples/io/pads/CMakeLists.txt | 2 +- examples/sound/vagsample/CMakeLists.txt | 2 +- examples/system/childexec/CMakeLists.txt | 2 +- examples/system/console/CMakeLists.txt | 2 +- examples/system/dynlink/CMakeLists.txt | 2 +- examples/system/timer/CMakeLists.txt | 2 +- examples/system/tty/CMakeLists.txt | 2 +- libpsn00b/CMakeLists.txt | 2 +- libpsn00b/cmake/internal_setup.cmake | 2 +- libpsn00b/cmake/sdk.cmake | 2 +- template/CMakeLists.txt | 2 +- tools/CMakeLists.txt | 9 ++------- tools/mkpsxiso | 2 +- 29 files changed, 30 insertions(+), 35 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c44c09..0e6eefd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ # workaround is to use ExternalProject_Add() to launch multiple independent # CMake instances, creating what's known as a "superbuild". -cmake_minimum_required(VERSION 3.21) +cmake_minimum_required(VERSION 3.20) include(ExternalProject) project( diff --git a/cpack/fakeroot_fix.cmake b/cpack/fakeroot_fix.cmake index e34baa0..1c1430d 100644 --- a/cpack/fakeroot_fix.cmake +++ b/cpack/fakeroot_fix.cmake @@ -7,7 +7,7 @@ # script does is simply finding and deleting all directories that do not match # the installation prefix before CPack generates the package. -cmake_minimum_required(VERSION 3.21) +cmake_minimum_required(VERSION 3.20) set(_prefix ${CPACK_TEMPORARY_INSTALL_DIRECTORY}${CPACK_PACKAGING_INSTALL_PREFIX}) diff --git a/cpack/setup.cmake b/cpack/setup.cmake index a483462..0c4f3cb 100644 --- a/cpack/setup.cmake +++ b/cpack/setup.cmake @@ -2,7 +2,7 @@ # rules to bundle the GCC toolchain and CMake in packages. It is included by # the main CMakeLists.txt script. -cmake_minimum_required(VERSION 3.21) +cmake_minimum_required(VERSION 3.20) ## Settings diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index 7cd7e98..87210b9 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,7 +1,7 @@ # PSn00bSDK examples build script # (C) 2021 spicyjpeg - MPL licensed -cmake_minimum_required(VERSION 3.21) +cmake_minimum_required(VERSION 3.20) project( PSn00bSDK-examples diff --git a/examples/beginner/cppdemo/CMakeLists.txt b/examples/beginner/cppdemo/CMakeLists.txt index 83f0f0a..3b6a53e 100644 --- a/examples/beginner/cppdemo/CMakeLists.txt +++ b/examples/beginner/cppdemo/CMakeLists.txt @@ -1,7 +1,7 @@ # PSn00bSDK example CMake script # (C) 2021 spicyjpeg - MPL licensed -cmake_minimum_required(VERSION 3.21) +cmake_minimum_required(VERSION 3.20) if(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND DEFINED ENV{PSN00BSDK_LIBS}) set(CMAKE_TOOLCHAIN_FILE $ENV{PSN00BSDK_LIBS}/cmake/sdk.cmake) diff --git a/examples/beginner/hello/CMakeLists.txt b/examples/beginner/hello/CMakeLists.txt index 40e30b0..81ed0f7 100644 --- a/examples/beginner/hello/CMakeLists.txt +++ b/examples/beginner/hello/CMakeLists.txt @@ -1,7 +1,7 @@ # PSn00bSDK example CMake script # (C) 2021 spicyjpeg - MPL licensed -cmake_minimum_required(VERSION 3.21) +cmake_minimum_required(VERSION 3.20) if(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND DEFINED ENV{PSN00BSDK_LIBS}) set(CMAKE_TOOLCHAIN_FILE $ENV{PSN00BSDK_LIBS}/cmake/sdk.cmake) diff --git a/examples/cdrom/cdbrowse/CMakeLists.txt b/examples/cdrom/cdbrowse/CMakeLists.txt index 6eb4cbb..d587f5a 100644 --- a/examples/cdrom/cdbrowse/CMakeLists.txt +++ b/examples/cdrom/cdbrowse/CMakeLists.txt @@ -1,7 +1,7 @@ # PSn00bSDK example CMake script # (C) 2021 spicyjpeg - MPL licensed -cmake_minimum_required(VERSION 3.21) +cmake_minimum_required(VERSION 3.20) if(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND DEFINED ENV{PSN00BSDK_LIBS}) set(CMAKE_TOOLCHAIN_FILE $ENV{PSN00BSDK_LIBS}/cmake/sdk.cmake) diff --git a/examples/cdrom/cdxa/CMakeLists.txt b/examples/cdrom/cdxa/CMakeLists.txt index b0c8d90..d95a40d 100644 --- a/examples/cdrom/cdxa/CMakeLists.txt +++ b/examples/cdrom/cdxa/CMakeLists.txt @@ -1,7 +1,7 @@ # PSn00bSDK example CMake script # (C) 2021 spicyjpeg - MPL licensed -cmake_minimum_required(VERSION 3.21) +cmake_minimum_required(VERSION 3.20) if(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND DEFINED ENV{PSN00BSDK_LIBS}) set(CMAKE_TOOLCHAIN_FILE $ENV{PSN00BSDK_LIBS}/cmake/sdk.cmake) diff --git a/examples/demos/n00bdemo/CMakeLists.txt b/examples/demos/n00bdemo/CMakeLists.txt index 0b51beb..02c7b35 100644 --- a/examples/demos/n00bdemo/CMakeLists.txt +++ b/examples/demos/n00bdemo/CMakeLists.txt @@ -1,7 +1,7 @@ # PSn00bSDK example CMake script # (C) 2021 spicyjpeg - MPL licensed -cmake_minimum_required(VERSION 3.21) +cmake_minimum_required(VERSION 3.20) if(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND DEFINED ENV{PSN00BSDK_LIBS}) set(CMAKE_TOOLCHAIN_FILE $ENV{PSN00BSDK_LIBS}/cmake/sdk.cmake) diff --git a/examples/graphics/balls/CMakeLists.txt b/examples/graphics/balls/CMakeLists.txt index b063425..5afb2b1 100644 --- a/examples/graphics/balls/CMakeLists.txt +++ b/examples/graphics/balls/CMakeLists.txt @@ -1,7 +1,7 @@ # PSn00bSDK example CMake script # (C) 2021 spicyjpeg - MPL licensed -cmake_minimum_required(VERSION 3.21) +cmake_minimum_required(VERSION 3.20) if(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND DEFINED ENV{PSN00BSDK_LIBS}) set(CMAKE_TOOLCHAIN_FILE $ENV{PSN00BSDK_LIBS}/cmake/sdk.cmake) diff --git a/examples/graphics/billboard/CMakeLists.txt b/examples/graphics/billboard/CMakeLists.txt index bf73297..1d9df78 100644 --- a/examples/graphics/billboard/CMakeLists.txt +++ b/examples/graphics/billboard/CMakeLists.txt @@ -1,7 +1,7 @@ # PSn00bSDK example CMake script # (C) 2021 spicyjpeg - MPL licensed -cmake_minimum_required(VERSION 3.21) +cmake_minimum_required(VERSION 3.20) if(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND DEFINED ENV{PSN00BSDK_LIBS}) set(CMAKE_TOOLCHAIN_FILE $ENV{PSN00BSDK_LIBS}/cmake/sdk.cmake) diff --git a/examples/graphics/fpscam/CMakeLists.txt b/examples/graphics/fpscam/CMakeLists.txt index 8fa66f2..b2becb9 100644 --- a/examples/graphics/fpscam/CMakeLists.txt +++ b/examples/graphics/fpscam/CMakeLists.txt @@ -1,7 +1,7 @@ # PSn00bSDK example CMake script # (C) 2021 spicyjpeg - MPL licensed -cmake_minimum_required(VERSION 3.21) +cmake_minimum_required(VERSION 3.20) if(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND DEFINED ENV{PSN00BSDK_LIBS}) set(CMAKE_TOOLCHAIN_FILE $ENV{PSN00BSDK_LIBS}/cmake/sdk.cmake) diff --git a/examples/graphics/gte/CMakeLists.txt b/examples/graphics/gte/CMakeLists.txt index 3cdf2ff..5fdf4d1 100644 --- a/examples/graphics/gte/CMakeLists.txt +++ b/examples/graphics/gte/CMakeLists.txt @@ -1,7 +1,7 @@ # PSn00bSDK example CMake script # (C) 2021 spicyjpeg - MPL licensed -cmake_minimum_required(VERSION 3.21) +cmake_minimum_required(VERSION 3.20) if(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND DEFINED ENV{PSN00BSDK_LIBS}) set(CMAKE_TOOLCHAIN_FILE $ENV{PSN00BSDK_LIBS}/cmake/sdk.cmake) diff --git a/examples/graphics/hdtv/CMakeLists.txt b/examples/graphics/hdtv/CMakeLists.txt index 98a0b3f..899f963 100644 --- a/examples/graphics/hdtv/CMakeLists.txt +++ b/examples/graphics/hdtv/CMakeLists.txt @@ -1,7 +1,7 @@ # PSn00bSDK example CMake script # (C) 2021 spicyjpeg - MPL licensed -cmake_minimum_required(VERSION 3.21) +cmake_minimum_required(VERSION 3.20) if(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND DEFINED ENV{PSN00BSDK_LIBS}) set(CMAKE_TOOLCHAIN_FILE $ENV{PSN00BSDK_LIBS}/cmake/sdk.cmake) diff --git a/examples/graphics/render2tex/CMakeLists.txt b/examples/graphics/render2tex/CMakeLists.txt index 42a063b..db30377 100644 --- a/examples/graphics/render2tex/CMakeLists.txt +++ b/examples/graphics/render2tex/CMakeLists.txt @@ -1,7 +1,7 @@ # PSn00bSDK example CMake script # (C) 2021 spicyjpeg - MPL licensed -cmake_minimum_required(VERSION 3.21) +cmake_minimum_required(VERSION 3.20) if(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND DEFINED ENV{PSN00BSDK_LIBS}) set(CMAKE_TOOLCHAIN_FILE $ENV{PSN00BSDK_LIBS}/cmake/sdk.cmake) diff --git a/examples/graphics/rgb24/CMakeLists.txt b/examples/graphics/rgb24/CMakeLists.txt index c66ae69..71e2cfa 100644 --- a/examples/graphics/rgb24/CMakeLists.txt +++ b/examples/graphics/rgb24/CMakeLists.txt @@ -1,7 +1,7 @@ # PSn00bSDK example CMake script # (C) 2021 spicyjpeg - MPL licensed -cmake_minimum_required(VERSION 3.21) +cmake_minimum_required(VERSION 3.20) if(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND DEFINED ENV{PSN00BSDK_LIBS}) set(CMAKE_TOOLCHAIN_FILE $ENV{PSN00BSDK_LIBS}/cmake/sdk.cmake) diff --git a/examples/io/pads/CMakeLists.txt b/examples/io/pads/CMakeLists.txt index 124d62b..62c06a2 100644 --- a/examples/io/pads/CMakeLists.txt +++ b/examples/io/pads/CMakeLists.txt @@ -1,7 +1,7 @@ # PSn00bSDK example CMake script # (C) 2021 spicyjpeg - MPL licensed -cmake_minimum_required(VERSION 3.21) +cmake_minimum_required(VERSION 3.20) if(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND DEFINED ENV{PSN00BSDK_LIBS}) set(CMAKE_TOOLCHAIN_FILE $ENV{PSN00BSDK_LIBS}/cmake/sdk.cmake) diff --git a/examples/sound/vagsample/CMakeLists.txt b/examples/sound/vagsample/CMakeLists.txt index 1f42608..54305ab 100644 --- a/examples/sound/vagsample/CMakeLists.txt +++ b/examples/sound/vagsample/CMakeLists.txt @@ -1,7 +1,7 @@ # PSn00bSDK example CMake script # (C) 2021 spicyjpeg - MPL licensed -cmake_minimum_required(VERSION 3.21) +cmake_minimum_required(VERSION 3.20) if(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND DEFINED ENV{PSN00BSDK_LIBS}) set(CMAKE_TOOLCHAIN_FILE $ENV{PSN00BSDK_LIBS}/cmake/sdk.cmake) diff --git a/examples/system/childexec/CMakeLists.txt b/examples/system/childexec/CMakeLists.txt index c9983c4..f28a136 100644 --- a/examples/system/childexec/CMakeLists.txt +++ b/examples/system/childexec/CMakeLists.txt @@ -1,7 +1,7 @@ # PSn00bSDK example CMake script # (C) 2021 spicyjpeg - MPL licensed -cmake_minimum_required(VERSION 3.21) +cmake_minimum_required(VERSION 3.20) if(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND DEFINED ENV{PSN00BSDK_LIBS}) set(CMAKE_TOOLCHAIN_FILE $ENV{PSN00BSDK_LIBS}/cmake/sdk.cmake) diff --git a/examples/system/console/CMakeLists.txt b/examples/system/console/CMakeLists.txt index acae08f..024c7a4 100644 --- a/examples/system/console/CMakeLists.txt +++ b/examples/system/console/CMakeLists.txt @@ -1,7 +1,7 @@ # PSn00bSDK example CMake script # (C) 2021 spicyjpeg - MPL licensed -cmake_minimum_required(VERSION 3.21) +cmake_minimum_required(VERSION 3.20) if(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND DEFINED ENV{PSN00BSDK_LIBS}) set(CMAKE_TOOLCHAIN_FILE $ENV{PSN00BSDK_LIBS}/cmake/sdk.cmake) diff --git a/examples/system/dynlink/CMakeLists.txt b/examples/system/dynlink/CMakeLists.txt index 3af5d4b..e7188de 100644 --- a/examples/system/dynlink/CMakeLists.txt +++ b/examples/system/dynlink/CMakeLists.txt @@ -1,7 +1,7 @@ # PSn00bSDK example CMake script # (C) 2021 spicyjpeg - MPL licensed -cmake_minimum_required(VERSION 3.21) +cmake_minimum_required(VERSION 3.20) if(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND DEFINED ENV{PSN00BSDK_LIBS}) set(CMAKE_TOOLCHAIN_FILE $ENV{PSN00BSDK_LIBS}/cmake/sdk.cmake) diff --git a/examples/system/timer/CMakeLists.txt b/examples/system/timer/CMakeLists.txt index 189bf87..6dc5ec3 100644 --- a/examples/system/timer/CMakeLists.txt +++ b/examples/system/timer/CMakeLists.txt @@ -1,7 +1,7 @@ # PSn00bSDK example CMake script # (C) 2021 spicyjpeg - MPL licensed -cmake_minimum_required(VERSION 3.21) +cmake_minimum_required(VERSION 3.20) if(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND DEFINED ENV{PSN00BSDK_LIBS}) set(CMAKE_TOOLCHAIN_FILE $ENV{PSN00BSDK_LIBS}/cmake/sdk.cmake) diff --git a/examples/system/tty/CMakeLists.txt b/examples/system/tty/CMakeLists.txt index 024ccd4..b8b5738 100644 --- a/examples/system/tty/CMakeLists.txt +++ b/examples/system/tty/CMakeLists.txt @@ -1,7 +1,7 @@ # PSn00bSDK example CMake script # (C) 2021 spicyjpeg - MPL licensed -cmake_minimum_required(VERSION 3.21) +cmake_minimum_required(VERSION 3.20) if(NOT DEFINED CMAKE_TOOLCHAIN_FILE AND DEFINED ENV{PSN00BSDK_LIBS}) set(CMAKE_TOOLCHAIN_FILE $ENV{PSN00BSDK_LIBS}/cmake/sdk.cmake) diff --git a/libpsn00b/CMakeLists.txt b/libpsn00b/CMakeLists.txt index 083208a..7b5f7a5 100644 --- a/libpsn00b/CMakeLists.txt +++ b/libpsn00b/CMakeLists.txt @@ -1,7 +1,7 @@ # libpsn00b build script # (C) 2021 spicyjpeg - MPL licensed -cmake_minimum_required(VERSION 3.21) +cmake_minimum_required(VERSION 3.20) # ${PROJECT_SOURCE_DIR} is not available until project() is called. set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/cmake/sdk.cmake) diff --git a/libpsn00b/cmake/internal_setup.cmake b/libpsn00b/cmake/internal_setup.cmake index 377afbc..732294c 100644 --- a/libpsn00b/cmake/internal_setup.cmake +++ b/libpsn00b/cmake/internal_setup.cmake @@ -4,7 +4,7 @@ # This script is included automatically when using the toolchain file and # defines helper functions. -cmake_minimum_required(VERSION 3.21) +cmake_minimum_required(VERSION 3.20) include(GNUInstallDirs) # IMPORTANT TODO: set a version number diff --git a/libpsn00b/cmake/sdk.cmake b/libpsn00b/cmake/sdk.cmake index 4c2f330..ae23a06 100644 --- a/libpsn00b/cmake/sdk.cmake +++ b/libpsn00b/cmake/sdk.cmake @@ -1,7 +1,7 @@ # PSn00bSDK toolchain setup file for CMake # (C) 2021 spicyjpeg - MPL licensed -cmake_minimum_required(VERSION 3.21) +cmake_minimum_required(VERSION 3.20) set( PSN00BSDK_TC $ENV{PSN00BSDK_TC} diff --git a/template/CMakeLists.txt b/template/CMakeLists.txt index c2d0d9d..c0c05d0 100644 --- a/template/CMakeLists.txt +++ b/template/CMakeLists.txt @@ -1,7 +1,7 @@ # PSn00bSDK example CMake script # (C) 2021 spicyjpeg - MPL licensed -cmake_minimum_required(VERSION 3.21) +cmake_minimum_required(VERSION 3.20) # CMAKE_TOOLCHAIN_FILE must be set to point to cmake/sdk.cmake in the PSn00bSDK # installation directory *before* calling project(). You don't have to hardcode diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 14fa775..af99046 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -1,7 +1,7 @@ # PSn00bSDK tools build script # (C) 2021 spicyjpeg - MPL licensed -cmake_minimum_required(VERSION 3.21) +cmake_minimum_required(VERSION 3.20) project( PSn00bSDK-tools @@ -57,12 +57,7 @@ target_link_libraries(lzpack tinyxml2 lzp) # Install the executables and copy the Blender SMX export plugin to the data # directory (for manual installation). -install( - TARGETS elf2x elf2cpe smxlink lzpack - #RUNTIME_DEPENDENCIES - #PRE_EXCLUDE_REGEXES ".*" - #PRE_INCLUDE_REGEXES "tinyxml2" -) +install(TARGETS elf2x elf2cpe smxlink lzpack) install( DIRECTORY plugin DESTINATION ${CMAKE_INSTALL_DATADIR}/psn00bsdk diff --git a/tools/mkpsxiso b/tools/mkpsxiso index 0d65bb7..fe14e95 160000 --- a/tools/mkpsxiso +++ b/tools/mkpsxiso @@ -1 +1 @@ -Subproject commit 0d65bb7ef80a67c1a89a6c43e40521fd57776814 +Subproject commit fe14e95d07a0da5727a8c2fb3ff2aaa892e465cf -- cgit v1.2.3 From 9b00e5f7ff163a8fc6f341dbf237d90c61dadddc Mon Sep 17 00:00:00 2001 From: spicyjpeg <88942473+spicyjpeg@users.noreply.github.com> Date: Sat, 20 Nov 2021 01:09:33 +0100 Subject: Fixed macOS installation bug, updated INSTALL.md --- CMakeLists.txt | 19 ++++++++++++++----- CMakePresets.json | 4 ++-- INSTALL.md | 33 ++++++++++++++++++++++++--------- changelog.txt | 19 +++++++++++++++++++ doc/dev notes.txt | 34 +++++++++++++++++++++++++++++++++- 5 files changed, 92 insertions(+), 17 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e6eefd..87980a5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -98,12 +98,21 @@ ExternalProject_Add( # Install all files in the temporary installation tree, as well as static files # from the source tree, when "cmake --install" is invoked. -install( - DIRECTORY ${PROJECT_BINARY_DIR}/install_tree/ # THE TRAILING SLASH IS IMPORTANT - DESTINATION . - COMPONENT sdk - USE_SOURCE_PERMISSIONS +foreach( + _subdir IN ITEMS + ${CMAKE_INSTALL_BINDIR} + ${CMAKE_INSTALL_LIBDIR} + ${CMAKE_INSTALL_DATADIR} ) + install( + # THE TRAILING SLASH IS IMPORTANT + DIRECTORY ${PROJECT_BINARY_DIR}/install_tree/${_subdir}/ + DESTINATION ${_subdir} + COMPONENT sdk + USE_SOURCE_PERMISSIONS + ) +endforeach() + install( DIRECTORY doc template DESTINATION ${CMAKE_INSTALL_DATADIR}/psn00bsdk diff --git a/CMakePresets.json b/CMakePresets.json index 50cf671..f550e82 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -1,8 +1,8 @@ { - "version": 3, + "version": 2, "cmakeMinimumRequired": { "major": 3, - "minor": 21, + "minor": 20, "patch": 0 }, "configurePresets": [ diff --git a/INSTALL.md b/INSTALL.md index d0a2cd7..5ae56f5 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -4,14 +4,15 @@ ## Building and installing The instructions below are for Windows and Linux. Building on macOS hasn't been -tested. +tested extensively yet, however it should work once the GCC toolchain is built +and installed properly. 1. Install prerequisites and a host compiler toolchain. On Linux (most distros) install the following packages from your distro's package manager: - `git` - `build-essential`, `base-devel` or similar - - `ninja-build` + - `make` or `ninja-build` - `cmake` (3.20+ is required, download it from [here](https://cmake.org/download) if your package manager only provides older versions) @@ -20,11 +21,11 @@ tested. MSYS" shell and run this command: ```bash - pacman -Syu git mingw-w64-x86_64-ninja mingw-w64-x86_64-cmake mingw-w64-x86_64-g++ + pacman -Syu git mingw-w64-x86_64-make mingw-w64-x86_64-ninja mingw-w64-x86_64-cmake mingw-w64-x86_64-gcc ``` - **NOTE**: if you are prompted to close the shell, you may have to reopen it - afterwards and rerun the command to finish installation. + If you are prompted to close the shell, you may have to reopen it afterwards + and rerun the command to finish installation. **Do not use the MSys2 shell for the next steps**, use a regular command prompt or PowerShell instead. @@ -40,6 +41,12 @@ tested. version from [Lameguy64's website](http://lameguy64.net?page=psn00bsdk) and extract it into one of the directories listed below instead. + **NOTE**: PSn00bSDK is also compatible with toolchains that target + `mipsel-none-elf`. If you already have such a toolchain (e.g. because you + have another PS1 SDK installed) you can skip this step. Make sure you pass + `-DPSN00BSDK_TARGET=mipsel-none-elf` to CMake when configuring the SDK + though (see step 5). + 3. If you chose a non-standard install location for the toolchain, add the `bin` subfolder (inside the top-level toolchain directory) to the `PATH` environment variable. This step is unnecessary if you installed/extracted @@ -68,7 +75,14 @@ tested. If you want to install the SDK to a custom location rather than the default one (`C:\Program Files\PSn00bSDK` or `/usr/local` depending on your OS), add - `--install-prefix ` to the first command. + `--install-prefix ` to the first command. Add + `-DPSN00BSDK_TARGET=mipsel-none-elf` if your toolchain targets + `mipsel-none-elf` rather than `mipsel-unknown-elf`. + + **NOTE**: Ninja is used by default to build the SDK. If you can't get it to + work or don't have it installed, pass `-G "Unix Makefiles"` (or + `-G "MSYS Makefiles"` on Windows) to the first command to build using `make` + instead. 6. Install the SDK to the path you chose (add `sudo` or run it from a command prompt with admin privileges if necessary): @@ -104,7 +118,8 @@ far from being feature-complete. [NSIS](https://nsis.sourceforge.io/Download) on Windows or `dpkg` and `rpm` on Linux. -2. Run the following commands from the PSn00bSDK directory: +2. Run the following commands from the PSn00bSDK directory (pass the + appropriate options to the first command if necessary): ```bash cmake --preset package . @@ -121,7 +136,7 @@ far from being feature-complete. 2. Configure and build the template by running: ```bash - cmake -S . -B ./build -G Ninja + cmake -S . -B ./build cmake --build ./build ``` @@ -138,4 +153,4 @@ The toolchain script defines a few CMake macros to create PS1 executables, DLLs and CD images. See the [reference](doc/cmake_reference.md) for details. ----------------------------------------- -_Last updated on 2021-10-31 by spicyjpeg_ +_Last updated on 2021-11-19 by spicyjpeg_ diff --git a/changelog.txt b/changelog.txt index 041bbc5..3efa7a0 100644 --- a/changelog.txt +++ b/changelog.txt @@ -2,6 +2,25 @@ PSn00bSDK changelog Items that are lower in the log are more recently implemented. +11-19-2021 by spicyjpeg: + +* libc: Removed STACK_MAX_SIZE and added _mem_init() back. RAM and stack size + can now be set by calling _mem_init() manually before allocating any memory. + +* libc: sprintf() now supports fixed padding when using %@ (binary integer). + +* psxapi: Added wrapper around BIOS function GetSystemInfo(). + +* examples: Added pads example. Also added CMake build script to cartrom, which + is now built alongside all other examples. + +* Deprecated malloc.h and removed all references to it (stdlib.h should be used + instead). Moved int*_t and uint*_t types to stdint.h. + +* Fixed file permission errors when attempting to install the SDK on macOS. + Made some small updates to INSTALL.md. + + 10-31-2021 by spicyjpeg: * Added tinyxml2 and mkpsxiso as git submodules and removed the (admittedly diff --git a/doc/dev notes.txt b/doc/dev notes.txt index d825ee7..3aa2db5 100644 --- a/doc/dev notes.txt +++ b/doc/dev notes.txt @@ -76,7 +76,7 @@ the pad in analog mode you must: games) to increase timing accuracy. * If a digital pad response (type = 4) is received from a port that hasn't previously been flagged as digital-only, attempt to put the pad into config - mode using command 43h. + mode using command 43h *twice* (as the proper response is delayed). * If the pad doesn't recognize the config command, flag it as digital-only and treat all further digital pad responses from it as valid. * If the pad recognizes the command, it will reply by identifying as an @@ -166,6 +166,38 @@ cache or something like that (?). The only workaround I know of is to use CPACK_PRE_BUILD_SCRIPTS to trigger a custom script that deletes anything other than the actual files to be packaged (see cpack/fakeroot_fix.cmake). +* Project installation might fail on macOS (and possibly some Linux distros) if +CMake attempts to set permissions on system directories such as /usr/local. +This is usually caused by install() commands that copy files to the root +installation directory rather than to a subfolder, like this: + + install( + DIRECTORY install_tree/ + DESTINATION . + USE_SOURCE_PERMISSIONS + ) + +If the USE_SOURCE_PERMISSIONS flag is specified CMake will attempt to set +permissions on the DESTINATION folder, which in this case would be the root +prefix (/usr/local by default on macOS), to match the source directory. This +will however fail as macOS restricts top-level system directories from having +their permissions changed. The simplest workaround is to avoid using +"DESTINATION ." and install each subdirectory explicitly instead, like this: + + foreach( + _dir IN ITEMS + ${CMAKE_INSTALL_BINDIR} + ${CMAKE_INSTALL_LIBDIR} + ${CMAKE_INSTALL_INCLUDEDIR} + ${CMAKE_INSTALL_DATADIR} + ) + install( + DIRECTORY install_tree/${_dir}/ + DESTINATION ${_dir} + USE_SOURCE_PERMISSIONS + ) + endforeach() + * Depending on how you find external dependencies (find_package(), vcpkg, pkg-config...), CMake may end up outputting an executable that relies on a DLL installed system-wide. To correctly install the DLL alongside the executable -- cgit v1.2.3