mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibCore: Implement System::current_executable_path on Windows
This commit is contained in:
parent
ddcd48d12e
commit
10db20a537
Notes:
github-actions[bot]
2025-03-20 02:26:42 +00:00
Author: https://github.com/stasoid
Commit: 10db20a537
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3002
Reviewed-by: https://github.com/ADKaster ✅
Reviewed-by: https://github.com/AtkinsSJ
3 changed files with 11 additions and 3 deletions
|
@ -13,10 +13,13 @@ set(SOURCES
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
list(APPEND SOURCES
|
list(APPEND SOURCES
|
||||||
|
ProcessWindows.cpp
|
||||||
SocketpairWindows.cpp
|
SocketpairWindows.cpp
|
||||||
SystemWindows.cpp)
|
SystemWindows.cpp)
|
||||||
else()
|
else()
|
||||||
list(APPEND SOURCES System.cpp)
|
list(APPEND SOURCES
|
||||||
|
Process.cpp
|
||||||
|
System.cpp)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
serenity_lib(LibCoreMinimal coreminimal)
|
serenity_lib(LibCoreMinimal coreminimal)
|
||||||
|
@ -52,14 +55,12 @@ set(SOURCES
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
# FIXME: Support UDPServer and TCPServer on Windows
|
# FIXME: Support UDPServer and TCPServer on Windows
|
||||||
list(APPEND SOURCES
|
list(APPEND SOURCES
|
||||||
ProcessWindows.cpp
|
|
||||||
SocketWindows.cpp
|
SocketWindows.cpp
|
||||||
AnonymousBufferWindows.cpp
|
AnonymousBufferWindows.cpp
|
||||||
EventLoopImplementationWindows.cpp)
|
EventLoopImplementationWindows.cpp)
|
||||||
else()
|
else()
|
||||||
list(APPEND SOURCES
|
list(APPEND SOURCES
|
||||||
Command.cpp
|
Command.cpp
|
||||||
Process.cpp
|
|
||||||
Socket.cpp
|
Socket.cpp
|
||||||
AnonymousBuffer.cpp
|
AnonymousBuffer.cpp
|
||||||
EventLoopImplementationUnix.cpp
|
EventLoopImplementationUnix.cpp
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
#include <AK/ByteString.h>
|
#include <AK/ByteString.h>
|
||||||
#include <AK/Forward.h>
|
#include <AK/Forward.h>
|
||||||
|
#include <AK/String.h>
|
||||||
#include <LibCore/File.h>
|
#include <LibCore/File.h>
|
||||||
|
|
||||||
namespace Core {
|
namespace Core {
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
#include <AK/ByteString.h>
|
#include <AK/ByteString.h>
|
||||||
#include <AK/ScopeGuard.h>
|
#include <AK/ScopeGuard.h>
|
||||||
|
#include <LibCore/Process.h>
|
||||||
#include <LibCore/System.h>
|
#include <LibCore/System.h>
|
||||||
#include <direct.h>
|
#include <direct.h>
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
|
@ -263,4 +264,9 @@ u64 physical_memory_bytes()
|
||||||
return ms.ullTotalPhys;
|
return ms.ullTotalPhys;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ErrorOr<ByteString> current_executable_path()
|
||||||
|
{
|
||||||
|
return TRY(Process::get_name()).to_byte_string();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue