Sane C++ Libraries
C++ Platform Abstraction Libraries
SC::PluginCompiler Struct Reference

Compiles a plugin to a dynamic library. More...

#include <Plugin.h>

Public Types

enum class  Type {
  ClangCompiler ,
  GnuCompiler ,
  MicrosoftCompiler
}
 Compiler type (clang/gcc/msvc) More...
 

Public Member Functions

Result compile (const PluginDefinition &definition, const PluginSysroot &sysroot, const PluginCompilerEnvironment &environment, String &compilerLog) const
 Compiles a Definition to an object file. More...
 
Result link (const PluginDefinition &definition, const PluginSysroot &sysroot, const PluginCompilerEnvironment &environment, StringView executablePath, String &linkerLog) const
 Links a Definition into a dynamic library, with symbols from executablePath More...
 

Static Public Member Functions

static Result findBestCompiler (PluginCompiler &compiler)
 Look for best compiler on current system. More...
 

Public Attributes

Type type = Type::ClangCompiler
 Compile Type. More...
 
StringNative< 256 > compilerPath = StringEncoding::Native
 Path to the compiler. More...
 
StringNative< 256 > linkerPath = StringEncoding::Native
 Path to the linker. More...
 
SmallVector< StringNative< 256 >, 8 > includePaths
 Path to include directories used to compile plugin. More...
 
SmallVector< StringNative< 256 >, 8 > compilerIncludePaths
 Path to compiler include directories. More...
 
SmallVector< StringNative< 256 >, 8 > compilerLibraryPaths
 Path to compiler library directories. More...
 

Detailed Description

Compiles a plugin to a dynamic library.

Member Enumeration Documentation

◆ Type

enum class SC::PluginCompiler::Type
strong

Compiler type (clang/gcc/msvc)

Member Function Documentation

◆ compile()

Result SC::PluginCompiler::compile ( const PluginDefinition definition,
const PluginSysroot sysroot,
const PluginCompilerEnvironment environment,
String compilerLog 
) const

Compiles a Definition to an object file.

Parameters
definitionA valid Definition parsed by Definition::parse
sysrootA sysroot used (if requested) holding include / library paths to libc/libc++
environmentAn environment used to populate CFLAGS and LDFLAGS from environment variables
compilerLogIf provided, will receive the log output produced by the compiler
Returns
Valid result if all files of given definition can be compiled to valid object files

◆ findBestCompiler()

static Result SC::PluginCompiler::findBestCompiler ( PluginCompiler compiler)
static

Look for best compiler on current system.

Parameters
[out]compilerBest compiler found
Returns
Valid Result if best compiler has been found

◆ link()

Result SC::PluginCompiler::link ( const PluginDefinition definition,
const PluginSysroot sysroot,
const PluginCompilerEnvironment environment,
StringView  executablePath,
String linkerLog 
) const

Links a Definition into a dynamic library, with symbols from executablePath

Parameters
definitionA valid Definition already compiled with PluginCompiler::compile
sysrootA sysroot used (if requested) holding include / library paths to libc/libc++
environmentAn environment used to populate CFLAGS and LDFLAGS from environment variables
executablePathPath to the executable loading the given plugin, exposing symbols used by Plugin
linkerLogIf provided, will receive the log output produced by the linker
Returns
Valid result if the Definition can be compiled to a dynamic library linking executablePath

Member Data Documentation

◆ compilerIncludePaths

SmallVector<StringNative<256>, 8> SC::PluginCompiler::compilerIncludePaths

Path to compiler include directories.

◆ compilerLibraryPaths

SmallVector<StringNative<256>, 8> SC::PluginCompiler::compilerLibraryPaths

Path to compiler library directories.

◆ compilerPath

StringNative<256> SC::PluginCompiler::compilerPath = StringEncoding::Native

Path to the compiler.

◆ includePaths

SmallVector<StringNative<256>, 8> SC::PluginCompiler::includePaths

Path to include directories used to compile plugin.

◆ linkerPath

StringNative<256> SC::PluginCompiler::linkerPath = StringEncoding::Native

Path to the linker.

◆ type

Type SC::PluginCompiler::type = Type::ClangCompiler

Compile Type.


The documentation for this struct was generated from the following file: