Skip to content

Commit

Permalink
Fixed build for ARM64 Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugene Golushkov committed Dec 19, 2024
1 parent 67f9fdd commit 96b3046
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 4 deletions.
3 changes: 2 additions & 1 deletion OgreMain/include/OgrePlatform.h
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,8 @@ THE SOFTWARE.

// Define whether or not Ogre compiled with NEON support.
# if OGRE_DOUBLE_PRECISION == 0 && OGRE_CPU == OGRE_CPU_ARM && \
( defined( __aarch64__ ) || defined( __ARM_NEON__ ) || \
( defined( __aarch64__ ) || defined( __arm64__ ) || defined( _M_ARM64 ) || \
defined( __ARM_NEON__ ) || \
defined( _WIN32_WINNT_WIN8 ) && _WIN32_WINNT >= _WIN32_WINNT_WIN8 )
# define __OGRE_HAVE_NEON 1
# endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ THE SOFTWARE.

#include "VendorExtensions/OgreD3D11VendorExtension.h"

#if !OGRE_NO_AMD_AGS
#if !OGRE_NO_AMD_AGS && OGRE_CPU == OGRE_CPU_X86 // x86 or x64 only
# include <amd_ags.h>
#endif

#include "OgreHeaderPrefix.h"

namespace Ogre
{
#if !OGRE_NO_AMD_AGS
#if !OGRE_NO_AMD_AGS && OGRE_CPU == OGRE_CPU_X86 // x86 or x64 only
class _OgreD3D11Export D3D11AmdExtension : public D3D11VendorExtension
{
protected:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ THE SOFTWARE.

#include "VendorExtensions/OgreD3D11AmdExtension.h"

#if !OGRE_NO_AMD_AGS
#if !OGRE_NO_AMD_AGS && OGRE_CPU == OGRE_CPU_X86 // x86 or x64 only

# include "OgreLogManager.h"
# include "OgreLwString.h"
Expand Down
1 change: 1 addition & 0 deletions Scripts/BuildScripts/generate_build_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ def getGitBranchName():
platforms = \
[
'Win32',
'ARM64',
'x64'
]

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@

@echo off
SETLOCAL

set OGRE_BRANCH_NAME=master
set GENERATOR="Visual Studio 17 2022"
set PLATFORM=ARM64

set CMAKE_BIN_x86="C:\Program Files (x86)\CMake\bin\cmake.exe"
set CMAKE_BIN_x64="C:\Program Files\CMake\bin\cmake.exe"
IF EXIST %CMAKE_BIN_x64% (
echo CMake 64-bit detected
set CMAKE_BIN=%CMAKE_BIN_x64%
) ELSE (
IF EXIST %CMAKE_BIN_x86% (
echo CMake 32-bit detected
set CMAKE_BIN=%CMAKE_BIN_x86%
) ELSE (
echo Cannot detect either %CMAKE_BIN_x86% or
echo %CMAKE_BIN_x64% make sure CMake is installed
EXIT /B 1
)
)
echo Using CMake at %CMAKE_BIN%

mkdir Ogre
cd Ogre
IF NOT EXIST ogre-next-deps (
mkdir ogre-next-deps
echo --- Cloning ogre-next-deps ---
git clone --recurse-submodules --shallow-submodules https://github.com/OGRECave/ogre-next-deps
) ELSE (
echo --- ogre-next-deps repo detected. Cloning skipped ---
)
cd ogre-next-deps
mkdir build
cd build
echo --- Building ogre-next-deps ---
%CMAKE_BIN% -G %GENERATOR% -A %PLATFORM% ..
%CMAKE_BIN% --build . --config Debug
%CMAKE_BIN% --build . --target install --config Debug
%CMAKE_BIN% --build . --config Release
%CMAKE_BIN% --build . --target install --config Release

cd ../../
IF NOT EXIST ogre-next (
echo --- Cloning Ogre master ---
git clone --branch %OGRE_BRANCH_NAME% https://github.com/OGRECave/ogre-next
)
cd ogre-next
IF NOT EXIST Dependencies (
mklink /D Dependencies ..\ogre-next-deps\build\ogredeps
IF ERRORLEVEL 1 (
echo Failed to create Dependency directory symlink. Run the script as Administrator.
EXIT /B 1
)
)
mkdir build
cd build
echo --- Running CMake configure ---
%CMAKE_BIN% -D OGRE_CONFIG_THREAD_PROVIDER=0 -D OGRE_CONFIG_THREADS=0 -D OGRE_BUILD_COMPONENT_SCENE_FORMAT=1 -D OGRE_BUILD_SAMPLES2=1 -D OGRE_BUILD_TESTS=1 -D OGRE_DEPENDENCIES_DIR=..\..\ogre-next-deps\build\ogredeps -G %GENERATOR% -A %PLATFORM% ..
echo --- Building Ogre (Debug) ---
%CMAKE_BIN% --build . --config Debug
%CMAKE_BIN% --build . --target install --config Debug
echo --- Building Ogre (Release) ---
%CMAKE_BIN% --build . --config Release
%CMAKE_BIN% --build . --target install --config Release

echo Done!

ENDLOCAL

0 comments on commit 96b3046

Please sign in to comment.