fix vscode config to be cross platform

This commit is contained in:
Tim Felgentreff 2020-12-03 11:06:59 +01:00
parent 98a2e511a7
commit 6059b1be67
6 changed files with 59 additions and 21 deletions

26
.vscode/launch.json vendored
View file

@ -2,14 +2,22 @@
"configurations": [
{
"name": "Stratagus",
"type": "cppvsdbg",
"request": "launch",
"program": "${workspaceFolder}/build/Debug/stratagus.exe",
"args": ["-a", "-d", "${env:APPDATA}/Stratagus/data.${input:game}"],
"type": "cppdbg",
"linux": {
"program": "${workspaceFolder}/build/stratagus-dbg",
"args": ["-W", "-a", "-d", "${env:HOME}/.stratagus/data.${input:game}"],
"preLaunchTask": "Download games and dependencies",
},
"windows": {
"type": "cppvsdbg",
"program": "${workspaceFolder}/build/Debug/stratagus.exe",
"args": ["-W", "-a", "-d", "${env:APPDATA}/Stratagus/data.${input:game}"],
"environment": [{"name": "PATH", "value": "${workspaceFolder}\\..\\dependencies\\bin;${env:PATH}"}],
"externalConsole": true,
},
"stopAtEntry": false,
"cwd": "${workspaceFolder}/../${input:game}",
"environment": [{"name": "PATH", "value": "${workspaceFolder}\\..\\dependencies\\bin;${env:PATH}"}],
"externalConsole": true
}
],
"inputs": [
@ -18,11 +26,11 @@
"id": "game",
"description": "Which game to launch?",
"options": [
"wargus",
"war1gus",
"stargus",
"Wargus",
"War1gus",
"Stargus",
],
"default": "wargus"
"default": "Wargus"
},
]
}

View file

@ -13,5 +13,5 @@ if (-not (Test-Path "$stratagus_folder\\..\\wargus")) {
git clone https://github.com/Wargus/wargus "$stratagus_folder\\..\\wargus"
}
if (-not (Test-Path "$stratagus_folder\\..\\war1gus")) {
git clone https://github.com/Wargus/wargus "$stratagus_folder\\..\\war1gus"
git clone https://github.com/Wargus/war1gus "$stratagus_folder\\..\\war1gus"
}

25
.vscode/scripts/download.sh vendored Normal file
View file

@ -0,0 +1,25 @@
#!/bin/bash
# directory names should be uppercase for launch config to work
stratagus_folder="$1"
if [ ! -d "${stratagus_folder}/../Wargus" ]; then
if [ -d "${stratagus_folder}/../wargus" ]; then
pushd "${stratagus_folder}/../wargus"
target="$(pwd)"
popd
ln -s "${target}" "${stratagus_folder}/../Wargus"
else
git clone https://github.com/Wargus/wargus "${stratagus_folder}/../Wargus"
fi
fi
if [ ! -d "$stratagus_folder/../War1gus" ]; then
if [ -d "${stratagus_folder}/../war1gus" ]; then
pushd "${stratagus_folder}/../war1gus"
target="$(pwd)"
popd
ln -s "${target}" "${stratagus_folder}/../War1gus"
else
git clone https://github.com/Wargus/wargus "${stratagus_folder}/../War1gus"
fi
fi

13
.vscode/settings.json vendored
View file

@ -1,16 +1,11 @@
{
"cmake.configureEnvironment": {
"CMAKE_PREFIX_PATH": "${workspaceFolder}\\..\\dependencies",
"WIN32_CMAKE_PREFIX_PATH": "${workspaceFolder}\\..\\dependencies",
},
"cmake.configureArgs": [
"-DENABLE_STDIO_REDIRECT=ON",
//"-G", "Visual Studio 16 2019",
//"-T", "v141_xp",
//"-A", "win32",
],
"cmake.generator": "Visual Studio 16 2019",
"cmake.preferredGenerators": ["Visual Studio 16 2019", "Unix Makefiles"],
"cmake.toolset": "v141_xp",
"cmake.platform": "win32",
"cmake.copyCompileCommands": "${workspaceFolder}",
"cmake.configureSettings": {"CMAKE_BUILD_TYPE": "Debug"},
"cmake.copyCompileCommands": "${workspaceFolder}/compile_commands.json",
"C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools",
}

9
.vscode/tasks.json vendored
View file

@ -4,13 +4,18 @@
{
"label": "Download games and dependencies",
"type": "shell",
"command": "PowerShell.exe -ExecutionPolicy Bypass -File ${workspaceFolder}/.vscode/scripts/download.ps1 '${workspaceFolder}'",
"linux": {
"command": "bash ${workspaceFolder}/.vscode/scripts/download.sh '${workspaceFolder}'",
},
"windows": {
"command": "PowerShell.exe -ExecutionPolicy Bypass -File ${workspaceFolder}/.vscode/scripts/download.ps1 '${workspaceFolder}'",
},
"problemMatcher": [],
"group": "build",
"presentation": {
"reveal": "always",
"panel": "new"
}
}
},
]
}

View file

@ -679,6 +679,11 @@ if(WIN32)
option(ENABLE_NSIS "Create Stratagus Window NSIS Installer" OFF)
endif()
if(EXISTS WIN32_CMAKE_PREFIX_PATH)
list(APPEND CMAKE_PREFIX_PATH "${WIN32_CMAKE_PREFIX_PATH}")
message("Using prefix path ${CMAKE_PREFIX_PATH}")
endif()
option(ENABLE_TOUCHSCREEN "Use touchscreen input" OFF)
option(WITH_BZIP2 "Compile Stratagus with BZip2 compression support" ON)