Support linux build

This commit is contained in:
jaby 2023-10-09 22:34:42 +02:00
parent 597278e0d1
commit 58db6351f3
8 changed files with 160 additions and 201 deletions

View File

@ -1,19 +0,0 @@
@echo off
rem build_all [clean]
set build_type=build
IF NOT "%~1" == "" (
set build_type=%~1
)
mkdir bin\
cd src\Tools\
call build_all.bat update
call build_all.bat %build_type%
cd ..\Library\
call run_make.bat %build_type% release
cd ..\..\
PAUSE

View File

@ -11,7 +11,12 @@
{
"label": "build",
"type": "shell",
"command": "wsl make ${input:project}_${input:target} BUILD_PROFILE=${input:build profile} PSX_LICENSE_PATH=$(wslpath ${env:PSX_LICENSE_PATH}) JABY_ENGINE_DIR=$(wslpath ${env:JABY_ENGINE_PATH})",
"windows": { // v re-export for WSL v re-export for WSL
"command": "wsl make ${input:project}_${input:target} BUILD_PROFILE=${input:build profile} PSX_LICENSE_PATH=$(wslpath ${env:PSX_LICENSE_PATH}) JABY_ENGINE_DIR=$(wslpath ${env:JABY_ENGINE_PATH})",
},
"linux": {
"command": "make ${input:project}_${input:target} BUILD_PROFILE=${input:build profile}",
},
"group": {
"kind": "build",
"isDefault": true

View File

@ -19,18 +19,14 @@
{
"label": "make",
"type": "shell",
"command": "./run_make.bat ${input:target} ${input:build cfg}",
"windows": {
"command": "wsl make ${input:target} BUILD_PROFILE=${input:build cfg}",
},
"linux": {
"command": "make ${input:target} BUILD_PROFILE=${input:build cfg}",
},
"group": "build"
},
{
"label": "Build Libary and Tools",
"type": "shell",
"command": "./build_all.bat ${input:target}",
"group": "build",
"options": {
"cwd": "../.."
}
},
}
],
"inputs": [
{
@ -43,8 +39,8 @@
{
"id": "target",
"type": "pickString",
"options": ["build", "clean", "rebuild"],
"default": "build",
"options": ["all", "clean", "rebuild"],
"default": "all",
"description": "build target",
}
]

View File

@ -1,11 +0,0 @@
@echo off
rem run_make.bat build|clean|rebuild debug|release
IF %1 == build (
set make_target=all
) else (
set make_target=%1
)
@echo make %make_target% BUILD_PROFILE=%2
wsl make %make_target% BUILD_PROFILE=%2

View File

@ -1,4 +0,0 @@
set bin_linux_projects=%bin_projects% %bin_linux_projects%
set clean_projects_linux=%clean_projects% %clean_projects_linux%
set bin_projects=
set clean_projects=

View File

@ -1,4 +0,0 @@
set bin_projects=psxcdgen psxcdgen_ex psxcdread psxreadmap wslpath
set bin_linux_projects=cpp_out psxcdgen_ex jaby_engine_fconv mkoverlay wslpath
set clean_projects=cdtypes
set clean_projects_linux=tool_helper

View File

@ -1,4 +0,0 @@
set bin_projects=%bin_projects% %bin_linux_projects%
set clean_projects=%clean_projects% %clean_projects_linux%
set bin_linux_projects=
set clean_projects_linux=

View File

@ -10,7 +10,7 @@ fi
cd $1
if [ $2 = build ]; then
echo "cargo build $1 --$3"
cargo build --$3 --target=$target
$HOME/.cargo/bin/cargo build --$3 --target=$target
if [ $? = 0 ]; then
cp target/$target/$3/$1 ../../../bin
@ -20,17 +20,17 @@ if [ $2 = build ]; then
exit $?
elif [ $2 = run ]; then
echo "cargo run $1 --$3"
cargo run --$3 --target=$target
$HOME/.cargo/bin/cargo run --$3 --target=$target
exit $?
elif [ $2 = check ]; then
echo "cargo check $1 --$3"
cargo check --$3 --target=$target $run_args
$HOME/.cargo/bin/cargo check --$3 --target=$target $run_args
exit $?
elif [ $2 = clean ]; then
echo "cargo clean $1"
cargo clean
$HOME/.cargo/bin/cargo clean
exit $?
else