Compare commits
26 Commits
c73daf422b
...
7e72e856e1
| Author | SHA1 | Date | |
|---|---|---|---|
| 7e72e856e1 | |||
| 2e78190bf0 | |||
| 03df23679f | |||
| c2cbf11e4d | |||
| f4c3fb1c72 | |||
| 5327529f38 | |||
| 12f686262c | |||
| c76b9f206f | |||
| 078485892f | |||
| 44b2db5d5d | |||
| cc401f0316 | |||
| f52f3920cb | |||
| f99a244b8e | |||
|
|
d93c32db9c | ||
|
|
08abdc159e | ||
|
|
708b9c6767 | ||
|
|
ed26a4c182 | ||
|
|
a239984908 | ||
|
|
fc3ea44c69 | ||
|
|
fdecad0d29 | ||
|
|
c7437ed533 | ||
|
|
dab44f5ceb | ||
|
|
c635d93b3c | ||
|
|
09fa3ce4be | ||
|
|
e1b3429b4c | ||
|
|
efa963be68 |
4
.github/workflows/build_ios.yml
vendored
4
.github/workflows/build_ios.yml
vendored
@@ -19,7 +19,7 @@ jobs:
|
||||
- name: Setup .NET
|
||||
uses: actions/setup-dotnet@v3
|
||||
with:
|
||||
dotnet-version: 8.0.x
|
||||
dotnet-version: 9.0.x
|
||||
- name: Setup .NET Workload
|
||||
run: |
|
||||
dotnet workload install ios
|
||||
@@ -33,4 +33,4 @@ jobs:
|
||||
git lfs pull
|
||||
- name: Build
|
||||
run: |
|
||||
./Development/Scripts/Mac/CallBuildTool.sh -build -log -dotnet=8 -arch=ARM64 -platform=iOS -configuration=Release -buildtargets=FlaxGame
|
||||
./Development/Scripts/Mac/CallBuildTool.sh -build -log -dotnet=9 -arch=ARM64 -platform=iOS -configuration=Release -buildtargets=FlaxGame
|
||||
|
||||
@@ -412,7 +412,7 @@ namespace FlaxEditor.Surface.ContextMenu
|
||||
{
|
||||
group.UnlockChildrenRecursive();
|
||||
// TODO: Improve filtering to be based on boxes with the most common things instead of first box
|
||||
if (_contextSensitiveSearchEnabled && _selectedBoxes[0] != null)
|
||||
if (_contextSensitiveSearchEnabled && _selectedBoxes.Count > 0 && _selectedBoxes[0] != null)
|
||||
UpdateFilters();
|
||||
else
|
||||
SortGroups();
|
||||
@@ -424,7 +424,7 @@ namespace FlaxEditor.Surface.ContextMenu
|
||||
OnSearchFilterChanged();
|
||||
}
|
||||
}
|
||||
else if (_contextSensitiveSearchEnabled)
|
||||
else if (_contextSensitiveSearchEnabled && _selectedBoxes.Count > 0)
|
||||
{
|
||||
// TODO: Filtering could be improved here as well
|
||||
group.EvaluateVisibilityWithBox(_selectedBoxes[0]);
|
||||
@@ -462,7 +462,7 @@ namespace FlaxEditor.Surface.ContextMenu
|
||||
Parent = group
|
||||
};
|
||||
}
|
||||
if (_contextSensitiveSearchEnabled)
|
||||
if (_contextSensitiveSearchEnabled && _selectedBoxes.Count > 0)
|
||||
group.EvaluateVisibilityWithBox(_selectedBoxes[0]);
|
||||
group.SortChildren();
|
||||
if (ShowExpanded)
|
||||
@@ -476,7 +476,7 @@ namespace FlaxEditor.Surface.ContextMenu
|
||||
|
||||
if (!isLayoutLocked)
|
||||
{
|
||||
if (_contextSensitiveSearchEnabled && _selectedBoxes[0] != null)
|
||||
if (_contextSensitiveSearchEnabled && _selectedBoxes.Count != 0 && _selectedBoxes[0] != null)
|
||||
UpdateFilters();
|
||||
else
|
||||
SortGroups();
|
||||
|
||||
@@ -257,16 +257,23 @@ namespace FlaxEditor.Viewport
|
||||
/// </summary>
|
||||
public void SaveActiveUIScalingOption()
|
||||
{
|
||||
var defaultKey = $"{Prefab.ID}:DefaultViewportScalingIndex";
|
||||
if (!Prefab)
|
||||
return;
|
||||
var id = Prefab.ID;
|
||||
var defaultKey = $"{id}:DefaultViewportScalingIndex";
|
||||
Editor.Instance.ProjectCache.SetCustomData(defaultKey, _defaultScaleActiveIndex.ToString());
|
||||
var customKey = $"{Prefab.ID}:CustomViewportScalingIndex";
|
||||
var customKey = $"{id}:CustomViewportScalingIndex";
|
||||
Editor.Instance.ProjectCache.SetCustomData(customKey, _customScaleActiveIndex.ToString());
|
||||
}
|
||||
|
||||
private void LoadCustomUIScalingOption()
|
||||
{
|
||||
if (!Prefab)
|
||||
return;
|
||||
var id = Prefab.ID;
|
||||
Prefab.WaitForLoaded();
|
||||
var defaultKey = $"{Prefab.ID}:DefaultViewportScalingIndex";
|
||||
|
||||
var defaultKey = $"{id}:DefaultViewportScalingIndex";
|
||||
if (Editor.Instance.ProjectCache.TryGetCustomData(defaultKey, out string defaultData))
|
||||
{
|
||||
if (int.TryParse(defaultData, out var index))
|
||||
@@ -286,7 +293,7 @@ namespace FlaxEditor.Viewport
|
||||
}
|
||||
}
|
||||
|
||||
var customKey = $"{Prefab.ID}:CustomViewportScalingIndex";
|
||||
var customKey = $"{id}:CustomViewportScalingIndex";
|
||||
if (Editor.Instance.ProjectCache.TryGetCustomData(customKey, out string data))
|
||||
{
|
||||
if (int.TryParse(data, out var index))
|
||||
|
||||
@@ -889,12 +889,12 @@ namespace FlaxEditor.Windows
|
||||
if (!_cursorVisible)
|
||||
Screen.CursorVisible = true;
|
||||
Screen.CursorLock = CursorLockMode.None;
|
||||
}
|
||||
|
||||
if (Editor.IsPlayMode && IsDocked && IsSelected && RootWindow.FocusedControl == null)
|
||||
{
|
||||
// Game UI cleared focus so regain it to maintain UI navigation just like game window does
|
||||
FlaxEngine.Scripting.InvokeOnUpdate(Focus);
|
||||
if (Editor.IsPlayMode && IsDocked && IsSelected && RootWindow.FocusedControl == null)
|
||||
{
|
||||
// Game UI cleared focus so regain it to maintain UI navigation just like game window does
|
||||
FlaxEngine.Scripting.InvokeOnUpdate(Focus);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -192,6 +192,7 @@ void GPUContextVulkan::AddImageBarrier(VkImage image, VkImageLayout srcLayout, V
|
||||
|
||||
void GPUContextVulkan::AddImageBarrier(GPUTextureViewVulkan* handle, VkImageLayout dstLayout)
|
||||
{
|
||||
ASSERT(handle->Owner);
|
||||
auto& state = handle->Owner->State;
|
||||
const auto subresourceIndex = handle->SubresourceIndex;
|
||||
if (subresourceIndex == -1)
|
||||
@@ -516,7 +517,7 @@ void GPUContextVulkan::UpdateDescriptorSets(const SpirvShaderDescriptorInfo& des
|
||||
case VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE:
|
||||
{
|
||||
auto handle = (GPUTextureViewVulkan*)handles[slot];
|
||||
if (!handle)
|
||||
if (!handle || !handle->Owner)
|
||||
{
|
||||
const auto dummy = _device->HelperResources.GetDummyTexture(descriptor.ResourceType);
|
||||
switch (descriptor.ResourceType)
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include "Engine/Physics/Physics.h"
|
||||
#include "Engine/Physics/PhysicsBackend.h"
|
||||
#include "Engine/Physics/PhysicsScene.h"
|
||||
#include "Engine/Profiler/ProfilerCPU.h"
|
||||
#include "Engine/Engine/Time.h"
|
||||
|
||||
#define CC_MIN_SIZE 0.001f
|
||||
@@ -178,6 +179,7 @@ CharacterController::CollisionFlags CharacterController::SimpleMove(const Vector
|
||||
|
||||
CharacterController::CollisionFlags CharacterController::Move(const Vector3& displacement)
|
||||
{
|
||||
PROFILE_CPU();
|
||||
CollisionFlags result = CollisionFlags::None;
|
||||
if (_controller && !_isUpdatingTransform)
|
||||
{
|
||||
@@ -377,7 +379,10 @@ void CharacterController::AddMovement(const Vector3& translation, const Quaterni
|
||||
displacement += GetPhysicsScene()->GetGravity() * deltaTime;
|
||||
}
|
||||
|
||||
Move(displacement);
|
||||
if (!displacement.IsZero())
|
||||
{
|
||||
Move(displacement);
|
||||
}
|
||||
|
||||
if (!rotation.IsIdentity())
|
||||
{
|
||||
|
||||
@@ -32,6 +32,7 @@ public:
|
||||
}
|
||||
|
||||
public:
|
||||
using JsonWriter::Key;
|
||||
|
||||
// [JsonWriter]
|
||||
void Key(const char* str, int32 length) override
|
||||
|
||||
@@ -390,7 +390,7 @@ public class Slider : ContainerControl
|
||||
}
|
||||
|
||||
// Draw thumb
|
||||
var thumbColorV = _isSliding ? ThumbColorSelected : (_mouseOverThumb ? ThumbColorHighlighted : ThumbColor);
|
||||
var thumbColorV = _isSliding ? ThumbColorSelected : (_mouseOverThumb || IsNavFocused ? ThumbColorHighlighted : ThumbColor);
|
||||
if (ThumbBrush != null)
|
||||
ThumbBrush.Draw(_thumbRect, thumbColorV);
|
||||
else
|
||||
|
||||
BIN
Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libopenal.a
(Stored with Git LFS)
vendored
BIN
Source/Platforms/Mac/Binaries/ThirdParty/ARM64/libopenal.a
(Stored with Git LFS)
vendored
Binary file not shown.
BIN
Source/Platforms/Mac/Binaries/ThirdParty/x64/libopenal.a
(Stored with Git LFS)
vendored
BIN
Source/Platforms/Mac/Binaries/ThirdParty/x64/libopenal.a
(Stored with Git LFS)
vendored
Binary file not shown.
BIN
Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libopenal.a
(Stored with Git LFS)
vendored
BIN
Source/Platforms/iOS/Binaries/ThirdParty/ARM64/libopenal.a
(Stored with Git LFS)
vendored
Binary file not shown.
2
Source/ThirdParty/SDL/SDL3/SDL.h
vendored
2
Source/ThirdParty/SDL/SDL3/SDL.h
vendored
@@ -20,7 +20,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* Main include header for the SDL library, version 3.2.20
|
||||
* Main include header for the SDL library, version 3.2.24
|
||||
*
|
||||
* It is almost always best to include just this one header instead of
|
||||
* picking out individual headers included here. There are exceptions to
|
||||
|
||||
2
Source/ThirdParty/SDL/SDL3/SDL_assert.h
vendored
2
Source/ThirdParty/SDL/SDL3/SDL_assert.h
vendored
@@ -126,7 +126,7 @@ extern "C" {
|
||||
*/
|
||||
#define SDL_TriggerBreakpoint() TriggerABreakpointInAPlatformSpecificManner
|
||||
|
||||
#elif defined(_MSC_VER) && _MSC_VER >= 1310
|
||||
#elif defined(__MINGW32__) || (defined(_MSC_VER) && _MSC_VER >= 1310)
|
||||
/* Don't include intrin.h here because it contains C++ code */
|
||||
extern void __cdecl __debugbreak(void);
|
||||
#define SDL_TriggerBreakpoint() __debugbreak()
|
||||
|
||||
2
Source/ThirdParty/SDL/SDL3/SDL_camera.h
vendored
2
Source/ThirdParty/SDL/SDL3/SDL_camera.h
vendored
@@ -119,7 +119,7 @@ typedef struct SDL_CameraSpec
|
||||
int width; /**< Frame width */
|
||||
int height; /**< Frame height */
|
||||
int framerate_numerator; /**< Frame rate numerator ((num / denom) == FPS, (denom / num) == duration in seconds) */
|
||||
int framerate_denominator; /**< Frame rate demoninator ((num / denom) == FPS, (denom / num) == duration in seconds) */
|
||||
int framerate_denominator; /**< Frame rate denominator ((num / denom) == FPS, (denom / num) == duration in seconds) */
|
||||
} SDL_CameraSpec;
|
||||
|
||||
/**
|
||||
|
||||
4
Source/ThirdParty/SDL/SDL3/SDL_endian.h
vendored
4
Source/ThirdParty/SDL/SDL3/SDL_endian.h
vendored
@@ -46,7 +46,7 @@
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1400)
|
||||
/* As of Clang 11, '_m_prefetchw' is conflicting with the winnt.h's version,
|
||||
so we define the needed '_m_prefetch' here as a pseudo-header, until the issue is fixed. */
|
||||
#ifdef __clang__
|
||||
#if defined(__clang__) && !SDL_HAS_BUILTIN(_m_prefetch)
|
||||
#ifndef __PRFCHWINTRIN_H
|
||||
#define __PRFCHWINTRIN_H
|
||||
static __inline__ void __attribute__((__always_inline__, __nodebug__))
|
||||
@@ -128,7 +128,7 @@ _m_prefetch(void *__P)
|
||||
* \sa SDL_BIG_ENDIAN
|
||||
*/
|
||||
#define SDL_BYTEORDER SDL_LIL_ENDIAN___or_maybe___SDL_BIG_ENDIAN
|
||||
#elif defined(SDL_PLATFORM_LINUX)
|
||||
#elif defined(SDL_PLATFORM_LINUX) || defined(__GLIBC__)
|
||||
#include <endian.h>
|
||||
#define SDL_BYTEORDER __BYTE_ORDER
|
||||
#elif defined(SDL_PLATFORM_SOLARIS)
|
||||
|
||||
8
Source/ThirdParty/SDL/SDL3/SDL_gpu.h
vendored
8
Source/ThirdParty/SDL/SDL3/SDL_gpu.h
vendored
@@ -224,8 +224,8 @@
|
||||
* - `drawIndirectFirstInstance`
|
||||
*
|
||||
* **D3D12:** Supported on Windows 10 or newer, Xbox One (GDK), and Xbox
|
||||
* Series X|S (GDK). Requires a GPU that supports DirectX 12 Feature Level
|
||||
* 11_1.
|
||||
* Series X|S (GDK). Requires a GPU that supports DirectX 12 Feature Level 11_0 and
|
||||
* Resource Binding Tier 2 or above.
|
||||
*
|
||||
* **Metal:** Supported on macOS 10.14+ and iOS/tvOS 13.0+. Hardware
|
||||
* requirements vary by operating system:
|
||||
@@ -1091,7 +1091,7 @@ typedef enum SDL_GPUCompareOp
|
||||
SDL_GPU_COMPAREOP_LESS_OR_EQUAL, /**< The comparison evaluates reference <= test. */
|
||||
SDL_GPU_COMPAREOP_GREATER, /**< The comparison evaluates reference > test. */
|
||||
SDL_GPU_COMPAREOP_NOT_EQUAL, /**< The comparison evaluates reference != test. */
|
||||
SDL_GPU_COMPAREOP_GREATER_OR_EQUAL, /**< The comparison evalutes reference >= test. */
|
||||
SDL_GPU_COMPAREOP_GREATER_OR_EQUAL, /**< The comparison evaluates reference >= test. */
|
||||
SDL_GPU_COMPAREOP_ALWAYS /**< The comparison always evaluates true. */
|
||||
} SDL_GPUCompareOp;
|
||||
|
||||
@@ -2648,7 +2648,7 @@ extern SDL_DECLSPEC void SDLCALL SDL_InsertGPUDebugLabel(
|
||||
const char *text);
|
||||
|
||||
/**
|
||||
* Begins a debug group with an arbitary name.
|
||||
* Begins a debug group with an arbitrary name.
|
||||
*
|
||||
* Used for denoting groups of calls when viewing the command buffer
|
||||
* callstream in a graphics debugging tool.
|
||||
|
||||
6
Source/ThirdParty/SDL/SDL3/SDL_hints.h
vendored
6
Source/ThirdParty/SDL/SDL3/SDL_hints.h
vendored
@@ -595,7 +595,7 @@ extern "C" {
|
||||
* A variable that limits what CPU features are available.
|
||||
*
|
||||
* By default, SDL marks all features the current CPU supports as available.
|
||||
* This hint allows to limit these to a subset.
|
||||
* This hint allows the enabled features to be limited to a subset.
|
||||
*
|
||||
* When the hint is unset, or empty, SDL will enable all detected CPU
|
||||
* features.
|
||||
@@ -2126,8 +2126,8 @@ extern "C" {
|
||||
*
|
||||
* The variable can be set to the following values:
|
||||
*
|
||||
* - "0": WGI is not used.
|
||||
* - "1": WGI is used. (default)
|
||||
* - "0": WGI is not used. (default)
|
||||
* - "1": WGI is used.
|
||||
*
|
||||
* This hint should be set before SDL is initialized.
|
||||
*
|
||||
|
||||
2
Source/ThirdParty/SDL/SDL3/SDL_render.h
vendored
2
Source/ThirdParty/SDL/SDL3/SDL_render.h
vendored
@@ -2612,7 +2612,7 @@ extern SDL_DECLSPEC bool SDLCALL SDL_RenderDebugText(SDL_Renderer *renderer, flo
|
||||
* Draw debug text to an SDL_Renderer.
|
||||
*
|
||||
* This function will render a printf()-style format string to a renderer.
|
||||
* Note that this is a convinence function for debugging, with severe
|
||||
* Note that this is a convenience function for debugging, with severe
|
||||
* limitations, and is not intended to be used for production apps and games.
|
||||
*
|
||||
* For the full list of limitations and other useful information, see
|
||||
|
||||
4
Source/ThirdParty/SDL/SDL3/SDL_revision.h
vendored
4
Source/ThirdParty/SDL/SDL3/SDL_revision.h
vendored
@@ -31,9 +31,9 @@
|
||||
/* #undef SDL_VENDOR_INFO */
|
||||
|
||||
#ifdef SDL_VENDOR_INFO
|
||||
#define SDL_REVISION "SDL3-3.2.20-release-3.2.20 (" SDL_VENDOR_INFO ")"
|
||||
#define SDL_REVISION "SDL-3.2.24-release-3.2.24 (" SDL_VENDOR_INFO ")"
|
||||
#else
|
||||
#define SDL_REVISION "SDL3-3.2.20-release-3.2.20"
|
||||
#define SDL_REVISION "SDL-3.2.24-release-3.2.24"
|
||||
#endif
|
||||
|
||||
#endif /* SDL_revision_h_ */
|
||||
|
||||
3
Source/ThirdParty/SDL/SDL3/SDL_sensor.h
vendored
3
Source/ThirdParty/SDL/SDL3/SDL_sensor.h
vendored
@@ -138,7 +138,8 @@ typedef enum SDL_SensorType
|
||||
SDL_SENSOR_ACCEL_L, /**< Accelerometer for left Joy-Con controller and Wii nunchuk */
|
||||
SDL_SENSOR_GYRO_L, /**< Gyroscope for left Joy-Con controller */
|
||||
SDL_SENSOR_ACCEL_R, /**< Accelerometer for right Joy-Con controller */
|
||||
SDL_SENSOR_GYRO_R /**< Gyroscope for right Joy-Con controller */
|
||||
SDL_SENSOR_GYRO_R, /**< Gyroscope for right Joy-Con controller */
|
||||
SDL_SENSOR_COUNT
|
||||
} SDL_SensorType;
|
||||
|
||||
|
||||
|
||||
18
Source/ThirdParty/SDL/SDL3/SDL_stdinc.h
vendored
18
Source/ThirdParty/SDL/SDL3/SDL_stdinc.h
vendored
@@ -3426,7 +3426,7 @@ extern SDL_DECLSPEC size_t SDLCALL SDL_utf8strnlen(const char *str, size_t bytes
|
||||
* Convert an integer into a string.
|
||||
*
|
||||
* This requires a radix to specified for string format. Specifying 10
|
||||
* produces a decimal number, 16 hexidecimal, etc. Must be in the range of 2
|
||||
* produces a decimal number, 16 hexadecimal, etc. Must be in the range of 2
|
||||
* to 36.
|
||||
*
|
||||
* Note that this function will overflow a buffer if `str` is not large enough
|
||||
@@ -3454,7 +3454,7 @@ extern SDL_DECLSPEC char * SDLCALL SDL_itoa(int value, char *str, int radix);
|
||||
* Convert an unsigned integer into a string.
|
||||
*
|
||||
* This requires a radix to specified for string format. Specifying 10
|
||||
* produces a decimal number, 16 hexidecimal, etc. Must be in the range of 2
|
||||
* produces a decimal number, 16 hexadecimal, etc. Must be in the range of 2
|
||||
* to 36.
|
||||
*
|
||||
* Note that this function will overflow a buffer if `str` is not large enough
|
||||
@@ -3482,7 +3482,7 @@ extern SDL_DECLSPEC char * SDLCALL SDL_uitoa(unsigned int value, char *str, int
|
||||
* Convert a long integer into a string.
|
||||
*
|
||||
* This requires a radix to specified for string format. Specifying 10
|
||||
* produces a decimal number, 16 hexidecimal, etc. Must be in the range of 2
|
||||
* produces a decimal number, 16 hexadecimal, etc. Must be in the range of 2
|
||||
* to 36.
|
||||
*
|
||||
* Note that this function will overflow a buffer if `str` is not large enough
|
||||
@@ -3510,7 +3510,7 @@ extern SDL_DECLSPEC char * SDLCALL SDL_ltoa(long value, char *str, int radix);
|
||||
* Convert an unsigned long integer into a string.
|
||||
*
|
||||
* This requires a radix to specified for string format. Specifying 10
|
||||
* produces a decimal number, 16 hexidecimal, etc. Must be in the range of 2
|
||||
* produces a decimal number, 16 hexadecimal, etc. Must be in the range of 2
|
||||
* to 36.
|
||||
*
|
||||
* Note that this function will overflow a buffer if `str` is not large enough
|
||||
@@ -3540,7 +3540,7 @@ extern SDL_DECLSPEC char * SDLCALL SDL_ultoa(unsigned long value, char *str, int
|
||||
* Convert a long long integer into a string.
|
||||
*
|
||||
* This requires a radix to specified for string format. Specifying 10
|
||||
* produces a decimal number, 16 hexidecimal, etc. Must be in the range of 2
|
||||
* produces a decimal number, 16 hexadecimal, etc. Must be in the range of 2
|
||||
* to 36.
|
||||
*
|
||||
* Note that this function will overflow a buffer if `str` is not large enough
|
||||
@@ -3568,7 +3568,7 @@ extern SDL_DECLSPEC char * SDLCALL SDL_lltoa(long long value, char *str, int rad
|
||||
* Convert an unsigned long long integer into a string.
|
||||
*
|
||||
* This requires a radix to specified for string format. Specifying 10
|
||||
* produces a decimal number, 16 hexidecimal, etc. Must be in the range of 2
|
||||
* produces a decimal number, 16 hexadecimal, etc. Must be in the range of 2
|
||||
* to 36.
|
||||
*
|
||||
* Note that this function will overflow a buffer if `str` is not large enough
|
||||
@@ -3923,7 +3923,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_strcasecmp(const char *str1, const char *str
|
||||
extern SDL_DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *str2, size_t maxlen);
|
||||
|
||||
/**
|
||||
* Searches a string for the first occurence of any character contained in a
|
||||
* Searches a string for the first occurrence of any character contained in a
|
||||
* breakset, and returns a pointer from the string to that character.
|
||||
*
|
||||
* \param str The null-terminated string to be searched. Must not be NULL, and
|
||||
@@ -3931,7 +3931,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_strncasecmp(const char *str1, const char *st
|
||||
* \param breakset A null-terminated string containing the list of characters
|
||||
* to look for. Must not be NULL, and must not overlap with
|
||||
* `str`.
|
||||
* \returns A pointer to the location, in str, of the first occurence of a
|
||||
* \returns A pointer to the location, in str, of the first occurrence of a
|
||||
* character present in the breakset, or NULL if none is found.
|
||||
*
|
||||
* \threadsafety It is safe to call this function from any thread.
|
||||
@@ -5821,7 +5821,7 @@ extern SDL_DECLSPEC int SDLCALL SDL_iconv_close(SDL_iconv_t cd);
|
||||
* This function converts text between encodings, reading from and writing to
|
||||
* a buffer.
|
||||
*
|
||||
* It returns the number of succesful conversions on success. On error,
|
||||
* It returns the number of successful conversions on success. On error,
|
||||
* SDL_ICONV_E2BIG is returned when the output buffer is too small, or
|
||||
* SDL_ICONV_EILSEQ is returned when an invalid input sequence is encountered,
|
||||
* or SDL_ICONV_EINVAL is returned when an incomplete input sequence is
|
||||
|
||||
2
Source/ThirdParty/SDL/SDL3/SDL_version.h
vendored
2
Source/ThirdParty/SDL/SDL3/SDL_version.h
vendored
@@ -62,7 +62,7 @@ extern "C" {
|
||||
*
|
||||
* \since This macro is available since SDL 3.2.0.
|
||||
*/
|
||||
#define SDL_MICRO_VERSION 20
|
||||
#define SDL_MICRO_VERSION 24
|
||||
|
||||
/**
|
||||
* This macro turns the version numbers into a numeric value.
|
||||
|
||||
2
Source/ThirdParty/SDL/SDL3/SDL_video.h
vendored
2
Source/ThirdParty/SDL/SDL3/SDL_video.h
vendored
@@ -1473,7 +1473,7 @@ extern SDL_DECLSPEC SDL_Window * SDLCALL SDL_GetWindowParent(SDL_Window *window)
|
||||
* - `SDL_PROP_WINDOW_COCOA_WINDOW_POINTER`: the `(__unsafe_unretained)`
|
||||
* NSWindow associated with the window
|
||||
* - `SDL_PROP_WINDOW_COCOA_METAL_VIEW_TAG_NUMBER`: the NSInteger tag
|
||||
* assocated with metal views on the window
|
||||
* associated with metal views on the window
|
||||
*
|
||||
* On OpenVR:
|
||||
*
|
||||
|
||||
@@ -241,7 +241,11 @@ namespace Flax.Deploy
|
||||
|
||||
if (!File.Exists(solutionFile))
|
||||
{
|
||||
throw new Exception(string.Format("Unable to build solution {0}. Solution file not found.", solutionFile));
|
||||
// CMake VS2026 generator prefers .slnx solution files, just swap the extension for CMake dependencies
|
||||
if (File.Exists(Path.ChangeExtension(solutionFile, "slnx")))
|
||||
solutionFile = Path.ChangeExtension(solutionFile, "slnx");
|
||||
else
|
||||
throw new Exception(string.Format("Unable to build solution {0}. Solution file not found.", solutionFile));
|
||||
}
|
||||
|
||||
string cmdLine = string.Format("\"{0}\" /m /t:Restore,Build /p:Configuration=\"{1}\" /p:Platform=\"{2}\" {3} /nologo", solutionFile, buildConfig, buildPlatform, Verbosity);
|
||||
|
||||
@@ -18,6 +18,24 @@ namespace Flax.Deps.Dependencies
|
||||
get => new[] { TargetPlatform.Windows };
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override TargetArchitecture[] Architectures
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (BuildPlatform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
TargetArchitecture.ARM64,
|
||||
};
|
||||
default: return new TargetArchitecture[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Build(BuildOptions options)
|
||||
{
|
||||
@@ -30,7 +48,7 @@ namespace Flax.Deps.Dependencies
|
||||
// Copy files
|
||||
foreach (var platform in options.Platforms)
|
||||
{
|
||||
BuildStarted(platform);
|
||||
BuildStarted(platform, TargetArchitecture.x64);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
|
||||
Utilities.FileCopy(Path.Combine(root, "ags_lib/lib/amd_ags_x64.lib"), Path.Combine(depsFolder, "amd_ags_x64.lib"));
|
||||
Utilities.FileCopy(Path.Combine(root, "ags_lib/lib/amd_ags_x64.dll"), Path.Combine(depsFolder, "amd_ags_x64.dll"));
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using Flax.Build;
|
||||
|
||||
namespace Flax.Deps.Dependencies
|
||||
@@ -39,6 +40,36 @@ namespace Flax.Deps.Dependencies
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override TargetArchitecture[] Architectures
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (BuildPlatform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
TargetArchitecture.ARM64,
|
||||
};
|
||||
case TargetPlatform.Linux:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
//TargetArchitecture.ARM64,
|
||||
};
|
||||
case TargetPlatform.Mac:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
TargetArchitecture.ARM64,
|
||||
};
|
||||
default: return new TargetArchitecture[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Build(BuildOptions options)
|
||||
{
|
||||
@@ -91,22 +122,22 @@ namespace Flax.Deps.Dependencies
|
||||
|
||||
foreach (var platform in options.Platforms)
|
||||
{
|
||||
BuildStarted(platform);
|
||||
switch (platform)
|
||||
foreach (var architecture in options.Architectures)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
{
|
||||
var configuration = "Release";
|
||||
var binariesWin = new[]
|
||||
BuildStarted(platform, architecture);
|
||||
switch (platform)
|
||||
{
|
||||
Path.Combine("bin", configuration, "assimp-vc140-md.dll"),
|
||||
Path.Combine("lib", configuration, "assimp-vc140-md.lib"),
|
||||
};
|
||||
case TargetPlatform.Windows:
|
||||
{
|
||||
var configuration = "Release";
|
||||
var binariesWin = new[]
|
||||
{
|
||||
Path.Combine("bin", configuration, "assimp-vc140-md.dll"),
|
||||
Path.Combine("lib", configuration, "assimp-vc140-md.lib"),
|
||||
};
|
||||
|
||||
// Build for Windows
|
||||
File.Delete(Path.Combine(root, "CMakeCache.txt"));
|
||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
||||
{
|
||||
// Build for Windows
|
||||
File.Delete(Path.Combine(root, "CMakeCache.txt"));
|
||||
var buildDir = Path.Combine(root, "build-" + architecture);
|
||||
var solutionPath = Path.Combine(buildDir, "Assimp.sln");
|
||||
SetupDirectory(buildDir, true);
|
||||
@@ -116,41 +147,40 @@ namespace Flax.Deps.Dependencies
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
foreach (var file in binariesWin)
|
||||
Utilities.FileCopy(Path.Combine(buildDir, file), Path.Combine(depsFolder, Path.GetFileName(file)));
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Linux:
|
||||
{
|
||||
var envVars = new Dictionary<string, string>
|
||||
case TargetPlatform.Linux:
|
||||
{
|
||||
{ "CC", "clang-" + Configuration.LinuxClangMinVer },
|
||||
{ "CC_FOR_BUILD", "clang-" + Configuration.LinuxClangMinVer },
|
||||
{ "CXX", "clang++-" + Configuration.LinuxClangMinVer },
|
||||
};
|
||||
var envVars = new Dictionary<string, string>
|
||||
{
|
||||
{ "CC", "clang-" + Configuration.LinuxClangMinVer },
|
||||
{ "CC_FOR_BUILD", "clang-" + Configuration.LinuxClangMinVer },
|
||||
{ "CXX", "clang-" + Configuration.LinuxClangMinVer },
|
||||
{ "CMAKE_BUILD_PARALLEL_LEVEL", CmakeBuildParallel },
|
||||
};
|
||||
|
||||
// Build for Linux
|
||||
RunCmake(root, platform, TargetArchitecture.x64, " -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF " + globalConfig, envVars);
|
||||
Utilities.Run("make", null, null, root, Utilities.RunOptions.ThrowExceptionOnError, envVars);
|
||||
configHeaderFilePath = Path.Combine(root, "include", "assimp", "config.h");
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
|
||||
Utilities.FileCopy(Path.Combine(root, "lib", "libassimp.a"), Path.Combine(depsFolder, "libassimp.a"));
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Mac:
|
||||
{
|
||||
// Build for Mac
|
||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
||||
// Build for Linux
|
||||
File.Delete(Path.Combine(root, "CMakeCache.txt"));
|
||||
RunCmake(root, platform, architecture, " -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF " + globalConfig, envVars);
|
||||
Utilities.Run("make", null, null, root, Utilities.RunOptions.ThrowExceptionOnError, envVars);
|
||||
configHeaderFilePath = Path.Combine(root, "include", "assimp", "config.h");
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
Utilities.FileCopy(Path.Combine(root, "lib", "libassimp.a"), Path.Combine(depsFolder, "libassimp.a"));
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Mac:
|
||||
{
|
||||
// Build for Mac
|
||||
File.Delete(Path.Combine(root, "CMakeCache.txt"));
|
||||
RunCmake(root, platform, architecture, " -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF " + globalConfig);
|
||||
Utilities.Run("make", null, null, root, Utilities.RunOptions.ThrowExceptionOnError);
|
||||
configHeaderFilePath = Path.Combine(root, "include", "assimp", "config.h");
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
Utilities.FileCopy(Path.Combine(root, "lib", "libassimp.a"), Path.Combine(depsFolder, "libassimp.a"));
|
||||
Utilities.Run("make", "clean", null, root, Utilities.RunOptions.ThrowExceptionOnError);
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,6 +28,24 @@ namespace Flax.Deps.Dependencies
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override TargetArchitecture[] Architectures
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (BuildPlatform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
TargetArchitecture.ARM64,
|
||||
};
|
||||
default: return new TargetArchitecture[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Build(BuildOptions options)
|
||||
{
|
||||
@@ -46,12 +64,12 @@ namespace Flax.Deps.Dependencies
|
||||
|
||||
foreach (var platform in options.Platforms)
|
||||
{
|
||||
BuildStarted(platform);
|
||||
switch (platform)
|
||||
foreach (var architecture in options.Architectures)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
{
|
||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
||||
BuildStarted(platform, architecture);
|
||||
switch (platform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
{
|
||||
Deploy.VCEnvironment.BuildSolution(solutionPath, configuration, architecture.ToString());
|
||||
var depsFolder = GetThirdPartyFolder(options, TargetPlatform.Windows, architecture);
|
||||
@@ -61,7 +79,7 @@ namespace Flax.Deps.Dependencies
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,22 +31,40 @@ namespace Flax.Deps.Dependencies
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override TargetArchitecture[] Architectures
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (BuildPlatform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
TargetArchitecture.ARM64,
|
||||
};
|
||||
default: return new TargetArchitecture[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Build(BuildOptions options)
|
||||
{
|
||||
foreach (var platform in options.Platforms)
|
||||
{
|
||||
BuildStarted(platform);
|
||||
switch (platform)
|
||||
foreach (var architecture in options.Architectures)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
{
|
||||
var sdk = WindowsPlatformBase.GetSDKs().Last();
|
||||
var sdkLibLocation = Path.Combine(sdk.Value, "Lib", WindowsPlatformBase.GetSDKVersion(sdk.Key).ToString(), "um");
|
||||
string binLocation = Path.Combine(sdk.Value, "bin", WindowsPlatformBase.GetSDKVersion(sdk.Key).ToString());
|
||||
|
||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
||||
BuildStarted(platform, architecture);
|
||||
switch (platform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
{
|
||||
var sdk = WindowsPlatformBase.GetSDKs().Last();
|
||||
var sdkLibLocation = Path.Combine(sdk.Value, "Lib", WindowsPlatformBase.GetSDKVersion(sdk.Key).ToString(), "um");
|
||||
string binLocation = Path.Combine(sdk.Value, "bin", WindowsPlatformBase.GetSDKVersion(sdk.Key).ToString());
|
||||
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
|
||||
string dxilLocation = @$"{binLocation}\{architecture}\dxil.dll";
|
||||
@@ -60,9 +78,9 @@ namespace Flax.Deps.Dependencies
|
||||
string d3dcompilerLibLocation = @$"{sdkLibLocation}\{architecture}\d3dcompiler.lib";
|
||||
Utilities.FileCopy(dxcompilerLibLocation, Path.Combine(depsFolder, Path.GetFileName(dxcompilerLibLocation)));
|
||||
Utilities.FileCopy(d3dcompilerLibLocation, Path.Combine(depsFolder, "d3dcompiler_47.lib"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,24 @@ namespace Flax.Deps.Dependencies
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override TargetArchitecture[] Architectures
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (BuildPlatform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
TargetArchitecture.ARM64,
|
||||
};
|
||||
default: return new TargetArchitecture[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Build(BuildOptions options)
|
||||
{
|
||||
@@ -47,44 +65,44 @@ namespace Flax.Deps.Dependencies
|
||||
|
||||
foreach (var platform in options.Platforms)
|
||||
{
|
||||
BuildStarted(platform);
|
||||
switch (platform)
|
||||
foreach (var architecture in options.Architectures)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
{
|
||||
var solutionPath = Path.Combine(root, "DirectXTex_Desktop_2022_Win10.sln");
|
||||
var binFolder = Path.Combine(root, "DirectXTex", "Bin", "Desktop_2022_Win10");
|
||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
||||
BuildStarted(platform, architecture);
|
||||
switch (platform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
{
|
||||
var solutionPath = Path.Combine(root, "DirectXTex_Desktop_2022_Win10.sln");
|
||||
var binFolder = Path.Combine(root, "DirectXTex", "Bin", "Desktop_2022_Win10");
|
||||
Deploy.VCEnvironment.BuildSolution(solutionPath, configuration, architecture.ToString());
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
foreach (var file in outputFileNames)
|
||||
Utilities.FileCopy(Path.Combine(binFolder, architecture.ToString(), configuration, file), Path.Combine(depsFolder, file));
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.UWP:
|
||||
{
|
||||
var solutionPath = Path.Combine(root, "DirectXTex_Windows10_2019.sln");
|
||||
var binFolder = Path.Combine(root, "DirectXTex", "Bin", "Windows10_2019");
|
||||
Deploy.VCEnvironment.BuildSolution(solutionPath, configuration, "x64");
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
foreach (var file in outputFileNames)
|
||||
Utilities.FileCopy(Path.Combine(binFolder, "x64", configuration, file), Path.Combine(depsFolder, file));
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.XboxOne:
|
||||
case TargetPlatform.XboxScarlett:
|
||||
{
|
||||
var solutionPath = Path.Combine(root, "DirectXTex_GDK_2022.sln");
|
||||
var binFolder = Path.Combine(root, "DirectXTex", "Bin", "GDK_2022");
|
||||
var xboxName = platform == TargetPlatform.XboxOne ? "Gaming.Xbox.XboxOne.x64" : "Gaming.Xbox.Scarlett.x64";
|
||||
Deploy.VCEnvironment.BuildSolution(solutionPath, configuration, xboxName);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
|
||||
foreach (var file in outputFileNames)
|
||||
Utilities.FileCopy(Path.Combine(binFolder, xboxName, configuration, file), Path.Combine(depsFolder, file));
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.UWP:
|
||||
{
|
||||
var solutionPath = Path.Combine(root, "DirectXTex_Windows10_2019.sln");
|
||||
var binFolder = Path.Combine(root, "DirectXTex", "Bin", "Windows10_2019");
|
||||
Deploy.VCEnvironment.BuildSolution(solutionPath, configuration, "x64");
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
|
||||
foreach (var file in outputFileNames)
|
||||
Utilities.FileCopy(Path.Combine(binFolder, "x64", configuration, file), Path.Combine(depsFolder, file));
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.XboxOne:
|
||||
case TargetPlatform.XboxScarlett:
|
||||
{
|
||||
var solutionPath = Path.Combine(root, "DirectXTex_GDK_2022.sln");
|
||||
var binFolder = Path.Combine(root, "DirectXTex", "Bin", "GDK_2022");
|
||||
var xboxName = platform == TargetPlatform.XboxOne ? "Gaming.Xbox.XboxOne.x64" : "Gaming.Xbox.Scarlett.x64";
|
||||
Deploy.VCEnvironment.BuildSolution(solutionPath, configuration, xboxName);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
|
||||
foreach (var file in outputFileNames)
|
||||
Utilities.FileCopy(Path.Combine(binFolder, xboxName, configuration, file), Path.Combine(depsFolder, file));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -36,6 +36,24 @@ namespace Flax.Deps.Dependencies
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override TargetArchitecture[] Architectures
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (BuildPlatform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
TargetArchitecture.ARM64,
|
||||
};
|
||||
default: return new TargetArchitecture[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Build(BuildOptions options)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// Copyright (c) Wojciech Figat. All rights reserved.
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
@@ -50,6 +51,36 @@ namespace Flax.Deps.Dependencies
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override TargetArchitecture[] Architectures
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (BuildPlatform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
TargetArchitecture.ARM64,
|
||||
};
|
||||
case TargetPlatform.Linux:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
//TargetArchitecture.ARM64,
|
||||
};
|
||||
case TargetPlatform.Mac:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
TargetArchitecture.ARM64,
|
||||
};
|
||||
default: return new TargetArchitecture[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Build(BuildOptions options)
|
||||
{
|
||||
@@ -59,41 +90,51 @@ namespace Flax.Deps.Dependencies
|
||||
// Get the source
|
||||
CloneGitRepoSingleBranch(root, "https://github.com/FlaxEngine/NvCloth.git", "master");
|
||||
|
||||
// Patch the CMakeLists.txt to support custom compilation flags
|
||||
foreach (var os in new[] { "android", "ios", "linux", "mac", "windows", })
|
||||
{
|
||||
var filePath = Path.Combine(nvCloth, "compiler", "cmake", os, "CMakeLists.txt");
|
||||
var appendLine = "SET(CMAKE_CXX_FLAGS \"${CMAKE_CXX_FLAGS} ${NVCLOTH_CXX_FLAGS}\")";
|
||||
if (!File.ReadAllText(filePath).Contains(appendLine))
|
||||
File.AppendAllText(filePath, Environment.NewLine + appendLine + Environment.NewLine);
|
||||
}
|
||||
|
||||
foreach (var platform in options.Platforms)
|
||||
{
|
||||
BuildStarted(platform);
|
||||
switch (platform)
|
||||
foreach (var architecture in options.Architectures)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
Build(options, platform, TargetArchitecture.x64);
|
||||
Build(options, platform, TargetArchitecture.ARM64);
|
||||
break;
|
||||
case TargetPlatform.XboxOne:
|
||||
case TargetPlatform.XboxScarlett:
|
||||
Build(options, platform, TargetArchitecture.x64);
|
||||
break;
|
||||
case TargetPlatform.PS4:
|
||||
case TargetPlatform.PS5:
|
||||
Utilities.DirectoryCopy(Path.Combine(GetBinariesFolder(options, platform), "Data", "NvCloth"), root, true, true);
|
||||
Build(options, platform, TargetArchitecture.x64);
|
||||
break;
|
||||
case TargetPlatform.Switch:
|
||||
Utilities.DirectoryCopy(Path.Combine(GetBinariesFolder(options, platform), "Data", "NvCloth"), root, true, true);
|
||||
Build(options, platform, TargetArchitecture.ARM64);
|
||||
break;
|
||||
case TargetPlatform.Android:
|
||||
Build(options, platform, TargetArchitecture.ARM64);
|
||||
break;
|
||||
case TargetPlatform.Mac:
|
||||
Build(options, platform, TargetArchitecture.x64);
|
||||
Build(options, platform, TargetArchitecture.ARM64);
|
||||
break;
|
||||
case TargetPlatform.iOS:
|
||||
Build(options, platform, TargetArchitecture.ARM64);
|
||||
break;
|
||||
case TargetPlatform.Linux:
|
||||
Build(options, platform, TargetArchitecture.x64);
|
||||
break;
|
||||
BuildStarted(platform, architecture);
|
||||
switch (platform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
Build(options, platform, architecture);
|
||||
break;
|
||||
case TargetPlatform.XboxOne:
|
||||
case TargetPlatform.XboxScarlett:
|
||||
Build(options, platform, TargetArchitecture.x64);
|
||||
break;
|
||||
case TargetPlatform.PS4:
|
||||
case TargetPlatform.PS5:
|
||||
Utilities.DirectoryCopy(Path.Combine(GetBinariesFolder(options, platform), "Data", "NvCloth"), root, true, true);
|
||||
Build(options, platform, TargetArchitecture.x64);
|
||||
break;
|
||||
case TargetPlatform.Switch:
|
||||
Utilities.DirectoryCopy(Path.Combine(GetBinariesFolder(options, platform), "Data", "NvCloth"), root, true, true);
|
||||
Build(options, platform, TargetArchitecture.ARM64);
|
||||
break;
|
||||
case TargetPlatform.Android:
|
||||
Build(options, platform, TargetArchitecture.ARM64);
|
||||
break;
|
||||
case TargetPlatform.Mac:
|
||||
Build(options, platform, architecture);
|
||||
break;
|
||||
case TargetPlatform.iOS:
|
||||
Build(options, platform, TargetArchitecture.ARM64);
|
||||
break;
|
||||
case TargetPlatform.Linux:
|
||||
Build(options, platform, architecture);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,7 +151,7 @@ namespace Flax.Deps.Dependencies
|
||||
// Peek options
|
||||
var binariesPrefix = string.Empty;
|
||||
var binariesPostfix = string.Empty;
|
||||
var cmakeArgs = "-DNV_CLOTH_ENABLE_DX11=0 -DNV_CLOTH_ENABLE_CUDA=0 -DPX_GENERATE_GPU_PROJECTS=0";
|
||||
var cmakeArgs = "-DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DNV_CLOTH_ENABLE_DX11=0 -DNV_CLOTH_ENABLE_CUDA=0 -DPX_GENERATE_GPU_PROJECTS=0";
|
||||
var cmakeName = string.Empty;
|
||||
var buildFolder = Path.Combine(nvCloth, "compiler", platform.ToString() + '_' + architecture.ToString());
|
||||
var envVars = new Dictionary<string, string>();
|
||||
@@ -153,7 +194,7 @@ namespace Flax.Deps.Dependencies
|
||||
}
|
||||
break;
|
||||
case TargetPlatform.Mac:
|
||||
cmakeArgs += " -DTARGET_BUILD_PLATFORM=mac";
|
||||
cmakeArgs += " -DTARGET_BUILD_PLATFORM=mac -DNVCLOTH_CXX_FLAGS=\"-Wno-error=poison-system-directories -Wno-error=missing-include-dirs\"";
|
||||
cmakeName = "mac";
|
||||
binariesPrefix = "lib";
|
||||
break;
|
||||
@@ -163,7 +204,7 @@ namespace Flax.Deps.Dependencies
|
||||
binariesPrefix = "lib";
|
||||
break;
|
||||
case TargetPlatform.Linux:
|
||||
cmakeArgs += " -DTARGET_BUILD_PLATFORM=linux";
|
||||
cmakeArgs += " -DTARGET_BUILD_PLATFORM=linux -DNVCLOTH_CXX_FLAGS=\"-Wno-error=poison-system-directories -Wno-error=missing-include-dirs\"";
|
||||
cmakeName = "linux";
|
||||
binariesPrefix = "lib";
|
||||
break;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Copyright (c) Wojciech Figat. All rights reserved.
|
||||
|
||||
//#define USE_GIT_REPOSITORY
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
@@ -45,130 +45,67 @@ namespace Flax.Deps.Dependencies
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override TargetArchitecture[] Architectures
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (BuildPlatform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
TargetArchitecture.ARM64,
|
||||
};
|
||||
case TargetPlatform.Linux:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
//TargetArchitecture.ARM64,
|
||||
};
|
||||
case TargetPlatform.Mac:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
TargetArchitecture.ARM64,
|
||||
};
|
||||
default: return new TargetArchitecture[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Build(BuildOptions options)
|
||||
{
|
||||
var root = options.IntermediateFolder;
|
||||
var version = "1.24.3";
|
||||
var configuration = "Release";
|
||||
var cmakeArgs = "-DCMAKE_POLICY_VERSION_MINIMUM=3.5";
|
||||
var dstIncludePath = Path.Combine(options.ThirdPartyFolder, "OpenAL");
|
||||
var noSSL = true; // OpenAL Soft website has broken certs
|
||||
|
||||
foreach (var platform in options.Platforms)
|
||||
{
|
||||
BuildStarted(platform);
|
||||
switch (platform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
{
|
||||
var binariesToCopy = new[]
|
||||
{
|
||||
"OpenAL32.lib",
|
||||
"OpenAL32.dll",
|
||||
};
|
||||
|
||||
// Get the source
|
||||
CloneGitRepo(root, "https://github.com/kcat/openal-soft.git");
|
||||
GitCheckout(root, "master", "dc7d7054a5b4f3bec1dc23a42fd616a0847af948"); // 1.24.3
|
||||
|
||||
// Build for Win64 and ARM64
|
||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
||||
{
|
||||
var buildDir = Path.Combine(root, "build-" + architecture.ToString());
|
||||
var solutionPath = Path.Combine(buildDir, "OpenAL.sln");
|
||||
|
||||
RunCmake(root, platform, architecture, $"-B\"{buildDir}\" -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS=\"/D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR /EHsc\" -DCMAKE_CXX_FLAGS=\"/D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR /EHsc\"");
|
||||
Deploy.VCEnvironment.BuildSolution(solutionPath, configuration, architecture.ToString());
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
foreach (var file in binariesToCopy)
|
||||
Utilities.FileCopy(Path.Combine(buildDir, configuration, file), Path.Combine(depsFolder, Path.GetFileName(file)));
|
||||
}
|
||||
|
||||
#if false
|
||||
// Get the binaries
|
||||
var packagePath = Path.Combine(root, "package.zip");
|
||||
if (!File.Exists(packagePath))
|
||||
Downloader.DownloadFileFromUrlToPath("https://openal-soft.org/openal-binaries/openal-soft-" + version + "-bin.zip", packagePath);
|
||||
using (ZipArchive archive = ZipFile.Open(packagePath, ZipArchiveMode.Read))
|
||||
{
|
||||
if (!Directory.Exists(root))
|
||||
archive.ExtractToDirectory(root);
|
||||
root = Path.Combine(root, archive.Entries.First().FullName);
|
||||
}
|
||||
|
||||
// Deploy Win64 binaries
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
|
||||
Utilities.FileCopy(Path.Combine(root, "bin", "Win64", "soft_oal.dll"), Path.Combine(depsFolder, "OpenAL32.dll"));
|
||||
Utilities.FileCopy(Path.Combine(root, "libs", "Win64", "OpenAL32.lib"), Path.Combine(depsFolder, "OpenAL32.lib"));
|
||||
|
||||
// Deploy license
|
||||
Utilities.FileCopy(Path.Combine(root, "COPYING"), Path.Combine(dstIncludePath, "COPYING"), true);
|
||||
|
||||
// Deploy header files
|
||||
var files = Directory.GetFiles(Path.Combine(root, "include", "AL"));
|
||||
foreach (var file in files)
|
||||
{
|
||||
Utilities.FileCopy(file, Path.Combine(dstIncludePath, Path.GetFileName(file)));
|
||||
}
|
||||
#if !USE_GIT_REPOSITORY
|
||||
if (options.Platforms.Contains(TargetPlatform.Windows))
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Linux:
|
||||
{
|
||||
// Get the source
|
||||
CloneGitRepo(root, "https://github.com/kcat/openal-soft.git");
|
||||
GitCheckout(root, "master", "dc7d7054a5b4f3bec1dc23a42fd616a0847af948"); // 1.24.3
|
||||
}
|
||||
#if !USE_GIT_REPOSITORY
|
||||
else
|
||||
{
|
||||
// Get the source
|
||||
var packagePath = Path.Combine(root, $"package-{version}.zip");
|
||||
if (!File.Exists(packagePath))
|
||||
{
|
||||
var binariesToCopy = new[]
|
||||
{
|
||||
"libopenal.a",
|
||||
};
|
||||
var envVars = new Dictionary<string, string>
|
||||
{
|
||||
{ "CC", "clang-" + Configuration.LinuxClangMinVer },
|
||||
{ "CC_FOR_BUILD", "clang-" + Configuration.LinuxClangMinVer },
|
||||
{ "CMAKE_BUILD_PARALLEL_LEVEL", CmakeBuildParallel },
|
||||
};
|
||||
var config = $"-DALSOFT_REQUIRE_ALSA=ON " +
|
||||
$"-DALSOFT_REQUIRE_OSS=ON " +
|
||||
$"-DALSOFT_REQUIRE_PORTAUDIO=ON " +
|
||||
$"-DALSOFT_REQUIRE_PULSEAUDIO=ON " +
|
||||
$"-DALSOFT_REQUIRE_JACK=ON " +
|
||||
$"-DALSOFT_REQUIRE_PIPEWIRE=ON " +
|
||||
$"-DALSOFT_EMBED_HRTF_DATA=YES ";
|
||||
Downloader.DownloadFileFromUrlToPath("https://openal-soft.org/openal-releases/openal-soft-" + version + ".tar.bz2", packagePath, noSSL);
|
||||
using (ZipArchive archive = ZipFile.Open(packagePath, ZipArchiveMode.Read))
|
||||
|
||||
// Get the source
|
||||
var packagePath = Path.Combine(root, "package.zip");
|
||||
File.Delete(packagePath);
|
||||
Downloader.DownloadFileFromUrlToPath("https://openal-soft.org/openal-releases/openal-soft-" + version + ".tar.bz2", packagePath);
|
||||
Utilities.Run("tar", "xjf " + packagePath.Replace('\\', '/'), null, root, Utilities.RunOptions.ConsoleLogOutput);
|
||||
|
||||
// Use separate build directory
|
||||
root = Path.Combine(root, "openal-soft-" + version);
|
||||
var buildDir = Path.Combine(root, "build");
|
||||
SetupDirectory(buildDir, true);
|
||||
|
||||
// Build for Linux
|
||||
Utilities.Run("cmake", $"-G \"Unix Makefiles\" -DCMAKE_BUILD_TYPE={configuration} -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DLIBTYPE=STATIC {config} ..", null, buildDir, Utilities.RunOptions.ConsoleLogOutput, envVars);
|
||||
BuildCmake(buildDir, configuration, envVars);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
|
||||
foreach (var file in binariesToCopy)
|
||||
Utilities.FileCopy(Path.Combine(buildDir, file), Path.Combine(depsFolder, file));
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Android:
|
||||
{
|
||||
var binariesToCopy = new[]
|
||||
{
|
||||
"libopenal.a",
|
||||
};
|
||||
var envVars = new Dictionary<string, string>
|
||||
{
|
||||
{ "CMAKE_BUILD_PARALLEL_LEVEL", CmakeBuildParallel },
|
||||
};
|
||||
var config = " -DALSOFT_REQUIRE_OBOE=OFF -DALSOFT_REQUIRE_OPENSL=ON -DALSOFT_EMBED_HRTF_DATA=YES";
|
||||
|
||||
// Get the source
|
||||
var packagePath = Path.Combine(root, "package.zip");
|
||||
File.Delete(packagePath);
|
||||
Downloader.DownloadFileFromUrlToPath("https://openal-soft.org/openal-releases/openal-soft-" + version + ".tar.bz2", packagePath);
|
||||
if (Platform.BuildTargetPlatform == TargetPlatform.Windows)
|
||||
{
|
||||
// TODO: Maybe use PowerShell Expand-Archive instead?
|
||||
var sevenZip = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), "7-Zip", "7z.exe");
|
||||
Utilities.Run(sevenZip, "x package.zip", null, root);
|
||||
Utilities.Run(sevenZip, "x package", null, root);
|
||||
@@ -177,89 +114,166 @@ namespace Flax.Deps.Dependencies
|
||||
{
|
||||
Utilities.Run("tar", "xjf " + packagePath.Replace('\\', '/'), null, root, Utilities.RunOptions.ConsoleLogOutput);
|
||||
}
|
||||
|
||||
// Use separate build directory
|
||||
root = Path.Combine(root, "openal-soft-" + version);
|
||||
var buildDir = Path.Combine(root, "build");
|
||||
SetupDirectory(buildDir, true);
|
||||
|
||||
// Build
|
||||
RunCmake(buildDir, platform, TargetArchitecture.ARM64, ".. -DLIBTYPE=STATIC -DCMAKE_BUILD_TYPE=" + configuration + config, envVars);
|
||||
BuildCmake(buildDir, envVars);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.ARM64);
|
||||
foreach (var file in binariesToCopy)
|
||||
Utilities.FileCopy(Path.Combine(buildDir, file), Path.Combine(depsFolder, file));
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Mac:
|
||||
}
|
||||
#endif
|
||||
|
||||
foreach (var platform in options.Platforms)
|
||||
{
|
||||
foreach (var architecture in options.Architectures)
|
||||
{
|
||||
var binariesToCopy = new[]
|
||||
BuildStarted(platform, architecture);
|
||||
switch (platform)
|
||||
{
|
||||
"libopenal.a",
|
||||
};
|
||||
var envVars = new Dictionary<string, string>
|
||||
case TargetPlatform.Windows:
|
||||
{
|
||||
{ "CMAKE_BUILD_PARALLEL_LEVEL", CmakeBuildParallel },
|
||||
};
|
||||
var config = " -DALSOFT_REQUIRE_COREAUDIO=ON -DALSOFT_EMBED_HRTF_DATA=YES";
|
||||
var binariesToCopy = new[]
|
||||
{
|
||||
"OpenAL32.lib",
|
||||
"OpenAL32.dll",
|
||||
};
|
||||
|
||||
// Get the source
|
||||
var packagePath = Path.Combine(root, "package.zip");
|
||||
File.Delete(packagePath);
|
||||
Downloader.DownloadFileFromUrlToPath("https://openal-soft.org/openal-releases/openal-soft-" + version + ".tar.bz2", packagePath);
|
||||
Utilities.Run("tar", "xjf " + packagePath.Replace('\\', '/'), null, root, Utilities.RunOptions.ConsoleLogOutput);
|
||||
|
||||
// Use separate build directory
|
||||
root = Path.Combine(root, "openal-soft-" + version);
|
||||
var buildDir = Path.Combine(root, "build");
|
||||
|
||||
// Build for Mac
|
||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
||||
{
|
||||
// Build for Windows
|
||||
var buildDir = Path.Combine(root, "build-" + architecture.ToString());
|
||||
var solutionPath = Path.Combine(buildDir, "OpenAL.sln");
|
||||
SetupDirectory(buildDir, true);
|
||||
RunCmake(buildDir, platform, architecture, ".. -DLIBTYPE=STATIC -DCMAKE_BUILD_TYPE=" + configuration + config, envVars);
|
||||
RunCmake(root, platform, architecture, $"-B\"{buildDir}\" -DBUILD_SHARED_LIBS=OFF -DCMAKE_C_FLAGS=\"/D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR /EHsc\" -DCMAKE_CXX_FLAGS=\"/D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR /EHsc\" " + cmakeArgs);
|
||||
Deploy.VCEnvironment.BuildSolution(solutionPath, configuration, architecture.ToString());
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
foreach (var file in binariesToCopy)
|
||||
Utilities.FileCopy(Path.Combine(buildDir, configuration, file), Path.Combine(depsFolder, Path.GetFileName(file)));
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Linux:
|
||||
{
|
||||
var binariesToCopy = new[]
|
||||
{
|
||||
"libopenal.a",
|
||||
};
|
||||
var envVars = new Dictionary<string, string>
|
||||
{
|
||||
{ "CC", "clang-" + Configuration.LinuxClangMinVer },
|
||||
{ "CC_FOR_BUILD", "clang-" + Configuration.LinuxClangMinVer },
|
||||
{ "CMAKE_BUILD_PARALLEL_LEVEL", CmakeBuildParallel },
|
||||
};
|
||||
var config = $"-DALSOFT_REQUIRE_ALSA=ON " +
|
||||
$"-DALSOFT_REQUIRE_OSS=ON " +
|
||||
$"-DALSOFT_REQUIRE_PORTAUDIO=ON " +
|
||||
$"-DALSOFT_REQUIRE_PULSEAUDIO=ON " +
|
||||
$"-DALSOFT_REQUIRE_JACK=ON " +
|
||||
$"-DALSOFT_REQUIRE_PIPEWIRE=ON " +
|
||||
$"-DALSOFT_EMBED_HRTF_DATA=YES "
|
||||
+ cmakeArgs;
|
||||
|
||||
// Use separate build directory
|
||||
#if !USE_GIT_REPOSITORY
|
||||
root = Path.Combine(root, "openal-soft-" + version);
|
||||
#endif
|
||||
var buildDir = Path.Combine(root, "build-" + architecture.ToString());
|
||||
SetupDirectory(buildDir, true);
|
||||
|
||||
// Build for Linux
|
||||
RunCmake(root, platform, architecture, $"-B\"{buildDir}\" -DLIBTYPE=STATIC -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=" + configuration + config, envVars);
|
||||
BuildCmake(buildDir, configuration, envVars);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
foreach (var file in binariesToCopy)
|
||||
Utilities.FileCopy(Path.Combine(buildDir, file), Path.Combine(depsFolder, file));
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Android:
|
||||
{
|
||||
var binariesToCopy = new[]
|
||||
{
|
||||
"libopenal.a",
|
||||
};
|
||||
var envVars = new Dictionary<string, string>
|
||||
{
|
||||
{ "CMAKE_BUILD_PARALLEL_LEVEL", CmakeBuildParallel },
|
||||
};
|
||||
var config = "-DALSOFT_REQUIRE_OBOE=OFF -DALSOFT_REQUIRE_OPENSL=ON -DALSOFT_EMBED_HRTF_DATA=YES " + cmakeArgs;
|
||||
|
||||
// Use separate build directory
|
||||
#if !USE_GIT_REPOSITORY
|
||||
root = Path.Combine(root, "openal-soft-" + version);
|
||||
#endif
|
||||
var buildDir = Path.Combine(root, "build-" + architecture.ToString());
|
||||
SetupDirectory(buildDir, true);
|
||||
|
||||
// Build
|
||||
RunCmake(root, platform, TargetArchitecture.ARM64, $"-B\"{buildDir}\" -DLIBTYPE=STATIC -DCMAKE_BUILD_TYPE=" + configuration + config, envVars);
|
||||
BuildCmake(buildDir, envVars);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.ARM64);
|
||||
foreach (var file in binariesToCopy)
|
||||
Utilities.FileCopy(Path.Combine(buildDir, file), Path.Combine(depsFolder, file));
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Mac:
|
||||
{
|
||||
var binariesToCopy = new[]
|
||||
{
|
||||
"libopenal.a",
|
||||
};
|
||||
var envVars = new Dictionary<string, string>
|
||||
{
|
||||
{ "CMAKE_BUILD_PARALLEL_LEVEL", CmakeBuildParallel },
|
||||
};
|
||||
var config = " -DALSOFT_REQUIRE_COREAUDIO=ON -DALSOFT_EMBED_HRTF_DATA=YES " + cmakeArgs;
|
||||
|
||||
// Use separate build directory
|
||||
#if !USE_GIT_REPOSITORY
|
||||
root = Path.Combine(root, "openal-soft-" + version);
|
||||
#endif
|
||||
var buildDir = Path.Combine(root, "build-" + architecture.ToString());
|
||||
SetupDirectory(buildDir, true);
|
||||
|
||||
// Build for Mac
|
||||
RunCmake(root, platform, architecture, $"-B\"{buildDir}\" -DLIBTYPE=STATIC -DCMAKE_BUILD_TYPE=" + configuration + config, envVars);
|
||||
BuildCmake(buildDir, envVars);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
foreach (var file in binariesToCopy)
|
||||
Utilities.FileCopy(Path.Combine(buildDir, file), Path.Combine(depsFolder, file));
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.iOS:
|
||||
{
|
||||
var binariesToCopy = new[]
|
||||
case TargetPlatform.iOS:
|
||||
{
|
||||
"libopenal.a",
|
||||
};
|
||||
var envVars = new Dictionary<string, string>
|
||||
{
|
||||
{ "CMAKE_BUILD_PARALLEL_LEVEL", CmakeBuildParallel },
|
||||
};
|
||||
var config = " -DALSOFT_REQUIRE_COREAUDIO=ON -DALSOFT_EMBED_HRTF_DATA=YES";
|
||||
var binariesToCopy = new[]
|
||||
{
|
||||
"libopenal.a",
|
||||
};
|
||||
var envVars = new Dictionary<string, string>
|
||||
{
|
||||
{ "CMAKE_BUILD_PARALLEL_LEVEL", CmakeBuildParallel },
|
||||
};
|
||||
var config = " -DALSOFT_REQUIRE_COREAUDIO=ON -DALSOFT_EMBED_HRTF_DATA=YES " + cmakeArgs;
|
||||
|
||||
// Get the source
|
||||
var packagePath = Path.Combine(root, "package.zip");
|
||||
if (!File.Exists(packagePath))
|
||||
{
|
||||
Downloader.DownloadFileFromUrlToPath("https://openal-soft.org/openal-releases/openal-soft-" + version + ".tar.bz2", packagePath);
|
||||
Utilities.Run("tar", "xjf " + packagePath.Replace('\\', '/'), null, root, Utilities.RunOptions.ConsoleLogOutput);
|
||||
// Use separate build directory
|
||||
#if !USE_GIT_REPOSITORY
|
||||
root = Path.Combine(root, "openal-soft-" + version);
|
||||
#endif
|
||||
var buildDir = Path.Combine(root, "build-" + architecture.ToString());
|
||||
SetupDirectory(buildDir, true);
|
||||
|
||||
// Build for iOS
|
||||
RunCmake(root, platform, TargetArchitecture.ARM64, $"-B\"{buildDir}\" -DCMAKE_SYSTEM_NAME=iOS -DALSOFT_OSX_FRAMEWORK=ON -DLIBTYPE=STATIC -DCMAKE_BUILD_TYPE=" + configuration + config, envVars);
|
||||
BuildCmake(buildDir, envVars);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.ARM64);
|
||||
foreach (var file in binariesToCopy)
|
||||
Utilities.FileCopy(Path.Combine(buildDir, file), Path.Combine(depsFolder, file));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Use separate build directory
|
||||
root = Path.Combine(root, "openal-soft-" + version);
|
||||
var buildDir = Path.Combine(root, "build");
|
||||
|
||||
// Build for iOS
|
||||
SetupDirectory(buildDir, true);
|
||||
RunCmake(buildDir, platform, TargetArchitecture.ARM64, ".. -DCMAKE_SYSTEM_NAME=iOS -DALSOFT_OSX_FRAMEWORK=ON -DLIBTYPE=STATIC -DCMAKE_BUILD_TYPE=" + configuration + config, envVars);
|
||||
BuildCmake(buildDir, envVars);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.ARM64);
|
||||
foreach (var file in binariesToCopy)
|
||||
Utilities.FileCopy(Path.Combine(buildDir, file), Path.Combine(depsFolder, file));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Deploy license
|
||||
Utilities.FileCopy(Path.Combine(root, "COPYING"), Path.Combine(dstIncludePath, "COPYING"), true);
|
||||
|
||||
// Deploy header files
|
||||
var files = Directory.GetFiles(Path.Combine(root, "include", "AL"));
|
||||
foreach (var file in files)
|
||||
{
|
||||
Utilities.FileCopy(file, Path.Combine(dstIncludePath, Path.GetFileName(file)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,6 +51,36 @@ namespace Flax.Deps.Dependencies
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override TargetArchitecture[] Architectures
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (BuildPlatform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
TargetArchitecture.ARM64,
|
||||
};
|
||||
case TargetPlatform.Linux:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
//TargetArchitecture.ARM64,
|
||||
};
|
||||
case TargetPlatform.Mac:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
TargetArchitecture.ARM64,
|
||||
};
|
||||
default: return new TargetArchitecture[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private string root;
|
||||
private string projectGenDir;
|
||||
private string projectGenPath;
|
||||
@@ -65,8 +95,13 @@ namespace Flax.Deps.Dependencies
|
||||
if (cmakeSwitch.HasAttribute("name") && cmakeSwitch.Attributes["name"].Value == name)
|
||||
{
|
||||
cmakeSwitch.Attributes["value"].Value = value;
|
||||
return;
|
||||
}
|
||||
}
|
||||
var child = cmakeSwitches.OwnerDocument.CreateElement(cmakeSwitches.ChildNodes[0].Name);
|
||||
child.SetAttribute("name", name);
|
||||
child.SetAttribute("value", value);
|
||||
cmakeSwitches.AppendChild(child);
|
||||
}
|
||||
|
||||
private void Build(BuildOptions options, string preset, TargetPlatform targetPlatform, TargetArchitecture architecture)
|
||||
@@ -94,11 +129,14 @@ namespace Flax.Deps.Dependencies
|
||||
case TargetPlatform.Windows:
|
||||
if (architecture == TargetArchitecture.ARM64)
|
||||
{
|
||||
// Windows ARM64 doesn't have GPU support, so avoid copying those DLLs around
|
||||
// Windows ARM64 doesn't have precompiled files for GPU support, so avoid copying those DLLs around
|
||||
ConfigureCmakeSwitch(cmakeSwitches, "PX_COPY_EXTERNAL_DLL", "OFF");
|
||||
ConfigureCmakeSwitch(cmakeParams, "PX_COPY_EXTERNAL_DLL", "OFF");
|
||||
}
|
||||
break;
|
||||
case TargetPlatform.Linux:
|
||||
ConfigureCmakeSwitch(cmakeParams, "PHYSX_CXX_FLAGS", "\"-Wno-error=format -Wno-error=unused-but-set-variable -Wno-error=switch-default -Wno-error=invalid-offsetof -Wno-error=unsafe-buffer-usage -Wno-error=unsafe-buffer-usage-in-libc-call -Wno-error=missing-include-dirs\"");
|
||||
break;
|
||||
case TargetPlatform.Android:
|
||||
ConfigureCmakeSwitch(cmakeParams, "CMAKE_INSTALL_PREFIX", $"install/android-{Configuration.AndroidPlatformApi}/PhysX");
|
||||
ConfigureCmakeSwitch(cmakeParams, "ANDROID_NATIVE_API_LEVEL", $"android-{Configuration.AndroidPlatformApi}");
|
||||
@@ -106,6 +144,7 @@ namespace Flax.Deps.Dependencies
|
||||
break;
|
||||
case TargetPlatform.Mac:
|
||||
ConfigureCmakeSwitch(cmakeParams, "CMAKE_OSX_DEPLOYMENT_TARGET", Configuration.MacOSXMinVer);
|
||||
ConfigureCmakeSwitch(cmakeParams, "PHYSX_CXX_FLAGS", "\"-Wno-error=format -Wno-error=unused-but-set-variable -Wno-error=switch-default -Wno-error=invalid-offsetof -Wno-error=unsafe-buffer-usage -Wno-error=unsafe-buffer-usage-in-libc-call -Wno-error=missing-include-dirs\"");
|
||||
break;
|
||||
case TargetPlatform.iOS:
|
||||
ConfigureCmakeSwitch(cmakeParams, "CMAKE_OSX_DEPLOYMENT_TARGET", Configuration.iOSMinVer);
|
||||
@@ -122,10 +161,11 @@ namespace Flax.Deps.Dependencies
|
||||
string bits;
|
||||
string arch;
|
||||
string binariesSubDir;
|
||||
string buildPlatform;
|
||||
string buildPlatform = architecture == TargetArchitecture.x86 ? "Win32" : architecture.ToString();
|
||||
bool suppressBitsPostfix = false;
|
||||
string binariesPrefix = string.Empty;
|
||||
var envVars = new Dictionary<string, string>();
|
||||
envVars.Add("CMAKE_BUILD_PARALLEL_LEVEL", CmakeBuildParallel);
|
||||
switch (architecture)
|
||||
{
|
||||
case TargetArchitecture.x86:
|
||||
@@ -146,15 +186,6 @@ namespace Flax.Deps.Dependencies
|
||||
break;
|
||||
default: throw new InvalidArchitectureException(architecture);
|
||||
}
|
||||
switch (architecture)
|
||||
{
|
||||
case TargetArchitecture.x86:
|
||||
buildPlatform = "Win32";
|
||||
break;
|
||||
default:
|
||||
buildPlatform = architecture.ToString();
|
||||
break;
|
||||
}
|
||||
var msBuildProps = new Dictionary<string, string>();
|
||||
switch (targetPlatform)
|
||||
{
|
||||
@@ -383,60 +414,79 @@ namespace Flax.Deps.Dependencies
|
||||
|
||||
foreach (var platform in options.Platforms)
|
||||
{
|
||||
BuildStarted(platform);
|
||||
switch (platform)
|
||||
foreach (var architecture in options.Architectures)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
{
|
||||
Build(options, "vc17win64", platform, TargetArchitecture.x64);
|
||||
Build(options, "vc17win-arm64", platform, TargetArchitecture.ARM64);
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Linux:
|
||||
{
|
||||
Build(options, "linux", platform, TargetArchitecture.x64);
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.PS4:
|
||||
{
|
||||
Utilities.DirectoryCopy(Path.Combine(GetBinariesFolder(options, platform), "Data", "PhysX"), root, true, true);
|
||||
Build(options, "ps4", platform, TargetArchitecture.x64);
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.PS5:
|
||||
{
|
||||
Utilities.DirectoryCopy(Path.Combine(GetBinariesFolder(options, platform), "Data", "PhysX"), root, true, true);
|
||||
Build(options, "ps5", platform, TargetArchitecture.x64);
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.XboxScarlett:
|
||||
case TargetPlatform.XboxOne:
|
||||
{
|
||||
Build(options, "vc16win64", platform, TargetArchitecture.x64);
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Android:
|
||||
{
|
||||
Build(options, "android", platform, TargetArchitecture.ARM64);
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Switch:
|
||||
{
|
||||
Utilities.DirectoryCopy(Path.Combine(GetBinariesFolder(options, platform), "Data", "PhysX"), root, true, true);
|
||||
Build(options, "switch64", platform, TargetArchitecture.ARM64);
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Mac:
|
||||
{
|
||||
Build(options, "mac64", platform, TargetArchitecture.x64);
|
||||
Build(options, "mac-arm64", platform, TargetArchitecture.ARM64);
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.iOS:
|
||||
{
|
||||
Build(options, "ios64", platform, TargetArchitecture.ARM64);
|
||||
break;
|
||||
}
|
||||
BuildStarted(platform, architecture);
|
||||
switch (platform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
{
|
||||
if (architecture == TargetArchitecture.x64 || architecture == TargetArchitecture.ARM64)
|
||||
{
|
||||
try
|
||||
{
|
||||
Build(options, architecture == TargetArchitecture.x64 ? "vc18win64" : "vc18win-arm64", platform, architecture);
|
||||
}
|
||||
catch
|
||||
{
|
||||
Log.Verbose("Failed to generate VS2026 solution for PhysX, fallback to VS2022");
|
||||
Build(options, architecture == TargetArchitecture.x64 ? "vc17win64" : "vc17win-arm64", platform, architecture);
|
||||
}
|
||||
}
|
||||
else
|
||||
throw new InvalidArchitectureException(architecture);
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Linux:
|
||||
{
|
||||
Build(options, "linux", platform, architecture);
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.PS4:
|
||||
{
|
||||
Utilities.DirectoryCopy(Path.Combine(GetBinariesFolder(options, platform), "Data", "PhysX"), root, true, true);
|
||||
Build(options, "ps4", platform, TargetArchitecture.x64);
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.PS5:
|
||||
{
|
||||
Utilities.DirectoryCopy(Path.Combine(GetBinariesFolder(options, platform), "Data", "PhysX"), root, true, true);
|
||||
Build(options, "ps5", platform, TargetArchitecture.x64);
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.XboxScarlett:
|
||||
case TargetPlatform.XboxOne:
|
||||
{
|
||||
Build(options, "vc16win64", platform, TargetArchitecture.x64);
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Android:
|
||||
{
|
||||
Build(options, "android", platform, TargetArchitecture.ARM64);
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Switch:
|
||||
{
|
||||
Utilities.DirectoryCopy(Path.Combine(GetBinariesFolder(options, platform), "Data", "PhysX"), root, true, true);
|
||||
Build(options, "switch64", platform, TargetArchitecture.ARM64);
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Mac:
|
||||
{
|
||||
if (architecture == TargetArchitecture.x64)
|
||||
Build(options, "mac64", platform, architecture);
|
||||
else if (architecture == TargetArchitecture.ARM64)
|
||||
Build(options, "mac-arm64", platform, architecture);
|
||||
else
|
||||
throw new InvalidArchitectureException(architecture);
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.iOS:
|
||||
{
|
||||
Build(options, "ios64", platform, TargetArchitecture.ARM64);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -444,7 +494,7 @@ namespace Flax.Deps.Dependencies
|
||||
var dstIncludePath = Path.Combine(options.ThirdPartyFolder, "PhysX");
|
||||
Directory.GetFiles(dstIncludePath, "*.h", SearchOption.AllDirectories).ToList().ForEach(File.Delete);
|
||||
Utilities.FileCopy(Path.Combine(root, "LICENSE.md"), Path.Combine(dstIncludePath, "License.txt"));
|
||||
Utilities.DirectoryCopy(Path.Combine(root, "physx", "include"), dstIncludePath);
|
||||
Utilities.DirectoryCopy(Path.Combine(root, "physx", "include"), dstIncludePath, true, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,6 +43,36 @@ namespace Flax.Deps.Dependencies
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override TargetArchitecture[] Architectures
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (BuildPlatform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
TargetArchitecture.ARM64,
|
||||
};
|
||||
case TargetPlatform.Linux:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
//TargetArchitecture.ARM64,
|
||||
};
|
||||
case TargetPlatform.Mac:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
TargetArchitecture.ARM64,
|
||||
};
|
||||
default: return new TargetArchitecture[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Build(BuildOptions options)
|
||||
{
|
||||
@@ -90,16 +120,16 @@ namespace Flax.Deps.Dependencies
|
||||
|
||||
CloneGitRepo(root, "https://github.com/libsdl-org/SDL");
|
||||
GitFetch(root);
|
||||
GitResetToCommit(root, "96292a5b464258a2b926e0a3d72f8b98c2a81aa6"); // 3.2.20
|
||||
GitResetToCommit(root, "a8589a84226a6202831a3d49ff4edda4acab9acd"); // 3.2.24
|
||||
|
||||
foreach (var platform in options.Platforms)
|
||||
{
|
||||
BuildStarted(platform);
|
||||
switch (platform)
|
||||
foreach (var architecture in options.Architectures)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
{
|
||||
foreach (var architecture in new TargetArchitecture[] { TargetArchitecture.x64/*, TargetArchitecture.ARM64*/ })
|
||||
BuildStarted(platform, architecture);
|
||||
switch (platform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
{
|
||||
var buildDir = Path.Combine(root, "build-" + architecture.ToString());
|
||||
|
||||
@@ -109,7 +139,7 @@ namespace Flax.Deps.Dependencies
|
||||
else
|
||||
binariesToCopy = new[] { "SDL3.dll", "SDL3.lib", };
|
||||
directoriesToCopy.Add(Path.Combine(buildDir, "include", "SDL3"));
|
||||
|
||||
|
||||
var solutionPath = Path.Combine(buildDir, "SDL3.sln");
|
||||
|
||||
RunCmake(root, platform, architecture, $"-B\"{buildDir}\" -DCMAKE_INSTALL_PREFIX=\"{buildDir}\" -DSDL_SHARED={(!buildStatic ? "ON" : "OFF")} -DSDL_STATIC={(buildStatic ? "ON" : "OFF")} -DCMAKE_POLICY_DEFAULT_CMP0091=NEW -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL " + string.Join(" ", configs));
|
||||
@@ -120,16 +150,14 @@ namespace Flax.Deps.Dependencies
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
foreach (var file in binariesToCopy)
|
||||
Utilities.FileCopy(Path.Combine(buildDir, configuration, file), Path.Combine(depsFolder, file == "SDL3-static.lib" ? "SDL3.lib" : file));
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Linux:
|
||||
case TargetPlatform.Mac:
|
||||
{
|
||||
foreach (var architecture in new [] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
||||
case TargetPlatform.Linux:
|
||||
case TargetPlatform.Mac:
|
||||
{
|
||||
var buildDir = Path.Combine(root, "build-" + architecture.ToString());
|
||||
|
||||
|
||||
string[] binariesToCopy;
|
||||
if (buildStatic)
|
||||
binariesToCopy = new[] { "libSDL3.a" };
|
||||
@@ -139,16 +167,16 @@ namespace Flax.Deps.Dependencies
|
||||
|
||||
int concurrency = Math.Min(Math.Max(1, (int)(Environment.ProcessorCount * Configuration.ConcurrencyProcessorScale)), Configuration.MaxConcurrency);
|
||||
RunCmake(root, platform, architecture, $"-B\"{buildDir}\" -DCMAKE_BUILD_TYPE={configuration} -DCMAKE_INSTALL_PREFIX=\"{buildDir}\" -DSDL_SHARED={(!buildStatic ? "ON" : "OFF")} -DSDL_STATIC={(buildStatic ? "ON" : "OFF")} -DCMAKE_POSITION_INDEPENDENT_CODE=ON " + string.Join(" ", configs));
|
||||
BuildCmake(buildDir, configuration, new Dictionary<string, string>() { {"CMAKE_BUILD_PARALLEL_LEVEL", concurrency.ToString()} });
|
||||
BuildCmake(buildDir, configuration, new Dictionary<string, string>() { { "CMAKE_BUILD_PARALLEL_LEVEL", concurrency.ToString() } });
|
||||
Utilities.Run("cmake", $"--build . --target install --config {configuration}", null, buildDir, Utilities.RunOptions.DefaultTool);
|
||||
|
||||
// Copy binaries
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
foreach (var file in binariesToCopy)
|
||||
Utilities.FileCopy(Path.Combine(buildDir, file), Path.Combine(depsFolder, file));
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,36 @@ namespace Flax.Deps.Dependencies
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override TargetArchitecture[] Architectures
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (BuildPlatform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
TargetArchitecture.ARM64,
|
||||
};
|
||||
case TargetPlatform.Linux:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
//TargetArchitecture.ARM64,
|
||||
};
|
||||
case TargetPlatform.Mac:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
TargetArchitecture.ARM64,
|
||||
};
|
||||
default: return new TargetArchitecture[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Build(BuildOptions options)
|
||||
{
|
||||
@@ -47,23 +77,23 @@ namespace Flax.Deps.Dependencies
|
||||
|
||||
foreach (var platform in options.Platforms)
|
||||
{
|
||||
BuildStarted(platform);
|
||||
switch (platform)
|
||||
foreach (var architecture in options.Architectures)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
{
|
||||
// Build for Win64
|
||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
||||
BuildStarted(platform, architecture);
|
||||
switch (platform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
{
|
||||
// Build for Windows
|
||||
Deploy.VCEnvironment.BuildSolution(solutionPath, configuration, architecture.ToString(), new Dictionary<string, string>() { { "RestorePackagesConfig", "true" } });
|
||||
var depsFolder = GetThirdPartyFolder(options, TargetPlatform.Windows, architecture);
|
||||
foreach (var file in outputFileNames)
|
||||
{
|
||||
Utilities.FileCopy(Path.Combine(binFolder, architecture.ToString(), "Release", file), Path.Combine(depsFolder, file));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,24 @@ namespace Flax.Deps.Dependencies
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override TargetArchitecture[] Architectures
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (BuildPlatform)
|
||||
{
|
||||
case TargetPlatform.Linux:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
TargetArchitecture.ARM64,
|
||||
};
|
||||
default: return new TargetArchitecture[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Build(BuildOptions options)
|
||||
{
|
||||
@@ -38,7 +56,7 @@ namespace Flax.Deps.Dependencies
|
||||
|
||||
foreach (var platform in options.Platforms)
|
||||
{
|
||||
BuildStarted(platform);
|
||||
BuildStarted(platform, TargetArchitecture.AnyCPU);
|
||||
switch (platform)
|
||||
{
|
||||
case TargetPlatform.Linux:
|
||||
|
||||
@@ -34,6 +34,30 @@ namespace Flax.Deps.Dependencies
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override TargetArchitecture[] Architectures
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (BuildPlatform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
TargetArchitecture.ARM64,
|
||||
};
|
||||
case TargetPlatform.Mac:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
TargetArchitecture.ARM64,
|
||||
};
|
||||
default: return new TargetArchitecture[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Build(BuildOptions options)
|
||||
{
|
||||
@@ -45,12 +69,12 @@ namespace Flax.Deps.Dependencies
|
||||
|
||||
foreach (var platform in options.Platforms)
|
||||
{
|
||||
BuildStarted(platform);
|
||||
switch (platform)
|
||||
foreach (var architecture in options.Architectures)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
|
||||
foreach (var architecture in new []{ TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
||||
BuildStarted(platform, architecture);
|
||||
switch (platform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
{
|
||||
string buildDir = Path.Combine(root, "build-" + architecture.ToString());
|
||||
var isa = architecture == TargetArchitecture.ARM64 ? "-DASTCENC_ISA_NEON=ON" : "-DASTCENC_ISA_SSE2=ON";
|
||||
@@ -62,8 +86,7 @@ namespace Flax.Deps.Dependencies
|
||||
Utilities.FileCopy(Path.Combine(buildDir, "Source/Release", lib), Path.Combine(depsFolder, "astcenc.lib"));
|
||||
}
|
||||
break;
|
||||
case TargetPlatform.Mac:
|
||||
foreach (var architecture in new []{ TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
||||
case TargetPlatform.Mac:
|
||||
{
|
||||
string buildDir = Path.Combine(root, "build-" + architecture.ToString());
|
||||
var isa = architecture == TargetArchitecture.ARM64 ? "-DASTCENC_ISA_NEON=ON" : "-DASTCENC_ISA_SSE2=ON";
|
||||
@@ -75,6 +98,7 @@ namespace Flax.Deps.Dependencies
|
||||
Utilities.FileCopy(Path.Combine(buildDir, "Source", lib), Path.Combine(depsFolder, "libastcenc.a"));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -41,6 +41,36 @@ namespace Flax.Deps.Dependencies
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override TargetArchitecture[] Architectures
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (BuildPlatform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
TargetArchitecture.ARM64,
|
||||
};
|
||||
case TargetPlatform.Linux:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
//TargetArchitecture.ARM64,
|
||||
};
|
||||
case TargetPlatform.Mac:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
TargetArchitecture.ARM64,
|
||||
};
|
||||
default: return new TargetArchitecture[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Build(BuildOptions options)
|
||||
{
|
||||
@@ -69,14 +99,14 @@ namespace Flax.Deps.Dependencies
|
||||
|
||||
foreach (var platform in options.Platforms)
|
||||
{
|
||||
BuildStarted(platform);
|
||||
switch (platform)
|
||||
foreach (var architecture in options.Architectures)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
{
|
||||
// Build for Win64 and ARM64
|
||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
||||
BuildStarted(platform, architecture);
|
||||
switch (platform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
{
|
||||
// Build for Windows
|
||||
var buildDir = Path.Combine(root, "build-" + architecture.ToString());
|
||||
var solutionPath = Path.Combine(buildDir, "CURL.sln");
|
||||
|
||||
@@ -85,56 +115,54 @@ namespace Flax.Deps.Dependencies
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
foreach (var file in binariesToCopyWin)
|
||||
Utilities.FileCopy(Path.Combine(buildDir, "lib", configuration, file), Path.Combine(depsFolder, Path.GetFileName(file)));
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Linux:
|
||||
{
|
||||
// Build for Linux
|
||||
var settings = new[]
|
||||
case TargetPlatform.Linux:
|
||||
{
|
||||
"--without-librtmp",
|
||||
"--without-ssl",
|
||||
"--with-gnutls",
|
||||
"--disable-ipv6",
|
||||
"--disable-manual",
|
||||
"--disable-verbose",
|
||||
"--disable-shared",
|
||||
"--enable-static",
|
||||
"-disable-ldap --disable-sspi --disable-ftp --disable-file --disable-dict --disable-telnet --disable-tftp --disable-rtsp --disable-pop3 --disable-imap --disable-smtp --disable-gopher --disable-smb",
|
||||
};
|
||||
var envVars = new Dictionary<string, string>
|
||||
{
|
||||
{ "CC", "clang-" + Configuration.LinuxClangMinVer },
|
||||
{ "CC_FOR_BUILD", "clang-" + Configuration.LinuxClangMinVer },
|
||||
};
|
||||
var buildDir = Path.Combine(root, "build");
|
||||
SetupDirectory(buildDir, true);
|
||||
Utilities.Run("chmod", "+x configure", null, root, Utilities.RunOptions.ThrowExceptionOnError);
|
||||
Utilities.Run(Path.Combine(root, "configure"), string.Join(" ", settings) + " --prefix=\"" + buildDir + "\"", null, root, Utilities.RunOptions.ThrowExceptionOnError, envVars);
|
||||
Utilities.Run("make", null, null, root, Utilities.RunOptions.ThrowExceptionOnError);
|
||||
Utilities.Run("make", "install", null, root, Utilities.RunOptions.ThrowExceptionOnError);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
|
||||
var filename = "libcurl.a";
|
||||
Utilities.FileCopy(Path.Combine(buildDir, "lib", filename), Path.Combine(depsFolder, filename));
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Mac:
|
||||
{
|
||||
// Build for Mac
|
||||
var settings = new[]
|
||||
{
|
||||
"--with-secure-transport",
|
||||
"--without-librtmp",
|
||||
"--disable-ipv6",
|
||||
"--disable-manual",
|
||||
"--disable-verbose",
|
||||
"--disable-shared",
|
||||
"--enable-static",
|
||||
"-disable-ldap --disable-sspi --disable-ftp --disable-file --disable-dict --disable-telnet --disable-tftp --disable-rtsp --disable-pop3 --disable-imap --disable-smtp --disable-gopher --disable-smb",
|
||||
};
|
||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
||||
// Build for Linux
|
||||
var settings = new[]
|
||||
{
|
||||
"--without-librtmp",
|
||||
//"--without-ssl",
|
||||
"--with-gnutls",
|
||||
"--disable-ipv6",
|
||||
"--disable-manual",
|
||||
"--disable-verbose",
|
||||
"--disable-shared",
|
||||
"--enable-static",
|
||||
"-disable-ldap --disable-sspi --disable-ftp --disable-file --disable-dict --disable-telnet --disable-tftp --disable-rtsp --disable-pop3 --disable-imap --disable-smtp --disable-gopher --disable-smb",
|
||||
};
|
||||
var envVars = new Dictionary<string, string>
|
||||
{
|
||||
{ "CC", "clang-" + Configuration.LinuxClangMinVer },
|
||||
{ "CC_FOR_BUILD", "clang-" + Configuration.LinuxClangMinVer },
|
||||
};
|
||||
var buildDir = Path.Combine(root, "build");
|
||||
SetupDirectory(buildDir, true);
|
||||
Utilities.Run("chmod", "+x configure", null, root, Utilities.RunOptions.ThrowExceptionOnError);
|
||||
Utilities.Run(Path.Combine(root, "configure"), string.Join(" ", settings) + " --prefix=\"" + buildDir + "\"", null, root, Utilities.RunOptions.ThrowExceptionOnError, envVars);
|
||||
Utilities.Run("make", null, null, root, Utilities.RunOptions.ThrowExceptionOnError);
|
||||
Utilities.Run("make", "install", null, root, Utilities.RunOptions.ThrowExceptionOnError);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
|
||||
var filename = "libcurl.a";
|
||||
Utilities.FileCopy(Path.Combine(buildDir, "lib", filename), Path.Combine(depsFolder, filename));
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Mac:
|
||||
{
|
||||
// Build for Mac
|
||||
var settings = new[]
|
||||
{
|
||||
"--with-secure-transport",
|
||||
"--without-librtmp",
|
||||
"--disable-ipv6",
|
||||
"--disable-manual",
|
||||
"--disable-verbose",
|
||||
"--disable-shared",
|
||||
"--enable-static",
|
||||
"-disable-ldap --disable-sspi --disable-ftp --disable-file --disable-dict --disable-telnet --disable-tftp --disable-rtsp --disable-pop3 --disable-imap --disable-smtp --disable-gopher --disable-smb",
|
||||
};
|
||||
|
||||
var arch = GetAppleArchName(architecture);
|
||||
var archName = arch + "-apple-darwin19";
|
||||
if (architecture == TargetArchitecture.ARM64)
|
||||
@@ -161,9 +189,9 @@ namespace Flax.Deps.Dependencies
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
var filename = "libcurl.a";
|
||||
Utilities.FileCopy(Path.Combine(buildDir, "lib", filename), Path.Combine(depsFolder, filename));
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,27 +30,45 @@ namespace Flax.Deps.Dependencies
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override TargetArchitecture[] Architectures
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (BuildPlatform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
TargetArchitecture.ARM64,
|
||||
};
|
||||
default: return new TargetArchitecture[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Build(BuildOptions options)
|
||||
{
|
||||
foreach (var platform in options.Platforms)
|
||||
{
|
||||
BuildStarted(platform);
|
||||
switch (platform)
|
||||
foreach (var architecture in options.Architectures)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
{
|
||||
var sdk = WindowsPlatformBase.GetSDKs().Last();
|
||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
||||
BuildStarted(platform, architecture);
|
||||
switch (platform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
{
|
||||
var sdk = WindowsPlatformBase.GetSDKs().Last();
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
var libLocation = @$"{sdk.Value}Debuggers\lib\{architecture}\dbghelp.lib";
|
||||
var dllLocation = @$"{sdk.Value}Debuggers\{architecture}\dbghelp.dll";
|
||||
Utilities.FileCopy(libLocation, Path.Combine(depsFolder, Path.GetFileName(libLocation)));
|
||||
Utilities.FileCopy(dllLocation, Path.Combine(depsFolder, Path.GetFileName(dllLocation)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,6 +49,36 @@ namespace Flax.Deps.Dependencies
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override TargetArchitecture[] Architectures
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (BuildPlatform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
TargetArchitecture.ARM64,
|
||||
};
|
||||
case TargetPlatform.Linux:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
//TargetArchitecture.ARM64,
|
||||
};
|
||||
case TargetPlatform.Mac:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
TargetArchitecture.ARM64,
|
||||
};
|
||||
default: return new TargetArchitecture[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Build(BuildOptions options)
|
||||
{
|
||||
@@ -94,168 +124,164 @@ namespace Flax.Deps.Dependencies
|
||||
|
||||
foreach (var platform in options.Platforms)
|
||||
{
|
||||
BuildStarted(platform);
|
||||
switch (platform)
|
||||
foreach (var architecture in options.Architectures)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
{
|
||||
// Patch the RuntimeLibrary value
|
||||
File.WriteAllText(vcxprojPath, vcxprojContents);
|
||||
|
||||
// Build for Windows
|
||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
||||
BuildStarted(platform, architecture);
|
||||
switch (platform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
{
|
||||
// Patch the RuntimeLibrary value
|
||||
File.WriteAllText(vcxprojPath, vcxprojContents);
|
||||
|
||||
// Build for Windows
|
||||
Deploy.VCEnvironment.BuildSolution(vsSolutionPath, configurationMsvc, architecture.ToString(), msvcProps);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
foreach (var filename in binariesToCopyMsvc)
|
||||
Utilities.FileCopy(Path.Combine(root, "objs", architecture.ToString(), configurationMsvc, filename), Path.Combine(depsFolder, filename));
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Linux:
|
||||
{
|
||||
var envVars = new Dictionary<string, string>
|
||||
case TargetPlatform.Linux:
|
||||
{
|
||||
{ "CC", "clang-" + Configuration.LinuxClangMinVer },
|
||||
{ "CC_FOR_BUILD", "clang-" + Configuration.LinuxClangMinVer }
|
||||
};
|
||||
var envVars = new Dictionary<string, string>
|
||||
{
|
||||
{ "CC", "clang-" + Configuration.LinuxClangMinVer },
|
||||
{ "CC_FOR_BUILD", "clang-" + Configuration.LinuxClangMinVer }
|
||||
};
|
||||
|
||||
// Fix scripts
|
||||
Utilities.Run("sed", "-i -e \'s/\r$//\' autogen.sh", null, root, Utilities.RunOptions.ThrowExceptionOnError, envVars);
|
||||
Utilities.Run("sed", "-i -e \'s/\r$//\' configure", null, root, Utilities.RunOptions.ThrowExceptionOnError, envVars);
|
||||
Utilities.Run("chmod", "+x autogen.sh", null, root, Utilities.RunOptions.ThrowExceptionOnError);
|
||||
Utilities.Run("chmod", "+x configure", null, root, Utilities.RunOptions.ThrowExceptionOnError);
|
||||
// Fix scripts
|
||||
Utilities.Run("sed", "-i -e \'s/\r$//\' autogen.sh", null, root, Utilities.RunOptions.ThrowExceptionOnError, envVars);
|
||||
Utilities.Run("sed", "-i -e \'s/\r$//\' configure", null, root, Utilities.RunOptions.ThrowExceptionOnError, envVars);
|
||||
Utilities.Run("chmod", "+x autogen.sh", null, root, Utilities.RunOptions.ThrowExceptionOnError);
|
||||
Utilities.Run("chmod", "+x configure", null, root, Utilities.RunOptions.ThrowExceptionOnError);
|
||||
|
||||
Utilities.Run(Path.Combine(root, "autogen.sh"), null, null, root, Utilities.RunOptions.Default, envVars);
|
||||
Utilities.Run(Path.Combine(root, "autogen.sh"), null, null, root, Utilities.RunOptions.Default, envVars);
|
||||
|
||||
// Disable using libpng even if it's found on the system
|
||||
var cmakeFile = Path.Combine(root, "CMakeLists.txt");
|
||||
File.WriteAllText(cmakeFile,
|
||||
File.ReadAllText(cmakeFile)
|
||||
.Replace("find_package(PNG)", "")
|
||||
.Replace("find_package(ZLIB)", "")
|
||||
.Replace("find_package(BZip2)", "")
|
||||
);
|
||||
// Disable using libpng even if it's found on the system
|
||||
var cmakeFile = Path.Combine(root, "CMakeLists.txt");
|
||||
File.WriteAllText(cmakeFile,
|
||||
File.ReadAllText(cmakeFile)
|
||||
.Replace("find_package(PNG)", "")
|
||||
.Replace("find_package(ZLIB)", "")
|
||||
.Replace("find_package(BZip2)", "")
|
||||
);
|
||||
|
||||
// Build for Linux
|
||||
SetupDirectory(buildDir, true);
|
||||
var toolchain = UnixToolchain.GetToolchainName(platform, TargetArchitecture.x64);
|
||||
Utilities.Run("cmake", string.Format("-G \"Unix Makefiles\" -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DFT_WITH_BZIP2=OFF -DFT_WITH_ZLIB=OFF -DFT_WITH_PNG=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER_TARGET={0} ..", toolchain), null, buildDir, Utilities.RunOptions.ThrowExceptionOnError, envVars);
|
||||
Utilities.Run("cmake", "--build .", null, buildDir, Utilities.RunOptions.ThrowExceptionOnError, envVars);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
|
||||
Utilities.FileCopy(Path.Combine(buildDir, libraryFileName), Path.Combine(depsFolder, libraryFileName));
|
||||
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.PS4:
|
||||
{
|
||||
// Get the build data files
|
||||
Utilities.DirectoryCopy(
|
||||
Path.Combine(GetBinariesFolder(options, platform), "Data", "freetype"),
|
||||
Path.Combine(root, "builds", "PS4"), false, true);
|
||||
|
||||
// Build for PS4
|
||||
var solutionPath = Path.Combine(root, "builds", "PS4", "freetype.sln");
|
||||
Deploy.VCEnvironment.BuildSolution(solutionPath, "Release", "ORBIS");
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
|
||||
Utilities.FileCopy(Path.Combine(root, "lib", "PS4", libraryFileName), Path.Combine(depsFolder, libraryFileName));
|
||||
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.PS5:
|
||||
{
|
||||
// Get the build data files
|
||||
Utilities.DirectoryCopy(
|
||||
Path.Combine(GetBinariesFolder(options, platform), "Data", "freetype"),
|
||||
Path.Combine(root, "builds", "PS5"), false, true);
|
||||
Utilities.ReplaceInFile(Path.Combine(root, "include\\freetype\\config\\ftstdlib.h"), "#define ft_getenv getenv", "char* ft_getenv(const char* n);");
|
||||
|
||||
// Build for PS5
|
||||
var solutionPath = Path.Combine(root, "builds", "PS5", "freetype.sln");
|
||||
Deploy.VCEnvironment.BuildSolution(solutionPath, "Release", "PROSPERO");
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
|
||||
Utilities.FileCopy(Path.Combine(root, "lib", "PS5", libraryFileName), Path.Combine(depsFolder, libraryFileName));
|
||||
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.XboxOne:
|
||||
{
|
||||
// Build for Xbox One x64
|
||||
Deploy.VCEnvironment.BuildSolution(vsSolutionPath, configurationMsvc, "x64", msvcProps);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
|
||||
foreach (var filename in binariesToCopyMsvc)
|
||||
Utilities.FileCopy(Path.Combine(root, "objs", "x64", configurationMsvc, filename), Path.Combine(depsFolder, filename));
|
||||
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.XboxScarlett:
|
||||
{
|
||||
// Build for Xbox Scarlett
|
||||
Deploy.VCEnvironment.BuildSolution(vsSolutionPath, configurationMsvc, "x64", msvcProps);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
|
||||
foreach (var filename in binariesToCopyMsvc)
|
||||
Utilities.FileCopy(Path.Combine(root, "objs", "x64", configurationMsvc, filename), Path.Combine(depsFolder, filename));
|
||||
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Android:
|
||||
{
|
||||
// Disable using libpng even if it's found on the system
|
||||
var cmakeFile = Path.Combine(root, "CMakeLists.txt");
|
||||
File.WriteAllText(cmakeFile,
|
||||
File.ReadAllText(cmakeFile)
|
||||
.Replace("find_package(PNG)", "")
|
||||
.Replace("find_package(ZLIB)", "")
|
||||
.Replace("find_package(BZip2)", "")
|
||||
);
|
||||
|
||||
// Build for Android
|
||||
SetupDirectory(buildDir, true);
|
||||
RunCmake(buildDir, TargetPlatform.Android, TargetArchitecture.ARM64, ".. -DFT_WITH_BZIP2=OFF -DFT_WITH_ZLIB=OFF -DFT_WITH_PNG=OFF -DCMAKE_BUILD_TYPE=Release");
|
||||
BuildCmake(buildDir);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.ARM64);
|
||||
Utilities.FileCopy(Path.Combine(buildDir, libraryFileName), Path.Combine(depsFolder, libraryFileName));
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Switch:
|
||||
{
|
||||
// Build for Switch
|
||||
SetupDirectory(buildDir, true);
|
||||
RunCmake(buildDir, platform, TargetArchitecture.ARM64, ".. -DCMAKE_BUILD_TYPE=Release");
|
||||
BuildCmake(buildDir);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.ARM64);
|
||||
Utilities.FileCopy(Path.Combine(buildDir, libraryFileName), Path.Combine(depsFolder, libraryFileName));
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Mac:
|
||||
{
|
||||
// Build for Mac
|
||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
||||
{
|
||||
// Build for Linux
|
||||
SetupDirectory(buildDir, true);
|
||||
RunCmake(buildDir, platform, architecture, ".. -DCMAKE_BUILD_TYPE=Release");
|
||||
var toolchain = UnixToolchain.GetToolchainName(platform, architecture);
|
||||
Utilities.Run("cmake", string.Format("-G \"Unix Makefiles\" -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DFT_WITH_BZIP2=OFF -DFT_WITH_ZLIB=OFF -DFT_WITH_PNG=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER_TARGET={0} ..", toolchain), null, buildDir, Utilities.RunOptions.ThrowExceptionOnError, envVars);
|
||||
Utilities.Run("cmake", "--build .", null, buildDir, Utilities.RunOptions.ThrowExceptionOnError, envVars);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
Utilities.FileCopy(Path.Combine(buildDir, libraryFileName), Path.Combine(depsFolder, libraryFileName));
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.PS4:
|
||||
{
|
||||
// Get the build data files
|
||||
Utilities.DirectoryCopy(
|
||||
Path.Combine(GetBinariesFolder(options, platform), "Data", "freetype"),
|
||||
Path.Combine(root, "builds", "PS4"), false, true);
|
||||
|
||||
// Build for PS4
|
||||
var solutionPath = Path.Combine(root, "builds", "PS4", "freetype.sln");
|
||||
Deploy.VCEnvironment.BuildSolution(solutionPath, "Release", "ORBIS");
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
|
||||
Utilities.FileCopy(Path.Combine(root, "lib", "PS4", libraryFileName), Path.Combine(depsFolder, libraryFileName));
|
||||
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.PS5:
|
||||
{
|
||||
// Get the build data files
|
||||
Utilities.DirectoryCopy(
|
||||
Path.Combine(GetBinariesFolder(options, platform), "Data", "freetype"),
|
||||
Path.Combine(root, "builds", "PS5"), false, true);
|
||||
Utilities.ReplaceInFile(Path.Combine(root, "include\\freetype\\config\\ftstdlib.h"), "#define ft_getenv getenv", "char* ft_getenv(const char* n);");
|
||||
|
||||
// Build for PS5
|
||||
var solutionPath = Path.Combine(root, "builds", "PS5", "freetype.sln");
|
||||
Deploy.VCEnvironment.BuildSolution(solutionPath, "Release", "PROSPERO");
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
|
||||
Utilities.FileCopy(Path.Combine(root, "lib", "PS5", libraryFileName), Path.Combine(depsFolder, libraryFileName));
|
||||
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.XboxOne:
|
||||
{
|
||||
// Build for Xbox One x64
|
||||
Deploy.VCEnvironment.BuildSolution(vsSolutionPath, configurationMsvc, "x64", msvcProps);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
|
||||
foreach (var filename in binariesToCopyMsvc)
|
||||
Utilities.FileCopy(Path.Combine(root, "objs", "x64", configurationMsvc, filename), Path.Combine(depsFolder, filename));
|
||||
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.XboxScarlett:
|
||||
{
|
||||
// Build for Xbox Scarlett
|
||||
Deploy.VCEnvironment.BuildSolution(vsSolutionPath, configurationMsvc, "x64", msvcProps);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
|
||||
foreach (var filename in binariesToCopyMsvc)
|
||||
Utilities.FileCopy(Path.Combine(root, "objs", "x64", configurationMsvc, filename), Path.Combine(depsFolder, filename));
|
||||
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Android:
|
||||
{
|
||||
// Disable using libpng even if it's found on the system
|
||||
var cmakeFile = Path.Combine(root, "CMakeLists.txt");
|
||||
File.WriteAllText(cmakeFile,
|
||||
File.ReadAllText(cmakeFile)
|
||||
.Replace("find_package(PNG)", "")
|
||||
.Replace("find_package(ZLIB)", "")
|
||||
.Replace("find_package(BZip2)", "")
|
||||
);
|
||||
|
||||
// Build for Android
|
||||
SetupDirectory(buildDir, true);
|
||||
RunCmake(buildDir, TargetPlatform.Android, TargetArchitecture.ARM64, ".. -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DFT_WITH_BZIP2=OFF -DFT_WITH_ZLIB=OFF -DFT_WITH_PNG=OFF -DCMAKE_BUILD_TYPE=Release");
|
||||
BuildCmake(buildDir);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.ARM64);
|
||||
Utilities.FileCopy(Path.Combine(buildDir, libraryFileName), Path.Combine(depsFolder, libraryFileName));
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Switch:
|
||||
{
|
||||
// Build for Switch
|
||||
SetupDirectory(buildDir, true);
|
||||
RunCmake(buildDir, platform, TargetArchitecture.ARM64, ".. -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=Release");
|
||||
BuildCmake(buildDir);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.ARM64);
|
||||
Utilities.FileCopy(Path.Combine(buildDir, libraryFileName), Path.Combine(depsFolder, libraryFileName));
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Mac:
|
||||
{
|
||||
// Build for Mac
|
||||
SetupDirectory(buildDir, true);
|
||||
RunCmake(buildDir, platform, architecture, ".. -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=Release");
|
||||
BuildCmake(buildDir);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
Utilities.FileCopy(Path.Combine(buildDir, libraryFileName), Path.Combine(depsFolder, libraryFileName));
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.iOS:
|
||||
{
|
||||
// Fix archive creation issue due to missing ar tool
|
||||
Utilities.ReplaceInFile(Path.Combine(root, "builds/cmake/iOS.cmake"), "set(CMAKE_SYSTEM_NAME Darwin)", "set(CMAKE_SYSTEM_NAME Darwin)\nset(CMAKE_AR ar CACHE FILEPATH \"\" FORCE)");
|
||||
case TargetPlatform.iOS:
|
||||
{
|
||||
// Fix archive creation issue due to missing ar tool
|
||||
Utilities.ReplaceInFile(Path.Combine(root, "builds/cmake/iOS.cmake"), "set(CMAKE_SYSTEM_NAME Darwin)", "set(CMAKE_SYSTEM_NAME Darwin)\nset(CMAKE_AR ar CACHE FILEPATH \"\" FORCE)");
|
||||
|
||||
// Fix freetype toolchain rejecting min iPhone version
|
||||
Utilities.ReplaceInFile(Path.Combine(root, "builds/cmake/iOS.cmake"), "set(CMAKE_OSX_DEPLOYMENT_TARGET \"\"", "set(CMAKE_OSX_DEPLOYMENT_TARGET \"${CMAKE_OSX_DEPLOYMENT_TARGET}\"");
|
||||
// Fix freetype toolchain rejecting min iPhone version
|
||||
Utilities.ReplaceInFile(Path.Combine(root, "builds/cmake/iOS.cmake"), "set(CMAKE_OSX_DEPLOYMENT_TARGET \"\"", "set(CMAKE_OSX_DEPLOYMENT_TARGET \"${CMAKE_OSX_DEPLOYMENT_TARGET}\"");
|
||||
|
||||
// Build for iOS
|
||||
SetupDirectory(buildDir, true);
|
||||
RunCmake(buildDir, platform, TargetArchitecture.ARM64, ".. -DIOS_PLATFORM=OS -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_BUILD_TYPE=Release -DFT_WITH_BZIP2=OFF -DFT_WITH_ZLIB=OFF -DFT_WITH_PNG=OFF");
|
||||
BuildCmake(buildDir);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.ARM64);
|
||||
Utilities.FileCopy(Path.Combine(buildDir, libraryFileName), Path.Combine(depsFolder, libraryFileName));
|
||||
break;
|
||||
}
|
||||
// Build for iOS
|
||||
SetupDirectory(buildDir, true);
|
||||
RunCmake(buildDir, platform, TargetArchitecture.ARM64, ".. -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DIOS_PLATFORM=OS -DCMAKE_SYSTEM_NAME=iOS -DCMAKE_BUILD_TYPE=Release -DFT_WITH_BZIP2=OFF -DFT_WITH_ZLIB=OFF -DFT_WITH_PNG=OFF");
|
||||
BuildCmake(buildDir);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.ARM64);
|
||||
Utilities.FileCopy(Path.Combine(buildDir, libraryFileName), Path.Combine(depsFolder, libraryFileName));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// Copyright (c) Wojciech Figat. All rights reserved.
|
||||
|
||||
using System;
|
||||
using System.IO;
|
||||
using Flax.Build;
|
||||
|
||||
@@ -38,13 +39,43 @@ namespace Flax.Deps.Dependencies
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override TargetArchitecture[] Architectures
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (BuildPlatform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
TargetArchitecture.ARM64,
|
||||
};
|
||||
case TargetPlatform.Linux:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
//TargetArchitecture.ARM64,
|
||||
};
|
||||
case TargetPlatform.Mac:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
TargetArchitecture.ARM64,
|
||||
};
|
||||
default: return new TargetArchitecture[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Build(BuildOptions options)
|
||||
{
|
||||
var root = options.IntermediateFolder;
|
||||
var installDir = Path.Combine(root, "install");
|
||||
var configuration = "Release";
|
||||
var cmakeArgs = string.Format("-DCMAKE_INSTALL_PREFIX=\"{0}\" -DCMAKE_BUILD_TYPE={1} -DENABLE_RTTI=ON -DENABLE_CTEST=OFF -DENABLE_HLSL=ON -DENABLE_SPVREMAPPER=ON -DENABLE_GLSLANG_BINARIES=OFF", installDir, configuration);
|
||||
var cmakeArgs = $"-DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_INSTALL_PREFIX=\"{installDir}\" -DCMAKE_BUILD_TYPE={configuration} -DENABLE_RTTI=ON -DENABLE_CTEST=OFF -DENABLE_HLSL=ON -DENABLE_SPVREMAPPER=ON -DENABLE_GLSLANG_BINARIES=OFF";
|
||||
var libsRoot = Path.Combine(installDir, "lib");
|
||||
|
||||
// Get the source
|
||||
@@ -52,97 +83,93 @@ namespace Flax.Deps.Dependencies
|
||||
|
||||
// Setup the external sources
|
||||
// Requires distutils (pip install setuptools)
|
||||
Utilities.Run("python", "update_glslang_sources.py", null, root, Utilities.RunOptions.ConsoleLogOutput);
|
||||
if (Utilities.Run(BuildPlatform != TargetPlatform.Mac ? "python" : "python3", "update_glslang_sources.py", null, root, Utilities.RunOptions.ConsoleLogOutput) != 0)
|
||||
throw new Exception("Failed to update glslang sources, make sure setuptools python package is installed.");
|
||||
|
||||
foreach (var platform in options.Platforms)
|
||||
{
|
||||
BuildStarted(platform);
|
||||
switch (platform)
|
||||
foreach (var architecture in options.Architectures)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
{
|
||||
var outputFiles = new[]
|
||||
{
|
||||
Path.Combine(libsRoot, "GenericCodeGen.lib"),
|
||||
Path.Combine(libsRoot, "MachineIndependent.lib"),
|
||||
Path.Combine(libsRoot, "HLSL.lib"),
|
||||
Path.Combine(libsRoot, "OSDependent.lib"),
|
||||
Path.Combine(libsRoot, "OGLCompiler.lib"),
|
||||
Path.Combine(libsRoot, "SPIRV-Tools-opt.lib"),
|
||||
Path.Combine(libsRoot, "SPIRV-Tools.lib"),
|
||||
Path.Combine(libsRoot, "SPIRV.lib"),
|
||||
Path.Combine(libsRoot, "glslang.lib"),
|
||||
};
|
||||
BuildStarted(platform, architecture);
|
||||
|
||||
// Build for Windows
|
||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
||||
var buildDir = Path.Combine(root, "build-" + architecture.ToString());
|
||||
switch (platform)
|
||||
{
|
||||
var buildDir = Path.Combine(root, "build-" + architecture.ToString());
|
||||
case TargetPlatform.Windows:
|
||||
{
|
||||
var outputFiles = new[]
|
||||
{
|
||||
Path.Combine(libsRoot, "GenericCodeGen.lib"),
|
||||
Path.Combine(libsRoot, "MachineIndependent.lib"),
|
||||
Path.Combine(libsRoot, "HLSL.lib"),
|
||||
Path.Combine(libsRoot, "OSDependent.lib"),
|
||||
Path.Combine(libsRoot, "OGLCompiler.lib"),
|
||||
Path.Combine(libsRoot, "SPIRV-Tools-opt.lib"),
|
||||
Path.Combine(libsRoot, "SPIRV-Tools.lib"),
|
||||
Path.Combine(libsRoot, "SPIRV.lib"),
|
||||
Path.Combine(libsRoot, "glslang.lib"),
|
||||
};
|
||||
|
||||
// Build for Windows
|
||||
var solutionPath = Path.Combine(buildDir, "glslang.sln");
|
||||
|
||||
SetupDirectory(buildDir, false);
|
||||
RunCmake(root, platform, architecture, cmakeArgs + $" -B\"{buildDir}\"");
|
||||
Utilities.Run("cmake", string.Format("--build . --config {0} --target install", configuration), null, buildDir, Utilities.RunOptions.ConsoleLogOutput);
|
||||
RunCmake(root, platform, architecture, $"-B\"{buildDir}\" " + cmakeArgs);
|
||||
Deploy.VCEnvironment.BuildSolution(solutionPath, configuration, architecture.ToString());
|
||||
Utilities.Run("cmake", $"--build \"{buildDir}\" --config {configuration} --target install", null, buildDir, Utilities.RunOptions.ConsoleLogOutput);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
foreach (var file in outputFiles)
|
||||
{
|
||||
Utilities.FileCopy(file, Path.Combine(depsFolder, Path.GetFileName(file)));
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Linux:
|
||||
{
|
||||
var outputFiles = new[]
|
||||
case TargetPlatform.Linux:
|
||||
{
|
||||
Path.Combine(libsRoot, "libGenericCodeGen.a"),
|
||||
Path.Combine(libsRoot, "libMachineIndependent.a"),
|
||||
Path.Combine(libsRoot, "libHLSL.a"),
|
||||
Path.Combine(libsRoot, "libOSDependent.a"),
|
||||
Path.Combine(libsRoot, "libOGLCompiler.a"),
|
||||
Path.Combine(libsRoot, "libSPIRV-Tools-opt.a"),
|
||||
Path.Combine(libsRoot, "libSPIRV-Tools.a"),
|
||||
Path.Combine(libsRoot, "libSPIRV.a"),
|
||||
Path.Combine(libsRoot, "libglslang.a"),
|
||||
};
|
||||
var buildDir = root;
|
||||
var outputFiles = new[]
|
||||
{
|
||||
Path.Combine(libsRoot, "libGenericCodeGen.a"),
|
||||
Path.Combine(libsRoot, "libMachineIndependent.a"),
|
||||
Path.Combine(libsRoot, "libHLSL.a"),
|
||||
Path.Combine(libsRoot, "libOSDependent.a"),
|
||||
Path.Combine(libsRoot, "libOGLCompiler.a"),
|
||||
Path.Combine(libsRoot, "libSPIRV-Tools-opt.a"),
|
||||
Path.Combine(libsRoot, "libSPIRV-Tools.a"),
|
||||
Path.Combine(libsRoot, "libSPIRV.a"),
|
||||
Path.Combine(libsRoot, "libglslang.a"),
|
||||
};
|
||||
|
||||
// Build for Linux
|
||||
RunCmake(root, platform, TargetArchitecture.x64, cmakeArgs);
|
||||
Utilities.Run("cmake", string.Format("--build . --config {0} --target install", configuration), null, buildDir, Utilities.RunOptions.ConsoleLogOutput);
|
||||
Utilities.Run("make", null, null, root, Utilities.RunOptions.ConsoleLogOutput);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
|
||||
foreach (var file in outputFiles)
|
||||
{
|
||||
var dst = Path.Combine(depsFolder, Path.GetFileName(file));
|
||||
Utilities.FileCopy(file, dst);
|
||||
//Utilities.Run("strip", string.Format("-s \"{0}\"", dst), null, null, Utilities.RunOptions.ConsoleLogOutput);
|
||||
// Build for Linux
|
||||
RunCmake(root, platform, architecture, $"-B\"{buildDir}\" " + cmakeArgs);
|
||||
Utilities.Run("make", null, null, buildDir, Utilities.RunOptions.ConsoleLogOutput);
|
||||
Utilities.Run("cmake", $"--build \"{buildDir}\" --config {configuration} --target install", null, buildDir, Utilities.RunOptions.ConsoleLogOutput);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
foreach (var file in outputFiles)
|
||||
{
|
||||
var dst = Path.Combine(depsFolder, Path.GetFileName(file));
|
||||
Utilities.FileCopy(file, dst);
|
||||
//Utilities.Run("strip", string.Format("-s \"{0}\"", dst), null, null, Utilities.RunOptions.ConsoleLogOutput);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Mac:
|
||||
{
|
||||
var outputFiles = new[]
|
||||
case TargetPlatform.Mac:
|
||||
{
|
||||
Path.Combine(libsRoot, "libGenericCodeGen.a"),
|
||||
Path.Combine(libsRoot, "libMachineIndependent.a"),
|
||||
Path.Combine(libsRoot, "libHLSL.a"),
|
||||
Path.Combine(libsRoot, "libOSDependent.a"),
|
||||
Path.Combine(libsRoot, "libOGLCompiler.a"),
|
||||
Path.Combine(libsRoot, "libSPIRV-Tools-opt.a"),
|
||||
Path.Combine(libsRoot, "libSPIRV-Tools.a"),
|
||||
Path.Combine(libsRoot, "libSPIRV.a"),
|
||||
Path.Combine(libsRoot, "libglslang.a"),
|
||||
};
|
||||
var buildDir = root;
|
||||
var outputFiles = new[]
|
||||
{
|
||||
Path.Combine(libsRoot, "libGenericCodeGen.a"),
|
||||
Path.Combine(libsRoot, "libMachineIndependent.a"),
|
||||
Path.Combine(libsRoot, "libHLSL.a"),
|
||||
Path.Combine(libsRoot, "libOSDependent.a"),
|
||||
Path.Combine(libsRoot, "libOGLCompiler.a"),
|
||||
Path.Combine(libsRoot, "libSPIRV-Tools-opt.a"),
|
||||
Path.Combine(libsRoot, "libSPIRV-Tools.a"),
|
||||
Path.Combine(libsRoot, "libSPIRV.a"),
|
||||
Path.Combine(libsRoot, "libglslang.a"),
|
||||
};
|
||||
|
||||
// Build for Mac
|
||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
||||
{
|
||||
RunCmake(root, platform, architecture, cmakeArgs);
|
||||
Utilities.Run("cmake", string.Format("--build . --config {0} --target install", configuration), null, buildDir, Utilities.RunOptions.ConsoleLogOutput);
|
||||
Utilities.Run("make", null, null, root, Utilities.RunOptions.ConsoleLogOutput);
|
||||
// Build for Mac
|
||||
RunCmake(root, platform, architecture, $"-B\"{buildDir}\" " + cmakeArgs);
|
||||
Utilities.Run("make", null, null, buildDir, Utilities.RunOptions.ConsoleLogOutput);
|
||||
Utilities.Run("cmake", $"--build \"{buildDir}\" --config {configuration} --target install", null, buildDir, Utilities.RunOptions.ConsoleLogOutput);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
foreach (var file in outputFiles)
|
||||
{
|
||||
@@ -150,9 +177,9 @@ namespace Flax.Deps.Dependencies
|
||||
Utilities.FileCopy(file, dst);
|
||||
Utilities.Run("strip", string.Format("\"{0}\"", dst), null, null, Utilities.RunOptions.ConsoleLogOutput);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -29,6 +29,24 @@ class libportal : Dependency
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override TargetArchitecture[] Architectures
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (BuildPlatform)
|
||||
{
|
||||
case TargetPlatform.Linux:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
//TargetArchitecture.ARM64,
|
||||
};
|
||||
default: return new TargetArchitecture[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Build(BuildOptions options)
|
||||
{
|
||||
@@ -56,12 +74,12 @@ class libportal : Dependency
|
||||
|
||||
foreach (var platform in options.Platforms)
|
||||
{
|
||||
BuildStarted(platform);
|
||||
switch (platform)
|
||||
foreach (var architecture in options.Architectures)
|
||||
{
|
||||
case TargetPlatform.Linux:
|
||||
{
|
||||
foreach (var architecture in new TargetArchitecture[] { TargetArchitecture.x64 /*, TargetArchitecture.ARM64*/ })
|
||||
BuildStarted(platform, architecture);
|
||||
switch (platform)
|
||||
{
|
||||
case TargetPlatform.Linux:
|
||||
{
|
||||
var buildDir = $"build_{architecture}";
|
||||
Utilities.Run("meson", $"{buildDir} {string.Join(" ", configs)}", null, root, Utilities.RunOptions.DefaultTool);
|
||||
@@ -71,19 +89,19 @@ class libportal : Dependency
|
||||
Utilities.FileCopy(Path.Combine(root, buildDir, "libportal", "libportal.a"), Path.Combine(depsFolder, "libportal.a"));
|
||||
Utilities.FileCopy(Path.Combine(root, buildDir, "libportal", "portal-enums.h"), Path.Combine(includePath, "portal-enums.h"));
|
||||
Utilities.FileCopy(Path.Combine(root, buildDir, "libportal", "portal-enums.c"), Path.Combine(dstPath, "portal-enums.c"));
|
||||
|
||||
Utilities.FileCopy(Path.Combine(root, "COPYING"), Path.Combine(dstPath, "LICENSE.txt"));
|
||||
|
||||
if (!Directory.Exists(includePath))
|
||||
Directory.CreateDirectory(includePath);
|
||||
if (!Directory.Exists(Path.Combine(includePath, "libportal")))
|
||||
Directory.CreateDirectory(Path.Combine(includePath, "libportal"));
|
||||
|
||||
foreach (var file in Directory.GetFiles(Path.Combine(root, "libportal"), "*.h"))
|
||||
Utilities.FileCopy(file, Path.Combine(includePath, "libportal", Path.GetFileName(file)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Utilities.FileCopy(Path.Combine(root, "COPYING"), Path.Combine(dstPath, "LICENSE.txt"));
|
||||
|
||||
if (!Directory.Exists(includePath))
|
||||
Directory.CreateDirectory(includePath);
|
||||
if (!Directory.Exists(Path.Combine(includePath, "libportal")))
|
||||
Directory.CreateDirectory(Path.Combine(includePath, "libportal"));
|
||||
|
||||
foreach (var file in Directory.GetFiles(Path.Combine(root, "libportal"), "*.h"))
|
||||
Utilities.FileCopy(file, Path.Combine(includePath, "libportal", Path.GetFileName(file)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,6 +53,36 @@ namespace Flax.Deps.Dependencies
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override TargetArchitecture[] Architectures
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (BuildPlatform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
TargetArchitecture.ARM64,
|
||||
};
|
||||
case TargetPlatform.Linux:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
//TargetArchitecture.ARM64,
|
||||
};
|
||||
case TargetPlatform.Mac:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
TargetArchitecture.ARM64,
|
||||
};
|
||||
default: return new TargetArchitecture[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private string root;
|
||||
private string monoPropsPath;
|
||||
private string monoPreprocesorDefines;
|
||||
|
||||
@@ -43,6 +43,39 @@ namespace Flax.Deps.Dependencies
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override TargetArchitecture[] Architectures
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (BuildPlatform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
TargetArchitecture.ARM64,
|
||||
};
|
||||
case TargetPlatform.Linux:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
//TargetArchitecture.ARM64,
|
||||
};
|
||||
case TargetPlatform.Mac:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
TargetArchitecture.ARM64,
|
||||
};
|
||||
default: return new TargetArchitecture[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override bool BuildByDefault => false;
|
||||
|
||||
private string root;
|
||||
private bool cleanArtifacts;
|
||||
|
||||
@@ -331,24 +364,27 @@ namespace Flax.Deps.Dependencies
|
||||
|
||||
foreach (var platform in options.Platforms)
|
||||
{
|
||||
BuildStarted(platform);
|
||||
var platformData = Path.Combine(GetBinariesFolder(options, platform), "Data", "nethost");
|
||||
if (Directory.Exists(platformData))
|
||||
Utilities.DirectoryCopy(platformData, root, true, true);
|
||||
switch (platform)
|
||||
foreach (var architecture in options.Architectures)
|
||||
{
|
||||
case TargetPlatform.PS4:
|
||||
case TargetPlatform.PS5:
|
||||
case TargetPlatform.XboxOne:
|
||||
case TargetPlatform.XboxScarlett:
|
||||
Build(options, platform, TargetArchitecture.x64);
|
||||
BuildStarted(platform, architecture);
|
||||
var platformData = Path.Combine(GetBinariesFolder(options, platform), "Data", "nethost");
|
||||
if (Directory.Exists(platformData))
|
||||
Utilities.DirectoryCopy(platformData, root, true, true);
|
||||
switch (platform)
|
||||
{
|
||||
case TargetPlatform.PS4:
|
||||
case TargetPlatform.PS5:
|
||||
case TargetPlatform.XboxOne:
|
||||
case TargetPlatform.XboxScarlett:
|
||||
Build(options, platform, TargetArchitecture.x64);
|
||||
break;
|
||||
case TargetPlatform.Android:
|
||||
Build(options, platform, TargetArchitecture.ARM64);
|
||||
case TargetPlatform.Android:
|
||||
Build(options, platform, TargetArchitecture.ARM64);
|
||||
break;
|
||||
case TargetPlatform.Switch:
|
||||
Build(options, platform, TargetArchitecture.ARM64);
|
||||
case TargetPlatform.Switch:
|
||||
Build(options, platform, TargetArchitecture.ARM64);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,23 @@ namespace Flax.Deps.Dependencies
|
||||
get => new[] { TargetPlatform.Windows };
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override TargetArchitecture[] Architectures
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (BuildPlatform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64
|
||||
};
|
||||
default: return new TargetArchitecture[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void Build(BuildOptions options)
|
||||
{
|
||||
@@ -30,7 +47,7 @@ namespace Flax.Deps.Dependencies
|
||||
// Copy files
|
||||
foreach (var platform in options.Platforms)
|
||||
{
|
||||
BuildStarted(platform);
|
||||
BuildStarted(platform, TargetArchitecture.x64);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
|
||||
Utilities.FileCopy(Path.Combine(root, "amd64/nvapi64.lib"), Path.Combine(depsFolder, "nvapi64.lib"));
|
||||
}
|
||||
|
||||
@@ -49,22 +49,54 @@ namespace Flax.Deps.Dependencies
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override TargetArchitecture[] Architectures
|
||||
{
|
||||
get
|
||||
{
|
||||
switch (BuildPlatform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
TargetArchitecture.ARM64,
|
||||
};
|
||||
case TargetPlatform.Linux:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
//TargetArchitecture.ARM64,
|
||||
};
|
||||
case TargetPlatform.Mac:
|
||||
return new[]
|
||||
{
|
||||
TargetArchitecture.x64,
|
||||
TargetArchitecture.ARM64,
|
||||
};
|
||||
default: return new TargetArchitecture[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private struct Binary
|
||||
{
|
||||
public string Filename;
|
||||
public string SrcFolder;
|
||||
public string DstFilename;
|
||||
|
||||
public Binary(string filename, string srcFolder)
|
||||
public Binary(string filename, string srcFolder, string dstFilename = null)
|
||||
{
|
||||
Filename = filename;
|
||||
SrcFolder = srcFolder;
|
||||
DstFilename = dstFilename;
|
||||
}
|
||||
}
|
||||
|
||||
private bool hasSourcesReady;
|
||||
private string root;
|
||||
private string rootMsvcLib;
|
||||
private string configurationMsvc;
|
||||
private string _configuration = "Release";
|
||||
private List<string> vcxprojContentsWindows;
|
||||
private string[] vcxprojPathsWindows;
|
||||
|
||||
@@ -74,22 +106,6 @@ namespace Flax.Deps.Dependencies
|
||||
new Binary("libvorbisfile_static.lib", "libvorbisfile"),
|
||||
};
|
||||
|
||||
private (string, string)[] vorbisBinariesToCopyWindowsCmake =
|
||||
{
|
||||
("vorbis.lib", "libvorbis_static.lib"),
|
||||
("vorbisfile.lib", "libvorbisfile_static.lib"),
|
||||
};
|
||||
|
||||
private Binary[] oggBinariesToCopyWindows =
|
||||
{
|
||||
new Binary("libogg_static.lib", "ogg"),
|
||||
};
|
||||
|
||||
private (string, string)[] oggBinariesToCopyWindowsCmake =
|
||||
{
|
||||
("ogg.lib", "libogg_static.lib"),
|
||||
};
|
||||
|
||||
private void PatchWindowsTargetPlatformVersion(string windowsTargetPlatformVersion, string platformToolset)
|
||||
{
|
||||
// Fix the MSVC project settings for Windows
|
||||
@@ -107,7 +123,6 @@ namespace Flax.Deps.Dependencies
|
||||
return;
|
||||
|
||||
hasSourcesReady = true;
|
||||
configurationMsvc = "Release";
|
||||
|
||||
string oggRoot = Path.Combine(root, "libogg");
|
||||
string vorbisRoot = Path.Combine(root, "libvorbis");
|
||||
@@ -197,7 +212,7 @@ namespace Flax.Deps.Dependencies
|
||||
break;
|
||||
default: throw new InvalidArchitectureException(architecture);
|
||||
}
|
||||
binariesToCopy.AddRange(vorbisBinariesToCopyWindows.Select(x => new Binary(x.Filename, Path.Combine(buildDir, x.SrcFolder, buildPlatform, configurationMsvc))));
|
||||
binariesToCopy.AddRange(vorbisBinariesToCopyWindows.Select(x => new Binary(x.Filename, Path.Combine(buildDir, x.SrcFolder, buildPlatform, _configuration))));
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.PS4:
|
||||
@@ -216,7 +231,7 @@ namespace Flax.Deps.Dependencies
|
||||
buildDir, true, true);
|
||||
Utilities.FileCopy(Path.Combine(GetBinariesFolder(options, platform), "Data", "ogg", "ogg", "config_types.h"),
|
||||
Path.Combine(root, "libogg", "include", "ogg", "config_types.h"));
|
||||
binariesToCopy.AddRange(binariesToCopyVorbis.Select(x => new Binary(x.Filename, Path.Combine(buildDir, x.SrcFolder, buildPlatform, configurationMsvc))));
|
||||
binariesToCopy.AddRange(binariesToCopyVorbis.Select(x => new Binary(x.Filename, Path.Combine(buildDir, x.SrcFolder, buildPlatform, _configuration))));
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.PS5:
|
||||
@@ -237,7 +252,7 @@ namespace Flax.Deps.Dependencies
|
||||
Utilities.FileCopy(
|
||||
Path.Combine(GetBinariesFolder(options, platform), "Data", "ogg", "ogg", "config_types.h"),
|
||||
Path.Combine(root, "libogg", "include", "ogg", "config_types.h"));
|
||||
binariesToCopy.AddRange(binariesToCopyVorbis.Select(x => new Binary(x.Filename, Path.Combine(buildDir, x.SrcFolder, buildPlatform, configurationMsvc))));
|
||||
binariesToCopy.AddRange(binariesToCopyVorbis.Select(x => new Binary(x.Filename, Path.Combine(buildDir, x.SrcFolder, buildPlatform, _configuration))));
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.XboxOne:
|
||||
@@ -245,21 +260,21 @@ namespace Flax.Deps.Dependencies
|
||||
vcxprojPaths = vcxprojPathsWindows;
|
||||
buildPlatform = "x64";
|
||||
PatchWindowsTargetPlatformVersion("10.0", "v143");
|
||||
binariesToCopy.AddRange(vorbisBinariesToCopyWindows.Select(x => new Binary(x.Filename, Path.Combine(buildDir, x.SrcFolder, buildPlatform, configurationMsvc))));
|
||||
binariesToCopy.AddRange(vorbisBinariesToCopyWindows.Select(x => new Binary(x.Filename, Path.Combine(buildDir, x.SrcFolder, buildPlatform, _configuration))));
|
||||
break;
|
||||
case TargetPlatform.XboxScarlett:
|
||||
buildDir = Path.Combine(rootMsvcLib, "win32", "VS2010");
|
||||
vcxprojPaths = vcxprojPathsWindows;
|
||||
buildPlatform = "x64";
|
||||
PatchWindowsTargetPlatformVersion("10.0", "v143");
|
||||
binariesToCopy.AddRange(vorbisBinariesToCopyWindows.Select(x => new Binary(x.Filename, Path.Combine(buildDir, x.SrcFolder, buildPlatform, configurationMsvc))));
|
||||
binariesToCopy.AddRange(vorbisBinariesToCopyWindows.Select(x => new Binary(x.Filename, Path.Combine(buildDir, x.SrcFolder, buildPlatform, _configuration))));
|
||||
break;
|
||||
default: throw new InvalidPlatformException(platform);
|
||||
}
|
||||
|
||||
// Build
|
||||
foreach (var vcxprojPath in vcxprojPaths)
|
||||
Deploy.VCEnvironment.BuildSolution(vcxprojPath, configurationMsvc, buildPlatform);
|
||||
Deploy.VCEnvironment.BuildSolution(vcxprojPath, _configuration, buildPlatform);
|
||||
|
||||
// Copy binaries
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
@@ -273,48 +288,105 @@ namespace Flax.Deps.Dependencies
|
||||
|
||||
string oggRoot = Path.Combine(root, "libogg");
|
||||
string vorbisRoot = Path.Combine(root, "libvorbis");
|
||||
|
||||
var oggBuildDir = Path.Combine(oggRoot, "build-" + architecture.ToString());
|
||||
var vorbisBuildDir = Path.Combine(vorbisRoot, "build-" + architecture.ToString());
|
||||
var installDir = Path.Combine(root, "install");
|
||||
|
||||
string ext;
|
||||
string oggConfig = $"-DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE={_configuration} -DCMAKE_INSTALL_PREFIX=\"{installDir}\"";
|
||||
string vorbisConfig = $"-DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE={_configuration} -DCMAKE_INSTALL_PREFIX=\"{installDir}\"";
|
||||
Dictionary<string, string> envVars = new Dictionary<string, string>();
|
||||
(string, string)[] oggBinariesToCopy;
|
||||
Binary[] vorbisBinariesToCopy;
|
||||
switch (platform)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
case TargetPlatform.UWP:
|
||||
case TargetPlatform.XboxOne:
|
||||
oggConfig += " -DBUILD_SHARED_LIBS=OFF";
|
||||
vorbisConfig += " -DBUILD_SHARED_LIBS=OFF";
|
||||
ext = ".lib";
|
||||
break;
|
||||
case TargetPlatform.Linux:
|
||||
oggConfig += " -DCMAKE_POSITION_INDEPENDENT_CODE=ON";
|
||||
vorbisConfig += " -DCMAKE_POSITION_INDEPENDENT_CODE=ON";
|
||||
envVars = new Dictionary<string, string>
|
||||
{
|
||||
{ "CC", "clang-" + Configuration.LinuxClangMinVer },
|
||||
{ "CC_FOR_BUILD", "clang-" + Configuration.LinuxClangMinVer }
|
||||
};
|
||||
ext = ".a";
|
||||
break;
|
||||
case TargetPlatform.Mac:
|
||||
//oggConfig += $" -DOGG_INCLUDE_DIR=\"{oggRoot}/install/include\" -DOGG_LIBRARY=\"{oggRoot}/install/lib\"";
|
||||
ext = ".a";
|
||||
break;
|
||||
default: throw new InvalidPlatformException(platform);
|
||||
}
|
||||
|
||||
var binariesToCopy = new List<(string, string)>();
|
||||
|
||||
// Build ogg
|
||||
switch (platform)
|
||||
{
|
||||
var solutionPath = Path.Combine(oggBuildDir, "ogg.sln");
|
||||
|
||||
RunCmake(oggRoot, platform, architecture, $"-B\"{oggBuildDir}\" -DBUILD_SHARED_LIBS=OFF");
|
||||
Deploy.VCEnvironment.BuildSolution(solutionPath, configurationMsvc, architecture.ToString());
|
||||
foreach (var file in oggBinariesToCopyWindowsCmake)
|
||||
binariesToCopy.Add((Path.Combine(oggBuildDir, configurationMsvc, file.Item1), file.Item2));
|
||||
case TargetPlatform.Windows:
|
||||
case TargetPlatform.UWP:
|
||||
case TargetPlatform.XboxOne:
|
||||
oggBinariesToCopy =
|
||||
[
|
||||
("ogg.lib", "libogg_static.lib")
|
||||
];
|
||||
vorbisBinariesToCopy =
|
||||
[
|
||||
new Binary("vorbis.lib", "libvorbis", "libvorbis_static.lib"),
|
||||
new Binary("vorbisfile.lib", "libvorbisfile", "libvorbisfile_static.lib")
|
||||
];
|
||||
break;
|
||||
case TargetPlatform.Linux:
|
||||
case TargetPlatform.Mac:
|
||||
oggBinariesToCopy =
|
||||
[
|
||||
("libogg.a", "libogg.a")
|
||||
];
|
||||
vorbisBinariesToCopy =
|
||||
[
|
||||
new Binary("libvorbis.a", "lib"),
|
||||
new Binary("libvorbisenc.a", "lib"),
|
||||
new Binary("libvorbisfile.a", "lib")
|
||||
];
|
||||
break;
|
||||
default: throw new InvalidPlatformException(platform);
|
||||
}
|
||||
|
||||
vorbisConfig += $" -DOGG_INCLUDE_DIR=\"{Path.Combine(installDir, "include")}\" -DOGG_LIBRARY=\"{Path.Combine(installDir, "lib", "libogg" + ext)}\"";
|
||||
|
||||
var binariesToCopy = new List<(string, string)>();
|
||||
|
||||
SetupDirectory(installDir, true);
|
||||
// Build ogg
|
||||
{
|
||||
SetupDirectory(oggBuildDir, true);
|
||||
RunCmake(oggRoot, platform, architecture, $"-B\"{oggBuildDir}\" " + oggConfig, envVars);
|
||||
if (platform == TargetPlatform.Windows)
|
||||
Deploy.VCEnvironment.BuildSolution(Path.Combine(oggBuildDir, "ogg.sln"), _configuration, architecture.ToString());
|
||||
else if (platform == TargetPlatform.Mac || platform == TargetPlatform.Linux)
|
||||
BuildCmake(oggBuildDir);
|
||||
Utilities.Run("cmake", "--build . --target install", null, oggBuildDir, Utilities.RunOptions.DefaultTool);
|
||||
}
|
||||
// Build vorbis
|
||||
{
|
||||
var oggLibraryPath = Path.Combine(oggBuildDir, configurationMsvc, "ogg" + ext);
|
||||
var solutionPath = Path.Combine(vorbisBuildDir, "vorbis.sln");
|
||||
|
||||
RunCmake(vorbisRoot, platform, architecture, $"-B\"{vorbisBuildDir}\" -DOGG_INCLUDE_DIR=\"{Path.Combine(oggRoot, "include")}\" -DOGG_LIBRARY=\"{oggLibraryPath}\" -DBUILD_SHARED_LIBS=OFF");
|
||||
Deploy.VCEnvironment.BuildSolution(solutionPath, configurationMsvc, architecture.ToString());
|
||||
foreach (var file in vorbisBinariesToCopyWindowsCmake)
|
||||
binariesToCopy.Add((Path.Combine(vorbisBuildDir, "lib", configurationMsvc, file.Item1), file.Item2));
|
||||
SetupDirectory(vorbisBuildDir, true);
|
||||
RunCmake(vorbisRoot, platform, architecture, $"-B\"{vorbisBuildDir}\" " + vorbisConfig);
|
||||
if (platform == TargetPlatform.Windows)
|
||||
Deploy.VCEnvironment.BuildSolution(Path.Combine(vorbisBuildDir, "vorbis.sln"), _configuration, architecture.ToString());
|
||||
else if (platform == TargetPlatform.Mac || platform == TargetPlatform.Linux)
|
||||
BuildCmake(vorbisBuildDir);
|
||||
Utilities.Run("cmake", "--build . --target install", null, vorbisBuildDir, Utilities.RunOptions.DefaultTool);
|
||||
}
|
||||
|
||||
// Copy binaries
|
||||
foreach (var file in oggBinariesToCopy)
|
||||
binariesToCopy.Add((Path.Combine(installDir, "lib", file.Item1), file.Item2));
|
||||
foreach (var file in vorbisBinariesToCopy)
|
||||
binariesToCopy.Add((Path.Combine(installDir, "lib", file.Filename), file.DstFilename ?? file.Filename));
|
||||
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
foreach (var file in binariesToCopy)
|
||||
Utilities.FileCopy(file.Item1, Path.Combine(depsFolder, file.Item2));
|
||||
@@ -337,201 +409,140 @@ namespace Flax.Deps.Dependencies
|
||||
|
||||
foreach (var platform in options.Platforms)
|
||||
{
|
||||
BuildStarted(platform);
|
||||
switch (platform)
|
||||
foreach (var architecture in options.Architectures)
|
||||
{
|
||||
case TargetPlatform.Windows:
|
||||
{
|
||||
BuildCmake(options, TargetPlatform.Windows, TargetArchitecture.x64);
|
||||
BuildCmake(options, TargetPlatform.Windows, TargetArchitecture.ARM64);
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.UWP:
|
||||
{
|
||||
BuildMsbuild(options, TargetPlatform.UWP, TargetArchitecture.x64);
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.XboxOne:
|
||||
{
|
||||
BuildMsbuild(options, TargetPlatform.XboxOne, TargetArchitecture.x64);
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Linux:
|
||||
{
|
||||
// Note: assumes the libogg-dev package is pre-installed on the system
|
||||
|
||||
// Get the source
|
||||
CloneGitRepoFast(root, "https://github.com/xiph/vorbis.git");
|
||||
|
||||
var envVars = new Dictionary<string, string>
|
||||
BuildStarted(platform, architecture);
|
||||
switch (platform)
|
||||
{
|
||||
{ "CC", "clang-" + Configuration.LinuxClangMinVer },
|
||||
{ "CC_FOR_BUILD", "clang-" + Configuration.LinuxClangMinVer }
|
||||
};
|
||||
var buildDir = Path.Combine(root, "build");
|
||||
|
||||
Utilities.Run(Path.Combine(root, "autogen.sh"), null, null, root, Utilities.RunOptions.Default, envVars);
|
||||
|
||||
// Build for Linux
|
||||
var toolchain = UnixToolchain.GetToolchainName(platform, TargetArchitecture.x64);
|
||||
Utilities.Run(Path.Combine(root, "configure"), string.Format("--host={0}", toolchain), null, root, Utilities.RunOptions.Default, envVars);
|
||||
SetupDirectory(buildDir, true);
|
||||
Utilities.Run("cmake", "-G \"Unix Makefiles\" -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_BUILD_TYPE=Release ..", null, buildDir, Utilities.RunOptions.ConsoleLogOutput, envVars);
|
||||
Utilities.Run("cmake", "--build .", null, buildDir, Utilities.RunOptions.ConsoleLogOutput, envVars);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.x64);
|
||||
foreach (var file in binariesToCopyUnix)
|
||||
Utilities.FileCopy(Path.Combine(buildDir, file.SrcFolder, file.Filename), Path.Combine(depsFolder, file.Filename));
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.PS4:
|
||||
{
|
||||
BuildMsbuild(options, TargetPlatform.PS4, TargetArchitecture.x64);
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.PS5:
|
||||
{
|
||||
BuildMsbuild(options, TargetPlatform.PS5, TargetArchitecture.x64);
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.XboxScarlett:
|
||||
{
|
||||
BuildMsbuild(options, TargetPlatform.XboxScarlett, TargetArchitecture.x64);
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Android:
|
||||
{
|
||||
var oggRoot = Path.Combine(root, "ogg");
|
||||
var oggBuildDir = Path.Combine(oggRoot, "build");
|
||||
var buildDir = Path.Combine(root, "build");
|
||||
|
||||
// Get the source
|
||||
CloneGitRepoFast(root, "https://github.com/xiph/vorbis.git");
|
||||
CloneGitRepo(oggRoot, "https://github.com/xiph/ogg.git");
|
||||
GitCheckout(oggRoot, "master", "4380566a44b8d5e85ad511c9c17eb04197863ec5");
|
||||
|
||||
// Build for Android
|
||||
SetupDirectory(oggBuildDir, true);
|
||||
RunCmake(oggBuildDir, platform, TargetArchitecture.ARM64, ".. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=\"../install\"");
|
||||
Utilities.Run("cmake", "--build . --target install", null, oggBuildDir, Utilities.RunOptions.ConsoleLogOutput);
|
||||
SetupDirectory(buildDir, true);
|
||||
RunCmake(buildDir, platform, TargetArchitecture.ARM64, string.Format(".. -DCMAKE_BUILD_TYPE=Release -DOGG_INCLUDE_DIR=\"{0}/install/include\" -DOGG_LIBRARY=\"{0}/install/lib\"", oggRoot));
|
||||
BuildCmake(buildDir);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.ARM64);
|
||||
foreach (var file in binariesToCopyUnix)
|
||||
Utilities.FileCopy(Path.Combine(buildDir, file.SrcFolder, file.Filename), Path.Combine(depsFolder, file.Filename));
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Switch:
|
||||
{
|
||||
var oggRoot = Path.Combine(root, "ogg");
|
||||
var oggBuildDir = Path.Combine(oggRoot, "build");
|
||||
var buildDir = Path.Combine(root, "build");
|
||||
|
||||
// Get the source
|
||||
SetupDirectory(oggRoot, false);
|
||||
CloneGitRepo(root, "https://github.com/xiph/vorbis.git");
|
||||
GitCheckout(root, "master", "98eddc72d36e3421519d54b101c09b57e4d4d10d");
|
||||
CloneGitRepo(oggRoot, "https://github.com/xiph/ogg.git");
|
||||
GitCheckout(oggRoot, "master", "4380566a44b8d5e85ad511c9c17eb04197863ec5");
|
||||
Utilities.DirectoryCopy(Path.Combine(GetBinariesFolder(options, platform), "Data/ogg"), oggRoot, true, true);
|
||||
Utilities.DirectoryCopy(Path.Combine(GetBinariesFolder(options, platform), "Data/vorbis"), buildDir, true, true);
|
||||
|
||||
// Build for Switch
|
||||
SetupDirectory(oggBuildDir, true);
|
||||
RunCmake(oggBuildDir, platform, TargetArchitecture.ARM64, ".. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=\"../install\"");
|
||||
Utilities.Run("cmake", "--build . --target install", null, oggBuildDir, Utilities.RunOptions.ConsoleLogOutput);
|
||||
Utilities.FileCopy(Path.Combine(GetBinariesFolder(options, platform), "Data/ogg", "include", "ogg", "config_types.h"), Path.Combine(oggRoot, "install", "include", "ogg", "config_types.h"));
|
||||
SetupDirectory(buildDir, true);
|
||||
RunCmake(buildDir, platform, TargetArchitecture.ARM64, string.Format(".. -DCMAKE_BUILD_TYPE=Release -DOGG_INCLUDE_DIR=\"{0}/install/include\" -DOGG_LIBRARY=\"{0}/install/lib\"", oggRoot));
|
||||
BuildCmake(buildDir);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.ARM64);
|
||||
foreach (var file in binariesToCopyUnix)
|
||||
Utilities.FileCopy(Path.Combine(buildDir, file.SrcFolder, file.Filename), Path.Combine(depsFolder, file.Filename));
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Mac:
|
||||
{
|
||||
var oggRoot = Path.Combine(root, "ogg");
|
||||
var oggBuildDir = Path.Combine(oggRoot, "build");
|
||||
var buildDir = Path.Combine(root, "build");
|
||||
|
||||
// Get the source
|
||||
CloneGitRepoFast(root, "https://github.com/xiph/vorbis.git");
|
||||
CloneGitRepo(oggRoot, "https://github.com/xiph/ogg.git");
|
||||
GitCheckout(oggRoot, "master", "4380566a44b8d5e85ad511c9c17eb04197863ec5");
|
||||
|
||||
// Build for Mac
|
||||
foreach (var architecture in new[] { TargetArchitecture.x64, TargetArchitecture.ARM64 })
|
||||
case TargetPlatform.Windows:
|
||||
{
|
||||
BuildCmake(options, TargetPlatform.Windows, architecture);
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.UWP:
|
||||
{
|
||||
BuildMsbuild(options, TargetPlatform.UWP, architecture);
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.XboxOne:
|
||||
{
|
||||
BuildMsbuild(options, TargetPlatform.XboxOne, architecture);
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Linux:
|
||||
{
|
||||
BuildCmake(options, TargetPlatform.Linux, architecture);
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.PS4:
|
||||
{
|
||||
BuildMsbuild(options, TargetPlatform.PS4, TargetArchitecture.x64);
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.PS5:
|
||||
{
|
||||
BuildMsbuild(options, TargetPlatform.PS5, TargetArchitecture.x64);
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.XboxScarlett:
|
||||
{
|
||||
BuildMsbuild(options, TargetPlatform.XboxScarlett, TargetArchitecture.x64);
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Android:
|
||||
{
|
||||
var oggRoot = Path.Combine(root, "ogg");
|
||||
var oggBuildDir = Path.Combine(oggRoot, "build");
|
||||
var buildDir = Path.Combine(root, "build");
|
||||
|
||||
// Get the source
|
||||
CloneGitRepoFast(root, "https://github.com/xiph/vorbis.git");
|
||||
CloneGitRepo(oggRoot, "https://github.com/xiph/ogg.git");
|
||||
GitCheckout(oggRoot, "master", "4380566a44b8d5e85ad511c9c17eb04197863ec5");
|
||||
|
||||
// Build for Android
|
||||
SetupDirectory(oggBuildDir, true);
|
||||
RunCmake(oggBuildDir, platform, architecture, ".. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=\"../install\"");
|
||||
RunCmake(oggBuildDir, platform, TargetArchitecture.ARM64, ".. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=\"../install\"");
|
||||
Utilities.Run("cmake", "--build . --target install", null, oggBuildDir, Utilities.RunOptions.ConsoleLogOutput);
|
||||
SetupDirectory(buildDir, true);
|
||||
RunCmake(buildDir, platform, architecture, string.Format(".. -DCMAKE_BUILD_TYPE=Release -DOGG_INCLUDE_DIR=\"{0}/install/include\" -DOGG_LIBRARY=\"{0}/install/lib\"", oggRoot));
|
||||
RunCmake(buildDir, platform, TargetArchitecture.ARM64, string.Format(".. -DCMAKE_BUILD_TYPE=Release -DOGG_INCLUDE_DIR=\"{0}/install/include\" -DOGG_LIBRARY=\"{0}/install/lib\"", oggRoot));
|
||||
BuildCmake(buildDir);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, architecture);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.ARM64);
|
||||
foreach (var file in binariesToCopyUnix)
|
||||
Utilities.FileCopy(Path.Combine(buildDir, file.SrcFolder, file.Filename), Path.Combine(depsFolder, file.Filename));
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.iOS:
|
||||
{
|
||||
var oggRoot = Path.Combine(root, "ogg");
|
||||
var oggBuildDir = Path.Combine(oggRoot, "build");
|
||||
var buildDir = Path.Combine(root, "build");
|
||||
case TargetPlatform.Switch:
|
||||
{
|
||||
var oggRoot = Path.Combine(root, "ogg");
|
||||
var oggBuildDir = Path.Combine(oggRoot, "build");
|
||||
var buildDir = Path.Combine(root, "build");
|
||||
|
||||
// Get the source
|
||||
CloneGitRepoFast(root, "https://github.com/xiph/vorbis.git");
|
||||
CloneGitRepo(oggRoot, "https://github.com/xiph/ogg.git");
|
||||
GitCheckout(oggRoot, "master", "4380566a44b8d5e85ad511c9c17eb04197863ec5");
|
||||
// Get the source
|
||||
SetupDirectory(oggRoot, false);
|
||||
CloneGitRepo(root, "https://github.com/xiph/vorbis.git");
|
||||
GitCheckout(root, "master", "98eddc72d36e3421519d54b101c09b57e4d4d10d");
|
||||
CloneGitRepo(oggRoot, "https://github.com/xiph/ogg.git");
|
||||
GitCheckout(oggRoot, "master", "4380566a44b8d5e85ad511c9c17eb04197863ec5");
|
||||
Utilities.DirectoryCopy(Path.Combine(GetBinariesFolder(options, platform), "Data/ogg"), oggRoot, true, true);
|
||||
Utilities.DirectoryCopy(Path.Combine(GetBinariesFolder(options, platform), "Data/vorbis"), buildDir, true, true);
|
||||
|
||||
// Build for Mac
|
||||
SetupDirectory(oggBuildDir, true);
|
||||
RunCmake(oggBuildDir, platform, TargetArchitecture.ARM64, ".. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=\"../install\"");
|
||||
Utilities.Run("cmake", "--build . --target install", null, oggBuildDir, Utilities.RunOptions.ConsoleLogOutput);
|
||||
SetupDirectory(buildDir, true);
|
||||
RunCmake(buildDir, platform, TargetArchitecture.ARM64, string.Format(".. -DCMAKE_BUILD_TYPE=Release -DOGG_INCLUDE_DIR=\"{0}/install/include\" -DOGG_LIBRARY=\"{0}/install/lib\"", oggRoot));
|
||||
BuildCmake(buildDir);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.ARM64);
|
||||
foreach (var file in binariesToCopyUnix)
|
||||
Utilities.FileCopy(Path.Combine(buildDir, file.SrcFolder, file.Filename), Path.Combine(depsFolder, file.Filename));
|
||||
break;
|
||||
}
|
||||
// Build for Switch
|
||||
SetupDirectory(oggBuildDir, true);
|
||||
RunCmake(oggBuildDir, platform, TargetArchitecture.ARM64, ".. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=\"../install\"");
|
||||
Utilities.Run("cmake", "--build . --target install", null, oggBuildDir, Utilities.RunOptions.ConsoleLogOutput);
|
||||
Utilities.FileCopy(Path.Combine(GetBinariesFolder(options, platform), "Data/ogg", "include", "ogg", "config_types.h"), Path.Combine(oggRoot, "install", "include", "ogg", "config_types.h"));
|
||||
SetupDirectory(buildDir, true);
|
||||
RunCmake(buildDir, platform, TargetArchitecture.ARM64, string.Format(".. -DCMAKE_BUILD_TYPE=Release -DOGG_INCLUDE_DIR=\"{0}/install/include\" -DOGG_LIBRARY=\"{0}/install/lib\"", oggRoot));
|
||||
BuildCmake(buildDir);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.ARM64);
|
||||
foreach (var file in binariesToCopyUnix)
|
||||
Utilities.FileCopy(Path.Combine(buildDir, file.SrcFolder, file.Filename), Path.Combine(depsFolder, file.Filename));
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.Mac:
|
||||
{
|
||||
BuildCmake(options, TargetPlatform.Mac, architecture);
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.iOS:
|
||||
{
|
||||
var oggRoot = Path.Combine(root, "ogg");
|
||||
var oggBuildDir = Path.Combine(oggRoot, "build");
|
||||
var buildDir = Path.Combine(root, "build");
|
||||
|
||||
// Get the source
|
||||
CloneGitRepoFast(root, "https://github.com/xiph/vorbis.git");
|
||||
CloneGitRepo(oggRoot, "https://github.com/xiph/ogg.git");
|
||||
GitCheckout(oggRoot, "master", "4380566a44b8d5e85ad511c9c17eb04197863ec5");
|
||||
|
||||
// Build for Mac
|
||||
SetupDirectory(oggBuildDir, true);
|
||||
RunCmake(oggBuildDir, platform, TargetArchitecture.ARM64, ".. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=\"../install\"");
|
||||
Utilities.Run("cmake", "--build . --target install", null, oggBuildDir, Utilities.RunOptions.ConsoleLogOutput);
|
||||
SetupDirectory(buildDir, true);
|
||||
RunCmake(buildDir, platform, TargetArchitecture.ARM64, string.Format(".. -DCMAKE_BUILD_TYPE=Release -DOGG_INCLUDE_DIR=\"{0}/install/include\" -DOGG_LIBRARY=\"{0}/install/lib\"", oggRoot));
|
||||
BuildCmake(buildDir);
|
||||
var depsFolder = GetThirdPartyFolder(options, platform, TargetArchitecture.ARM64);
|
||||
foreach (var file in binariesToCopyUnix)
|
||||
Utilities.FileCopy(Path.Combine(buildDir, file.SrcFolder, file.Filename), Path.Combine(depsFolder, file.Filename));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Backup files
|
||||
if (hasSourcesReady)
|
||||
root = rootMsvcLib;
|
||||
var srcIncludePath = Path.Combine(root, "include", "vorbis");
|
||||
var dstIncludePath = Path.Combine(options.ThirdPartyFolder, "vorbis");
|
||||
foreach (var filename in filesToKeep)
|
||||
{
|
||||
var src = Path.Combine(dstIncludePath, filename);
|
||||
var dst = Path.Combine(options.IntermediateFolder, filename + ".tmp");
|
||||
Utilities.FileCopy(src, dst);
|
||||
}
|
||||
// Setup headers directory
|
||||
var installDir = Path.Combine(root, "install");
|
||||
var oggOut = Path.Combine(options.ThirdPartyFolder, "ogg");
|
||||
var vorbisOut = Path.Combine(options.ThirdPartyFolder, "vorbis");
|
||||
|
||||
try
|
||||
{
|
||||
// Setup headers directory
|
||||
SetupDirectory(dstIncludePath, true);
|
||||
// Deploy header files
|
||||
Utilities.DirectoryCopy(Path.Combine(installDir, "include", "ogg"), oggOut, true, true);
|
||||
Utilities.DirectoryCopy(Path.Combine(installDir, "include", "vorbis"), vorbisOut, true, true);
|
||||
|
||||
// Deploy header files and restore files
|
||||
Directory.GetFiles(srcIncludePath, "Makefile*").ToList().ForEach(File.Delete);
|
||||
Utilities.DirectoryCopy(srcIncludePath, dstIncludePath, true, true);
|
||||
Utilities.FileCopy(Path.Combine(root, "COPYING"), Path.Combine(dstIncludePath, "COPYING"));
|
||||
}
|
||||
finally
|
||||
{
|
||||
foreach (var filename in filesToKeep)
|
||||
{
|
||||
var src = Path.Combine(options.IntermediateFolder, filename + ".tmp");
|
||||
var dst = Path.Combine(dstIncludePath, filename);
|
||||
Utilities.FileCopy(src, dst);
|
||||
}
|
||||
}
|
||||
Utilities.FileCopy(Path.Combine(root, "libogg", "COPYING"), Path.Combine(oggOut, "COPYING"));
|
||||
Utilities.FileCopy(Path.Combine(root, "libvorbis", "COPYING"), Path.Combine(vorbisOut, "COPYING"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,6 +40,11 @@ namespace Flax.Deps
|
||||
/// The target platforms to build dependency for (contains only platforms supported by the dependency itself).
|
||||
/// </summary>
|
||||
public TargetPlatform[] Platforms;
|
||||
|
||||
/// <summary>
|
||||
/// The target architectures to build dependency for (contains only platforms supported by the dependency itself).
|
||||
/// </summary>
|
||||
public TargetArchitecture[] Architectures;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -47,11 +52,34 @@ namespace Flax.Deps
|
||||
/// </summary>
|
||||
protected static TargetPlatform BuildPlatform => Platform.BuildPlatform.Target;
|
||||
|
||||
|
||||
private static Version? _cmakeVersion;
|
||||
protected static Version CMakeVersion
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_cmakeVersion == null)
|
||||
{
|
||||
var versionOutput = Utilities.ReadProcessOutput("cmake", "--version");
|
||||
var versionStart = versionOutput.IndexOf("cmake version ") + "cmake version ".Length;
|
||||
var versionEnd = versionOutput.IndexOfAny(['-', '\n', '\r'], versionStart); // End of line or dash before Git hash
|
||||
var versionString = versionOutput.Substring(versionStart, versionEnd - versionStart);
|
||||
_cmakeVersion = new Version(versionString);
|
||||
}
|
||||
return _cmakeVersion;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the platforms list supported by this dependency to build on the current build platform (based on <see cref="Platform.BuildPlatform"/>).
|
||||
/// </summary>
|
||||
public abstract TargetPlatform[] Platforms { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets the architectures list supported by this dependency to build on the current build platform (based on <see cref="Platform.BuildPlatform"/>).
|
||||
/// </summary>
|
||||
public abstract TargetArchitecture[] Architectures { get; }
|
||||
|
||||
/// <summary>
|
||||
/// True if build dependency by default, otherwise only when explicitly specified via command line.
|
||||
/// </summary>
|
||||
@@ -67,9 +95,9 @@ namespace Flax.Deps
|
||||
/// Logs build process start.
|
||||
/// </summary>
|
||||
/// <param name="platform">Target platform.</param>
|
||||
protected void BuildStarted(TargetPlatform platform)
|
||||
protected void BuildStarted(TargetPlatform platform, TargetArchitecture architecture)
|
||||
{
|
||||
Log.Info($"Building {GetType().Name} for {platform}");
|
||||
Log.Info($"Building {GetType().Name} for {platform}{(architecture != TargetArchitecture.AnyCPU ? $" ({architecture})" : "")}");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -351,7 +379,13 @@ namespace Flax.Deps
|
||||
break;
|
||||
default: throw new InvalidArchitectureException(architecture);
|
||||
}
|
||||
cmdLine = string.Format("CMakeLists.txt -G \"Visual Studio 17 2022\" -A {0}", arch);
|
||||
if (CMakeVersion.Major > 4 || (CMakeVersion.Major == 4 && CMakeVersion.Minor >= 2))
|
||||
{
|
||||
// This generates both .sln and .slnx solution files
|
||||
cmdLine = string.Format("CMakeLists.txt -G \"Visual Studio 17 2022\" -G \"Visual Studio 18 2026\" -A {0}", arch);
|
||||
}
|
||||
else
|
||||
cmdLine = string.Format("CMakeLists.txt -G \"Visual Studio 17 2022\" -A {0}", arch);
|
||||
break;
|
||||
}
|
||||
case TargetPlatform.PS4:
|
||||
|
||||
@@ -38,20 +38,21 @@ namespace Flax.Deps
|
||||
var platforms = Globals.AllPlatforms;
|
||||
if (Configuration.BuildPlatforms != null && Configuration.BuildPlatforms.Length != 0)
|
||||
platforms = Configuration.BuildPlatforms;
|
||||
platforms = platforms.Where(x => buildPlatform.CanBuildPlatform(x)).ToArray();
|
||||
Log.Verbose("Building deps for platforms:");
|
||||
platforms = platforms.Where(buildPlatform.CanBuildPlatform).ToArray();
|
||||
var architectures = Globals.AllArchitectures;
|
||||
if (Configuration.BuildArchitectures != null && Configuration.BuildArchitectures.Length != 0)
|
||||
architectures = Configuration.BuildArchitectures;
|
||||
architectures = architectures.Where(buildPlatform.CanBuildArchitecture).ToArray();
|
||||
Log.Verbose($"Building deps for platforms {string.Join(',', platforms)}, {string.Join(',', architectures)}:");
|
||||
foreach (var platform in platforms)
|
||||
{
|
||||
Log.Verbose(" - " + platform);
|
||||
foreach (var architecture in architectures)
|
||||
{
|
||||
Log.Verbose($" - {platform} ({architecture})");
|
||||
|
||||
if (Platform.IsPlatformSupported(platform, TargetArchitecture.x64))
|
||||
SetupDepsOutputFolder(options, platform, TargetArchitecture.x64);
|
||||
if (Platform.IsPlatformSupported(platform, TargetArchitecture.x86))
|
||||
SetupDepsOutputFolder(options, platform, TargetArchitecture.x86);
|
||||
if (Platform.IsPlatformSupported(platform, TargetArchitecture.ARM))
|
||||
SetupDepsOutputFolder(options, platform, TargetArchitecture.ARM);
|
||||
if (Platform.IsPlatformSupported(platform, TargetArchitecture.ARM64))
|
||||
SetupDepsOutputFolder(options, platform, TargetArchitecture.ARM64);
|
||||
if (Platform.IsPlatformSupported(platform, architecture))
|
||||
SetupDepsOutputFolder(options, platform, architecture);
|
||||
}
|
||||
}
|
||||
|
||||
// Get all deps
|
||||
@@ -80,6 +81,14 @@ namespace Flax.Deps
|
||||
continue;
|
||||
}
|
||||
|
||||
options.Architectures = architectures.Intersect(dependency.Architectures).ToArray();
|
||||
if (options.Architectures.Length == 0)
|
||||
{
|
||||
Log.Info(string.Format("Skipping {0} ({1}/{2})", name, i + 1, dependencies.Length));
|
||||
Log.Verbose("Architecture not used on any of the build platforms.");
|
||||
continue;
|
||||
}
|
||||
|
||||
Log.Info(string.Format("Building {0} ({1}/{2})", name, i + 1, dependencies.Length));
|
||||
|
||||
options.IntermediateFolder = Path.Combine(Environment.CurrentDirectory, "Cache", "Intermediate", "Deps", name).Replace('\\', '/');
|
||||
|
||||
@@ -14,20 +14,20 @@ namespace Flax.Deps
|
||||
/// </summary>
|
||||
static class Downloader
|
||||
{
|
||||
private static bool IgnoreSSL = false;
|
||||
private static bool NoSSL = false;
|
||||
private const string GoogleDriveDomain = "drive.google.com";
|
||||
private const string GoogleDriveDomain2 = "https://drive.google.com";
|
||||
|
||||
// Normal example: FileDownloader.DownloadFileFromURLToPath( "http://example.com/file/download/link", @"C:\file.txt" );
|
||||
// Drive example: FileDownloader.DownloadFileFromURLToPath( "http://drive.google.com/file/d/FILEID/view?usp=sharing", @"C:\file.txt" );
|
||||
public static FileInfo DownloadFileFromUrlToPath(string url, string path)
|
||||
public static FileInfo DownloadFileFromUrlToPath(string url, string path, bool noSSL = false)
|
||||
{
|
||||
Log.Info(string.Format("Downloading {0} to {1}", url, path));
|
||||
if (File.Exists(path))
|
||||
File.Delete(path);
|
||||
if (url.StartsWith(GoogleDriveDomain) || url.StartsWith(GoogleDriveDomain2))
|
||||
return DownloadGoogleDriveFileFromUrlToPath(url, path);
|
||||
return DownloadFileFromUrlToPath(url, path, null);
|
||||
return DownloadGoogleDriveFileFromUrlToPath(url, path, noSSL);
|
||||
return DownloadFileFromUrlToPath(url, path, null, noSSL);
|
||||
}
|
||||
|
||||
private static FileInfo DownloadFileFromUrlToPathRaw(string url, string path, HttpClient httpClient)
|
||||
@@ -49,16 +49,14 @@ namespace Flax.Deps
|
||||
return new FileInfo(path);
|
||||
}
|
||||
|
||||
private static FileInfo DownloadFileFromUrlToPath(string url, string path, HttpClient httpClient)
|
||||
private static FileInfo DownloadFileFromUrlToPath(string url, string path, HttpClient httpClient, bool noSSL)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (httpClient == null)
|
||||
{
|
||||
using (httpClient = GetHttpClient())
|
||||
{
|
||||
using (httpClient = GetHttpClient(noSSL))
|
||||
return DownloadFileFromUrlToPathRaw(url, path, httpClient);
|
||||
}
|
||||
}
|
||||
return DownloadFileFromUrlToPathRaw(url, path, httpClient);
|
||||
}
|
||||
@@ -126,12 +124,12 @@ namespace Flax.Deps
|
||||
// Downloading large files from Google Drive prompts a warning screen and
|
||||
// requires manual confirmation. Consider that case and try to confirm the download automatically
|
||||
// if warning prompt occurs
|
||||
private static FileInfo DownloadGoogleDriveFileFromUrlToPath(string url, string path)
|
||||
private static FileInfo DownloadGoogleDriveFileFromUrlToPath(string url, string path, bool noSSL)
|
||||
{
|
||||
// You can comment the statement below if the provided url is guaranteed to be in the following format:
|
||||
// https://drive.google.com/uc?id=FILEID&export=download
|
||||
url = GetGoogleDriveDownloadLinkFromUrl(url);
|
||||
using (var httpClient = GetHttpClient())
|
||||
using (var httpClient = GetHttpClient(noSSL))
|
||||
{
|
||||
FileInfo downloadedFile;
|
||||
|
||||
@@ -139,7 +137,7 @@ namespace Flax.Deps
|
||||
// but works in the second attempt
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
downloadedFile = DownloadFileFromUrlToPath(url, path, httpClient);
|
||||
downloadedFile = DownloadFileFromUrlToPath(url, path, httpClient, noSSL);
|
||||
if (downloadedFile == null)
|
||||
return null;
|
||||
|
||||
@@ -172,7 +170,7 @@ namespace Flax.Deps
|
||||
url = "https://drive.google.com" + content.Substring(linkIndex, linkEnd - linkIndex).Replace("&", "&");
|
||||
}
|
||||
|
||||
downloadedFile = DownloadFileFromUrlToPath(url, path, httpClient);
|
||||
downloadedFile = DownloadFileFromUrlToPath(url, path, httpClient, noSSL);
|
||||
return downloadedFile;
|
||||
}
|
||||
}
|
||||
@@ -211,11 +209,10 @@ namespace Flax.Deps
|
||||
return string.Format("https://drive.google.com/uc?id={0}&export=download", url.Substring(index, closingIndex - index));
|
||||
}
|
||||
|
||||
private static HttpClient GetHttpClient()
|
||||
private static HttpClient GetHttpClient(bool noSSL)
|
||||
{
|
||||
if (IgnoreSSL)
|
||||
if (noSSL || NoSSL)
|
||||
{
|
||||
Log.Warning("Accessing HTTP with SSL certificate validation disabled!");
|
||||
var handler = new HttpClientHandler();
|
||||
handler.ClientCertificateOptions = ClientCertificateOption.Manual;
|
||||
handler.ServerCertificateCustomValidationCallback = (httpRequestMessage, cert, cetChain, policyErrors) => true;
|
||||
|
||||
@@ -342,6 +342,8 @@ namespace Flax.Build.Projects.VisualStudioCode
|
||||
|
||||
json.BeginArray("args");
|
||||
{
|
||||
if (configuration.Platform == TargetPlatform.Linux || configuration.Platform == TargetPlatform.Mac)
|
||||
json.AddUnnamedField("-std");
|
||||
json.AddUnnamedField("-project");
|
||||
json.AddUnnamedField(buildToolWorkspace);
|
||||
json.AddUnnamedField("-skipCompile");
|
||||
@@ -395,6 +397,8 @@ namespace Flax.Build.Projects.VisualStudioCode
|
||||
json.AddField("program", Path.Combine(Globals.EngineRoot, "Binaries", "Editor", editorFolder, configuration.ConfigurationName, "FlaxEditor"));
|
||||
json.BeginArray("args");
|
||||
{
|
||||
if (configuration.Platform == TargetPlatform.Linux || configuration.Platform == TargetPlatform.Mac)
|
||||
json.AddUnnamedField("-std");
|
||||
json.AddUnnamedField("-project");
|
||||
json.AddUnnamedField(buildToolWorkspace);
|
||||
json.AddUnnamedField("-skipCompile");
|
||||
|
||||
Reference in New Issue
Block a user