Conditionally build cpp for platform, remove obsolete header

LTO-timing^2
ζeh Matt 2 years ago
parent 3d5f898920
commit 03302a8f5b
No known key found for this signature in database
GPG Key ID: 18CE582C71A225B0

@ -337,11 +337,22 @@ add_component_dir(navmeshtool
add_component_dir(platform
platform
file.posix
file
)
if (WIN32)
add_component_dir(platform
file.win32
)
elseif (UNIX)
add_component_dir(platform
file.posix
)
else ()
add_component_dir(platform
file.stdio
file
)
endif()
set (ESM_UI ${CMAKE_SOURCE_DIR}/files/ui/contentselector.ui
)

@ -1,8 +1,5 @@
#include "platform.internal.hpp"
#include "file.hpp"
#if PLATFORM_TYPE == PLATFORM_TYPE_POSIX
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>
@ -100,5 +97,3 @@ namespace Platform::File {
}
}
#endif

@ -1,8 +1,5 @@
#include "platform.internal.hpp"
#include "file.hpp"
#if PLATFORM_TYPE == PLATFORM_TYPE_STDIO
#include <errno.h>
#include <string.h>
#include <string>
@ -89,5 +86,3 @@ namespace Platform::File {
}
}
#endif

@ -1,8 +1,5 @@
#include "platform.internal.hpp"
#include "file.hpp"
#if PLATFORM_TYPE == PLATFORM_TYPE_WIN32
#include <components/windows.hpp>
#include <string>
#include <stdexcept>
@ -97,5 +94,3 @@ namespace Platform::File {
return bytesRead;
}
}
#endif

@ -1,19 +0,0 @@
#ifndef COMPONENT_PLATFORM_FILE_HPP
#define COMPONENT_PLATFORM_FILE_HPP
namespace Platform
{
#define PLATFORM_TYPE_STDIO 0
#define PLATFORM_TYPE_WIN32 1
#define PLATFORM_TYPE_POSIX 2
#if defined(__linux) || defined(__unix) || defined(__posix)
#define PLATFORM_TYPE PLATFORM_TYPE_POSIX
#elif defined(_WIN32)
#define PLATFORM_TYPE PLATFORM_TYPE_WIN32
#else
#define PLATFORM_TYPE PLATFORM_TYPE_STDIO
#endif
}
#endif
Loading…
Cancel
Save