Fix libportal include path and glib include path on Ubuntu 22

This commit is contained in:
Wojtek Figat
2026-03-06 20:04:34 +01:00
parent 28257296b9
commit b291cd93c3
3 changed files with 14 additions and 14 deletions

View File

@@ -3178,7 +3178,7 @@ Array<LinuxPlatform::StackFrame> LinuxPlatform::GetStackFrames(int32 skipCount,
#include "Engine/Platform/Linux/IncludeX11.h"
#if PLATFORM_SDL
#include <libportal/portal-enums.h>
#include <portal-enums.h>
#include <libportal/screenshot.h>
namespace PortalImpl

View File

@@ -26,19 +26,20 @@ public class libportal : EngineDepsModule
var depsRoot = options.DepsFolder;
switch (options.Platform.Target)
{
case TargetPlatform.Linux:
options.OutputFiles.Add(Path.Combine(depsRoot, "libportal.a"));
options.PublicIncludePaths.Add("/usr/include/glib-2.0");
options.PublicIncludePaths.Add("/usr/lib/glib-2.0/include");
//options.SourceFiles.Add(Path.Combine(FolderPath, "portal-enums.c"));
options.SourceFiles.AddRange(Directory.GetFiles(FolderPath, "*.c", SearchOption.TopDirectoryOnly));
break;
default: throw new InvalidPlatformException(options.Platform.Target);
case TargetPlatform.Linux:
options.OutputFiles.Add(Path.Combine(depsRoot, "libportal.a"));
options.PublicIncludePaths.Add("/usr/include/glib-2.0");
options.PublicIncludePaths.Add("/usr/lib/glib-2.0/include");
if (options.Architecture == TargetArchitecture.x64)
options.PublicIncludePaths.Add("/usr/lib/x86_64-linux-gnu/glib-2.0/include");
//options.SourceFiles.Add(Path.Combine(FolderPath, "portal-enums.c"));
options.SourceFiles.AddRange(Directory.GetFiles(FolderPath, "*.c", SearchOption.TopDirectoryOnly));
break;
default: throw new InvalidPlatformException(options.Platform.Target);
}
options.PublicIncludePaths.Add(Path.Combine(Globals.EngineRoot, @"Source\ThirdParty\libportal\include"));
options.PublicIncludePaths.Add(Path.Combine(Globals.EngineRoot, @"Source/ThirdParty/libportal/include"));
}
}

View File

@@ -1,6 +1,5 @@
// Copyright (c) Wojciech Figat. All rights reserved.
using System.Collections.Generic;
using System.IO;
using Flax.Build;