gather all ENGLISH|GERMAN|CHINESE etc preprocessor hell into a single
library, so to restrict the number of targets that need to be built 8x
this still has UB/EDITOR definitions so that still needs to be dealt
with before we can build it only 8 times
iniErrorReport is a log file, all other log files have .log extension, so make it
consistent with that
make Ja2_settings.ini's extension lowercase. OCD, sorry.
.editorconfig already enforces it but it's getting changed piecemeal in
every commit. just get it done with.
the script:
```
find . -type f -not -path "./.git/*" -not -path "./.vs/*" | while read -r file; do
isFile=$(file -0 "$file" | cut -d $'\0' -f2)
case "$isFile" in
(*text*)
echo "$file is text"
if [[ $(tail -c 1 "$file" | wc -l) -ne 1 ]]; then
echo "" >> "$file"
fi
;;
(*)
echo "file isn't text"
;;
esac
done
```
requires clang/lld or mingw, obviously
just make sure the MSVC_DIRECTORY env variable points to valid Visual Studio Build Tools directory
and do: `cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE=clang_or_mingw_toolchain_file`
a recent Visual Studio update introduced an error unless there is a
CMakePresets.json file present, completely blowing up the previous
setup.
after this commit, you should either delete the CMakeUserPresets.json
file from your root or add it to your system - NOT repo! - excludesFile:
https://stackoverflow.com/questions/7335420/global-git-ignore
a recent Visual Studio update introduced an error unless there is a
CMakePresets.json file present, this patches it over for now and makes
note to remove it once this is fixed
now that CI is using cmake, we can be clean up the tree quite a bit
btw, cmake can still configure for the msbuild generator for those so inclined:
create the folder, cmd to it, run `cmake [project_root_dir] -G"Visual Studio 17 2022" -A Win32 -DLanguages=ENGLISH -DApplications=JA2` once, then open the solution file using Visual Studio 2022
- MSBuild has safe exception handlers (safeseh) enabled by default, which
some of our libraries don't support
- also needs legacy_stdio_definitions.lib to be linked
create empty CMakeUserPresets.json file so build happens on first run
comment doesn't apply anymore
no need to specify the compiler when using msbuild@xxx
ask ninja for the verbose command line when building
Tried to stay as close as possible to ja2_2019.sln
On Visual Studio 2022 just Project -> CMake Settings for Ja2, add
the x86 configurations you want and press F7.
Below shows how the -DLanguages -DApplications switches work, If you don't
set them, the CMakeCache.txt of them will be set to ENGLISH and JA2,
respectively:
cmake [...] // nothing set, configure just JA2_ENGLISH.exe by default
cmake [...] -DApplications="JA2UB" // configures just Unfinished Business
cmake [...] build -DApplications="JA2UB;JA2UBMAPEDITOR" // Unfinished Business and UB Map Editor
cmake [...] build -DApplications="JA2UB;JA2MAPEDITOR;ALL" // ALL is in the list, configures every application
cmake [...] build -DApplications="JA2MAPEDITOR;DeathStranding" // fatal error: DeathStranding not an application
cmake [...] -DLanguages="GERMAN" // configures just German targets
cmake [...] build -DLanguages="GERMAN;ENGLISH" // German and English
cmake [...] build -DLanguages="GERMAN;ENGLISH;ALL" // ALL is in the list, configures every language
cmake [...] build -DLanguages="ENGLISH;ESPERANTO" // fatal error: ESPERANTO not supported