mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-02-05 23:13:46 +08:00
More work on win compiles
This commit is contained in:
parent
cc16682637
commit
4b0d7005a9
@ -3933,8 +3933,6 @@
|
|||||||
"assets/build/windows/Win32/vc_redist.x86.exe": "https://files.ballistica.net/cache/ba1/1c/e1/4a1a2eddda2f4aebd5f8b64ab08e",
|
"assets/build/windows/Win32/vc_redist.x86.exe": "https://files.ballistica.net/cache/ba1/1c/e1/4a1a2eddda2f4aebd5f8b64ab08e",
|
||||||
"assets/build/windows/Win32/vcruntime140d.dll": "https://files.ballistica.net/cache/ba1/50/8d/bc2600ac9491f1b14d659709451f",
|
"assets/build/windows/Win32/vcruntime140d.dll": "https://files.ballistica.net/cache/ba1/50/8d/bc2600ac9491f1b14d659709451f",
|
||||||
"ballisticacore-windows/Generic/BallisticaCore.ico": "https://files.ballistica.net/cache/ba1/89/c0/e32c7d2a35dc9aef57cc73b0911a",
|
"ballisticacore-windows/Generic/BallisticaCore.ico": "https://files.ballistica.net/cache/ba1/89/c0/e32c7d2a35dc9aef57cc73b0911a",
|
||||||
"ballisticacore-windows/build/Debug_Win32/BallisticaCoreGenericInternal.lib": "https://files.ballistica.net/cache/ba1/bb/ef/cbbb2871d6951c4178c51b9168ee",
|
|
||||||
"ballisticacore-windows/build/Debug_Win32/BallisticaCoreGenericInternal.pdb": "https://files.ballistica.net/cache/ba1/d4/4e/8f19b93f504faf01ab6110076482",
|
|
||||||
"build/prefab/full/linux_arm64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/e8/15/872df30172235c867eda63d89589",
|
"build/prefab/full/linux_arm64_gui/debug/ballisticacore": "https://files.ballistica.net/cache/ba1/e8/15/872df30172235c867eda63d89589",
|
||||||
"build/prefab/full/linux_arm64_gui/release/ballisticacore": "https://files.ballistica.net/cache/ba1/74/1d/fc9e33e565475daaac80da5252f0",
|
"build/prefab/full/linux_arm64_gui/release/ballisticacore": "https://files.ballistica.net/cache/ba1/74/1d/fc9e33e565475daaac80da5252f0",
|
||||||
"build/prefab/full/linux_arm64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/78/4f/3c6279192f18688bd84bb6a4411b",
|
"build/prefab/full/linux_arm64_server/debug/dist/ballisticacore_headless": "https://files.ballistica.net/cache/ba1/78/4f/3c6279192f18688bd84bb6a4411b",
|
||||||
@ -3970,5 +3968,7 @@
|
|||||||
"build/prefab/lib/mac_x86_64_gui/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/fc/09/e9e374f8ff007abd68731bd3ddb9",
|
"build/prefab/lib/mac_x86_64_gui/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/fc/09/e9e374f8ff007abd68731bd3ddb9",
|
||||||
"build/prefab/lib/mac_x86_64_gui/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/21/3f/116ca7d820d2e9722ac2505471f4",
|
"build/prefab/lib/mac_x86_64_gui/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/21/3f/116ca7d820d2e9722ac2505471f4",
|
||||||
"build/prefab/lib/mac_x86_64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/86/9f/c6610a0006b255768a74d73ce77b",
|
"build/prefab/lib/mac_x86_64_server/debug/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/86/9f/c6610a0006b255768a74d73ce77b",
|
||||||
"build/prefab/lib/mac_x86_64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/a1/6e/c4b8e6499dd2404c010eb25fc55e"
|
"build/prefab/lib/mac_x86_64_server/release/libballisticacore_internal.a": "https://files.ballistica.net/cache/ba1/a1/6e/c4b8e6499dd2404c010eb25fc55e",
|
||||||
|
"build/prefab/lib/windows/Debug_Win32/BallisticaCoreGenericInternal.lib": "https://files.ballistica.net/cache/ba1/f2/05/7ce635c1c407a4182b75b316c36e",
|
||||||
|
"build/prefab/lib/windows/Debug_Win32/BallisticaCoreGenericInternal.pdb": "https://files.ballistica.net/cache/ba1/06/63/ee6a0047fdcc7eac67ad99622ecc"
|
||||||
}
|
}
|
||||||
76
Makefile
76
Makefile
@ -486,29 +486,29 @@ build/prefab/full/windows_x86_server/release/dist/BallisticaCoreHeadless.exe: .e
|
|||||||
|
|
||||||
# Windows visual-studio-compiled debug
|
# Windows visual-studio-compiled debug
|
||||||
|
|
||||||
ballisticacore-windows/build/Debug_%/BallisticaCoreGenericInternal.lib: .efrocachemap
|
build/prefab/lib/windows/Debug_%/BallisticaCoreGenericInternal.lib: .efrocachemap
|
||||||
@tools/pcommand efrocache_get $@
|
@tools/pcommand efrocache_get $@
|
||||||
|
|
||||||
ballisticacore-windows/build/Debug_%/BallisticaCoreGenericInternal.pdb: .efrocachemap
|
build/prefab/lib/windows/Debug_%/BallisticaCoreGenericInternal.pdb: .efrocachemap
|
||||||
@tools/pcommand efrocache_get $@
|
@tools/pcommand efrocache_get $@
|
||||||
|
|
||||||
ballisticacore-windows/Generic/BallisticaCore.ico: .efrocachemap
|
ballisticacore-windows/Generic/BallisticaCore.ico: .efrocachemap
|
||||||
@tools/pcommand efrocache_get $@
|
@tools/pcommand efrocache_get $@
|
||||||
|
|
||||||
ballisticacore-windows/build/Debug_%/BallisticaCoreGenericInternal.exe: \
|
windows-wsl-debug-build: \
|
||||||
ballisticacore-windows/build/Debug_%/BallisticaCoreGenericInternal.lib \
|
prereqs code resources \
|
||||||
ballisticacore-windows/build/Debug_%/BallisticaCoreGenericInternal.pdb \
|
build/prefab/lib/windows/Debug_Win32/BallisticaCoreGenericInternal.lib \
|
||||||
ballisticacore-windows/Generic/BallisticaCore.ico \
|
build/prefab/lib/windows/Debug_Win32/BallisticaCoreGenericInternal.pdb \
|
||||||
prereqs code resources
|
ballisticacore-windows/Generic/BallisticaCore.ico
|
||||||
WINDOWS_PROJECT=Generic WINDOWS_CONFIGURATION=Debug WINDOWS_PLATFORM=$* \
|
WINDOWS_PROJECT=Generic WINDOWS_CONFIGURATION=Debug WINDOWS_PLATFORM=$* \
|
||||||
${MAKE} _windows-wsl-build
|
${MAKE} _windows-wsl-build
|
||||||
|
|
||||||
# These are 'intermediate' files and will get deleted implicitly by make
|
# These are 'intermediate' files and will get deleted implicitly by make
|
||||||
# if we don't do this.
|
# if we don't do this.
|
||||||
# See: https://www.gnu.org/software/make/manual/make.html#Special-Targets
|
# See: https://www.gnu.org/software/make/manual/make.html#Special-Targets
|
||||||
.PRECIOUS: \
|
# .PRECIOUS: \
|
||||||
ballisticacore-windows/build/Debug_%/BallisticaCoreGenericInternal.lib \
|
# ballisticacore-windows/build/Debug_%/BallisticaCoreGenericInternal.lib \
|
||||||
ballisticacore-windows/build/Debug_%/BallisticaCoreGenericInternal.pdb
|
# ballisticacore-windows/build/Debug_%/BallisticaCoreGenericInternal.pdb
|
||||||
|
|
||||||
# Tell make which of these targets don't represent files.
|
# Tell make which of these targets don't represent files.
|
||||||
.PHONY: prefab-debug prefab-release prefab-debug-build prefab-release-build \
|
.PHONY: prefab-debug prefab-release prefab-debug-build prefab-release-build \
|
||||||
@ -755,6 +755,30 @@ WINDOWS_PLATFORM ?= Win32
|
|||||||
# Can be Debug or Release
|
# Can be Debug or Release
|
||||||
WINDOWS_CONFIGURATION ?= Debug
|
WINDOWS_CONFIGURATION ?= Debug
|
||||||
|
|
||||||
|
# Base dir for all windows asset staging, intermediate files, and builds.
|
||||||
|
# Note: this value only applies to MSBuild compiles when launched through
|
||||||
|
# this Makefile. If you build/debug directly from within Visual Studio,
|
||||||
|
# its own project paths will be used instead. Those are set to line up
|
||||||
|
# with the defaults here, but if you change one then you may need to
|
||||||
|
# change the other. (or just always build via Makefile and things will
|
||||||
|
# always line up).
|
||||||
|
WINDOWS_BUILD_DIR ?= build/windows
|
||||||
|
|
||||||
|
foof:
|
||||||
|
echo PTH $(shell tools/pcommand wsl_path_to_win --escape --create $(WOUTDIR))
|
||||||
|
|
||||||
|
# Remove all non-git-managed files in windows subdir.
|
||||||
|
windows-clean:
|
||||||
|
@${CHECK_CLEAN_SAFETY}
|
||||||
|
git clean -dfx ballisticacore-windows
|
||||||
|
rm -rf ${WINDOWS_BUILD_DIR} ${LAZYBUILDDIR}
|
||||||
|
|
||||||
|
# Show what would be cleaned.
|
||||||
|
windows-clean-list:
|
||||||
|
@${CHECK_CLEAN_SAFETY}
|
||||||
|
git clean -dnx ballisticacore-windows
|
||||||
|
echo would also remove ${WINDOWS_BUILD_DIR} ${LAZYBUILDDIR}
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# #
|
# #
|
||||||
@ -884,6 +908,8 @@ WIN_MSBUILD_EXE_B = "${_WMSBE_1B}${_WMSBE_2B}"
|
|||||||
WINPRJ = $(WINDOWS_PROJECT)
|
WINPRJ = $(WINDOWS_PROJECT)
|
||||||
WINPLT = $(WINDOWS_PLATFORM)
|
WINPLT = $(WINDOWS_PLATFORM)
|
||||||
WINCFG = $(WINDOWS_CONFIGURATION)
|
WINCFG = $(WINDOWS_CONFIGURATION)
|
||||||
|
WOUTDIR = $(WINDOWS_BUILD_DIR)/$(WINCFG)_$(WINPLT)/
|
||||||
|
WINTDIR = $(WINDOWS_BUILD_DIR)/obj/BallisticaCore$(WINPRJ)/$(WINCFG)_$(WINPLT)/
|
||||||
|
|
||||||
# When using CLion, our cmake dir is root. Expose .clang-format there too.
|
# When using CLion, our cmake dir is root. Expose .clang-format there too.
|
||||||
ballisticacore-cmake/.clang-format: .clang-format
|
ballisticacore-cmake/.clang-format: .clang-format
|
||||||
@ -918,17 +944,29 @@ _cmake-simple-ci-server-build:
|
|||||||
|
|
||||||
_windows-wsl-build:
|
_windows-wsl-build:
|
||||||
${WIN_MSBUILD_EXE_B} \
|
${WIN_MSBUILD_EXE_B} \
|
||||||
${shell tools/pcommand wsl_to_escaped_win_path \
|
${shell tools/pcommand wsl_path_to_win --escape \
|
||||||
ballisticacore-windows/${WINPRJ}/BallisticaCore${WINPRJ}.vcxproj} \
|
ballisticacore-windows/${WINPRJ}/BallisticaCore${WINPRJ}.vcxproj} \
|
||||||
-target:Build -property:Configuration=${WINCFG} \
|
-target:Build \
|
||||||
-property:Platform=${WINPLT} ${VISUAL_STUDIO_VERSION}
|
-property:Configuration=${WINCFG} \
|
||||||
|
-property:Platform=${WINPLT} \
|
||||||
|
-property:IntDir=$(shell tools/pcommand wsl_path_to_win \
|
||||||
|
--escape --create $(WINTDIR)) \
|
||||||
|
-property:OutDir=$(shell tools/pcommand wsl_path_to_win \
|
||||||
|
--escape --create $(WOUTDIR)) \
|
||||||
|
${VISUAL_STUDIO_VERSION}
|
||||||
|
|
||||||
_windows-wsl-rebuild:
|
_windows-wsl-rebuild:
|
||||||
${WIN_MSBUILD_EXE_B} \
|
${WIN_MSBUILD_EXE_B} \
|
||||||
${shell tools/pcommand wsl_to_escaped_win_path \
|
${shell tools/pcommand wsl_path_to_win --escape \
|
||||||
ballisticacore-windows/${WINPRJ}/BallisticaCore${WINPRJ}.vcxproj} \
|
ballisticacore-windows/${WINPRJ}/BallisticaCore${WINPRJ}.vcxproj} \
|
||||||
-target:Rebuild -property:Configuration=${WINCFG} \
|
-target:Rebuild \
|
||||||
-property:Platform=${WINPLT} ${VISUAL_STUDIO_VERSION}
|
-property:Configuration=${WINCFG} \
|
||||||
|
-property:Platform=${WINPLT} \
|
||||||
|
-property:IntDir=$(shell tools/pcommand wsl_path_to_win \
|
||||||
|
--escape --create $(WINTDIR)) \
|
||||||
|
-property:OutDir=$(shell tools/pcommand wsl_path_to_win \
|
||||||
|
--escape --create $(WOUTDIR)) \
|
||||||
|
${VISUAL_STUDIO_VERSION}
|
||||||
|
|
||||||
# Tell make which of these targets don't represent files.
|
# Tell make which of these targets don't represent files.
|
||||||
.PHONY: _cmake-simple-ci-server-build _windows-wsl-build _windows-wsl-rebuild
|
.PHONY: _cmake-simple-ci-server-build _windows-wsl-build _windows-wsl-rebuild
|
||||||
|
|||||||
@ -727,7 +727,7 @@
|
|||||||
<ResourceCompile Include="BallisticaCore.rc" />
|
<ResourceCompile Include="BallisticaCore.rc" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Library Include="..\build\$(Configuration)_$(Platform)\$(MSBuildProjectName)Internal.lib" />
|
<Library Include="..\..\build\prefab\lib\windows\$(Configuration)_$(Platform)\$(MSBuildProjectName)Internal.lib" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
<ImportGroup Label="ExtensionTargets">
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
|||||||
@ -72,22 +72,22 @@
|
|||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<LinkIncremental>true</LinkIncremental>
|
<LinkIncremental>true</LinkIncremental>
|
||||||
<OutDir>$(ProjectDir)..\build\$(Configuration)_$(Platform)\</OutDir>
|
<OutDir>$(ProjectDir)..\build\$(Configuration)_$(Platform)\</OutDir>
|
||||||
<IntDir>$(ProjectDir)..\build\obj\$(MSBuildProjectName)\$(Platform)_$(Configuration)\</IntDir>
|
<IntDir>$(ProjectDir)..\build\obj\$(MSBuildProjectName)\$(Configuration)_$(Platform)\</IntDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
<LinkIncremental>true</LinkIncremental>
|
<LinkIncremental>true</LinkIncremental>
|
||||||
<OutDir>$(ProjectDir)..\build\$(Configuration)_$(Platform)\</OutDir>
|
<OutDir>$(ProjectDir)..\build\$(Configuration)_$(Platform)\</OutDir>
|
||||||
<IntDir>$(ProjectDir)..\build\obj\$(MSBuildProjectName)\$(Platform)_$(Configuration)\</IntDir>
|
<IntDir>$(ProjectDir)..\build\obj\$(MSBuildProjectName)\$(Configuration)_$(Platform)\</IntDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
<LinkIncremental>false</LinkIncremental>
|
<LinkIncremental>false</LinkIncremental>
|
||||||
<OutDir>$(ProjectDir)..\build\$(Configuration)_$(Platform)\</OutDir>
|
<OutDir>$(ProjectDir)..\build\$(Configuration)_$(Platform)\</OutDir>
|
||||||
<IntDir>$(ProjectDir)..\build\obj\$(MSBuildProjectName)\$(Platform)_$(Configuration)\</IntDir>
|
<IntDir>$(ProjectDir)..\build\obj\$(MSBuildProjectName)\$(Configuration)_$(Platform)\</IntDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
<LinkIncremental>false</LinkIncremental>
|
<LinkIncremental>false</LinkIncremental>
|
||||||
<OutDir>$(ProjectDir)..\build\$(Configuration)_$(Platform)\</OutDir>
|
<OutDir>$(ProjectDir)..\build\$(Configuration)_$(Platform)\</OutDir>
|
||||||
<IntDir>$(ProjectDir)..\build\obj\$(MSBuildProjectName)\$(Platform)_$(Configuration)\</IntDir>
|
<IntDir>$(ProjectDir)..\build\obj\$(MSBuildProjectName)\$(Configuration)_$(Platform)\</IntDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
@ -181,7 +181,7 @@
|
|||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Library Include="..\build\$(Configuration)_$(Platform)\$(MSBuildProjectName)Internal.lib" />
|
<Library Include="..\..\build\prefab\lib\windows\$(Configuration)_$(Platform)\$(MSBuildProjectName)Internal.lib" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="..\..\src\ballistica\app\app.cc" />
|
<ClCompile Include="..\..\src\ballistica\app\app.cc" />
|
||||||
|
|||||||
@ -474,23 +474,56 @@ def checkenv() -> None:
|
|||||||
batools.build.checkenv()
|
batools.build.checkenv()
|
||||||
|
|
||||||
|
|
||||||
def wsl_to_escaped_win_path() -> None:
|
def wsl_path_to_win() -> None:
|
||||||
"""Forward escape slashes in a provided win path arg."""
|
"""Forward escape slashes in a provided win path arg."""
|
||||||
import subprocess
|
import subprocess
|
||||||
|
import logging
|
||||||
|
import os
|
||||||
from efro.error import CleanError
|
from efro.error import CleanError
|
||||||
if len(sys.argv) != 3:
|
|
||||||
raise CleanError('Expected 1 path arg.')
|
|
||||||
try:
|
try:
|
||||||
out = subprocess.run(['wslpath', '-w', '-a', sys.argv[2]],
|
print('HELLO FROM WSL_PATH_TO_WIN', file=sys.stderr)
|
||||||
capture_output=True,
|
create = False
|
||||||
check=True)
|
escape = False
|
||||||
|
if len(sys.argv) < 3:
|
||||||
|
raise CleanError('Expected at least 1 path arg.')
|
||||||
|
wsl_path: Optional[str] = None
|
||||||
|
for arg in sys.argv[2:]:
|
||||||
|
if arg == '--create':
|
||||||
|
create = True
|
||||||
|
elif arg == '--escape':
|
||||||
|
escape = True
|
||||||
|
else:
|
||||||
|
if wsl_path is not None:
|
||||||
|
raise CleanError('More than one path provided.')
|
||||||
|
wsl_path = arg
|
||||||
|
if wsl_path is None:
|
||||||
|
raise CleanError('No path provided.')
|
||||||
|
|
||||||
|
# wslpath fails on nonexistent paths; make it clear when that happens.
|
||||||
|
if create:
|
||||||
|
os.makedirs(wsl_path, exist_ok=True)
|
||||||
|
if not os.path.exists(wsl_path):
|
||||||
|
raise CleanError(f'Path \'{wsl_path}\' does not exist.')
|
||||||
|
|
||||||
|
results = subprocess.run(['wslpath', '-w', '-a', wsl_path],
|
||||||
|
capture_output=True,
|
||||||
|
check=True)
|
||||||
except Exception:
|
except Exception:
|
||||||
# This gets used in a makefile so our returncode is ignored;
|
# This gets used in a makefile so our returncode is ignored;
|
||||||
# try to convey failure in other ways.
|
# let's try to make our failure known in other ways.
|
||||||
|
logging.exception('wsl_to_escaped_win_path failed.')
|
||||||
print('wsl_to_escaped_win_path_error_occurred', end='')
|
print('wsl_to_escaped_win_path_error_occurred', end='')
|
||||||
return
|
return
|
||||||
|
|
||||||
print(out.stdout.decode().strip().replace('\\', '\\\\'), end='')
|
out = results.stdout.decode().strip()
|
||||||
|
|
||||||
|
# If our input ended with a slash, match in the output.
|
||||||
|
if wsl_path.endswith('/') and not out.endswith('\\'):
|
||||||
|
out += '\\'
|
||||||
|
|
||||||
|
if escape:
|
||||||
|
out = out.replace('\\', '\\\\')
|
||||||
|
print(out, end='')
|
||||||
|
|
||||||
|
|
||||||
def ensure_build_platform() -> None:
|
def ensure_build_platform() -> None:
|
||||||
|
|||||||
@ -38,7 +38,7 @@ from batools.pcommand import (
|
|||||||
make_prefab, update_makebob, lazybuild, android_archive_unstripped_libs,
|
make_prefab, update_makebob, lazybuild, android_archive_unstripped_libs,
|
||||||
efro_gradle, stage_assets, update_assets_makefile, update_project,
|
efro_gradle, stage_assets, update_assets_makefile, update_project,
|
||||||
update_cmake_prefab_lib, cmake_prep_dir, gen_binding_code,
|
update_cmake_prefab_lib, cmake_prep_dir, gen_binding_code,
|
||||||
gen_flat_data_code, wsl_to_escaped_win_path)
|
gen_flat_data_code, wsl_path_to_win)
|
||||||
# pylint: enable=unused-import
|
# pylint: enable=unused-import
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user