35 lines
792 B
C++
35 lines
792 B
C++
#include "target.h"
|
|
#include "tier1/commandline.h"
|
|
#include "tier1/utlstring.h"
|
|
|
|
Target_t Target_t::DefaultTarget()
|
|
{
|
|
CUtlString szDevice = ICommandLine::ParamValue("-device");
|
|
CUtlString szOS = ICommandLine::ParamValue("-os");
|
|
CUtlString szArch = ICommandLine::ParamValue("-arch");
|
|
|
|
ETargetKernel kernel =
|
|
#if defined(__linux__)
|
|
TARGET_KERNEL_LINUX
|
|
#elif defined(__APPLE__)
|
|
TARGET_KERNEL_DARWIN
|
|
#endif
|
|
;
|
|
ETargetCPU cpu = TARGET_CPU_AMD64;
|
|
|
|
if ( szOS == "windows" )
|
|
kernel = TARGET_KERNEL_WINDOWS;
|
|
else if ( szOS == "linux" )
|
|
kernel = TARGET_KERNEL_LINUX;
|
|
else if ( szOS == "macos" )
|
|
kernel = TARGET_KERNEL_DARWIN;
|
|
else if ( szOS != 0 )
|
|
V_printf("Unknown OS: %s\n", szOS.GetString());
|
|
|
|
return {
|
|
.kernel = kernel,
|
|
.cpu = cpu,
|
|
.optimization = TARGET_DEBUG,
|
|
};
|
|
}
|