-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use cmake instead of batch and make scripts
- Loading branch information
Showing
11 changed files
with
118 additions
and
254 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
input/x64/ | ||
build/ | ||
.cache/ | ||
eboot.bin | ||
param.sfo | ||
pkg.gp4 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"recommendations": [ | ||
"jeff-hykin.better-cpp-syntax", | ||
"ms-vscode.cpptools", | ||
"ms-vscode.cpptools-extension-pack", | ||
"twxs.cmake", | ||
"llvm-vs-code-extensions.vscode-clangd", | ||
"ms-vscode.cmake-tools" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
{ | ||
"C_Cpp.formatting": "clangFormat", | ||
"C_Cpp.clang_format_fallbackStyle": "LLVM", | ||
"C_Cpp.default.cppStandard": "c++20", | ||
"C_Cpp.autoAddFileAssociations": false, | ||
"editor.tabSize": 2, | ||
"editor.insertSpaces": true, | ||
"cmake.configureSettings": { | ||
"CMAKE_TOOLCHAIN_FILE": "OpenOrbis-tc.cmake" | ||
}, | ||
"clangd.arguments": [ | ||
"--compile-commands-dir=./build/", | ||
"--header-insertion=never" | ||
], | ||
"C_Cpp.intelliSenseEngine": "disabled", | ||
"C_Cpp.formatting": "disabled", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
cmake_minimum_required(VERSION 3.24) | ||
|
||
set(PKG_TITLE "PS4 Test Input System") | ||
set(PKG_VERSION "1.2") | ||
set(PKG_TITLE_ID "DDRM00001") | ||
set(PKG_CONTENT_ID "IV0000-${PKG_TITLE_ID}_00-PS4INPUTSY000000") | ||
|
||
project(eboot VERSION 0.0.1) | ||
set(PRJ_ADD_LIBS SceVideoOut SceAudioOut ScePad SceUserService) | ||
|
||
add_subdirectory(input) | ||
|
||
add_executable(eboot | ||
$<TARGET_OBJECTS:eboot_obj> | ||
${OO_PS4_TOOLCHAIN}/lib/crt1.o | ||
) | ||
|
||
set_target_properties(eboot PROPERTIES OUTPUT_NAME "eboot" SUFFIX ".elf" PREFIX "") | ||
target_link_libraries(eboot PRIVATE ${PRJ_ADD_LIBS}) | ||
|
||
# Create param.sfo | ||
|
||
if(CMAKE_HOST_WIN32) | ||
install(CODE "execute_process(WORKING_DIRECTORY \"${PROJECT_SOURCE_DIR}\" COMMAND \".\\\\package.bat\" \"${PKG_TITLE}\" \"${PKG_VERSION}\" \"${PKG_TITLE_ID}\" \"${PKG_CONTENT_ID}\")") | ||
set(ORBIS_BIN_PATH ${OO_PS4_TOOLCHAIN}/bin/windows) | ||
elseif(CMAKE_HOST_LINUX) | ||
install(CODE "execute_process(WORKING_DIRECTORY \"${PROJECT_SOURCE_DIR}\" COMMAND \"./package.sh\" \"${PKG_TITLE}\" \"${PKG_VERSION}\" \"${PKG_TITLE_ID}\" \"${PKG_CONTENT_ID}\")") | ||
set(ORBIS_BIN_PATH ${OO_PS4_TOOLCHAIN}/bin/linux) | ||
else() | ||
message(FATAL_ERROR "Unsupported OS") | ||
endif() | ||
|
||
# Create eboot.bin from generated elf file | ||
|
||
add_custom_command(TARGET eboot POST_BUILD COMMAND ${ORBIS_BIN_PATH}/create-fself -in "${CMAKE_BINARY_DIR}/eboot.elf" --out "${CMAKE_BINARY_DIR}/eboot.oelf" --eboot "${PROJECT_SOURCE_DIR}/eboot.bin" --paid 0x3800000000000011) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
if(NOT DEFINED ENV{OO_PS4_TOOLCHAIN}) | ||
message(FATAL_ERROR "Missing OpenOrbis toolchain environment variable!") | ||
endif() | ||
STRING(REGEX REPLACE "\\\\" "/" OO_PS4_TOOLCHAIN "$ENV{OO_PS4_TOOLCHAIN}") | ||
|
||
set(CMAKE_SYSTEM_NAME FreeBSD) | ||
set(CMAKE_C_COMPILER_TARGET "x86_64-pc-freebsd12-elf") | ||
set(CMAKE_C_FLAGS "-fPIC -funwind-tables -fshort-wchar") | ||
set(CMAKE_CXX_COMPILER_TARGET "${CMAKE_C_COMPILER_TARGET}") | ||
set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS}") | ||
set(CMAKE_TRY_COMPILE_TARGET_TYPE "STATIC_LIBRARY") | ||
set(CMAKE_SYSROOT ${OO_PS4_TOOLCHAIN}) | ||
|
||
include_directories(SYSTEM | ||
${OO_PS4_TOOLCHAIN}/include | ||
${OO_PS4_TOOLCHAIN}/include/c++/v1 | ||
) | ||
|
||
link_directories( | ||
${OO_PS4_TOOLCHAIN}/lib | ||
) | ||
|
||
add_link_options(-pie -nostartfiles -nodefaultlibs -lc -lc++ -lkernel -fuse-ld=lld -Wl,-m,elf_x86_64 -Wl,--eh-frame-hdr "-Wl,--script,${OO_PS4_TOOLCHAIN}/link.x") | ||
|
||
if(CMAKE_BUILD_TYPE STREQUAL "Debug") | ||
add_compile_options(-O0 -g) | ||
else() | ||
add_compile_options(-O3) | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
project(eboot_obj LANGUAGES CXX) | ||
|
||
add_library(eboot_obj OBJECT | ||
# Entry | ||
main.cpp | ||
controller.cpp | ||
graphics.cpp | ||
png.cpp | ||
) | ||
|
||
target_include_directories(eboot_obj PRIVATE ../padpatch) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.