diff --git a/Libraries/LibCore/CMakeLists.txt b/Libraries/LibCore/CMakeLists.txt index d35df5055cb..89ea1d7a4b6 100644 --- a/Libraries/LibCore/CMakeLists.txt +++ b/Libraries/LibCore/CMakeLists.txt @@ -13,10 +13,13 @@ set(SOURCES if (WIN32) list(APPEND SOURCES + ProcessWindows.cpp SocketpairWindows.cpp SystemWindows.cpp) else() - list(APPEND SOURCES System.cpp) + list(APPEND SOURCES + Process.cpp + System.cpp) endif() serenity_lib(LibCoreMinimal coreminimal) @@ -52,14 +55,12 @@ set(SOURCES if (WIN32) # FIXME: Support UDPServer and TCPServer on Windows list(APPEND SOURCES - ProcessWindows.cpp SocketWindows.cpp AnonymousBufferWindows.cpp EventLoopImplementationWindows.cpp) else() list(APPEND SOURCES Command.cpp - Process.cpp Socket.cpp AnonymousBuffer.cpp EventLoopImplementationUnix.cpp diff --git a/Libraries/LibCore/Process.h b/Libraries/LibCore/Process.h index 7ae9b571801..30f3cb8b93e 100644 --- a/Libraries/LibCore/Process.h +++ b/Libraries/LibCore/Process.h @@ -11,6 +11,7 @@ #include #include +#include #include namespace Core { diff --git a/Libraries/LibCore/SystemWindows.cpp b/Libraries/LibCore/SystemWindows.cpp index fec598601ef..f46508f7a37 100644 --- a/Libraries/LibCore/SystemWindows.cpp +++ b/Libraries/LibCore/SystemWindows.cpp @@ -11,6 +11,7 @@ #include #include +#include #include #include #include @@ -263,4 +264,9 @@ u64 physical_memory_bytes() return ms.ullTotalPhys; } +ErrorOr current_executable_path() +{ + return TRY(Process::get_name()).to_byte_string(); +} + }