Add support for building engine target as shared library on all platforms
This commit is contained in:
@@ -281,6 +281,10 @@ bool MCore::LoadEngine()
|
||||
flaxLibraryPath = ::String(StringUtils::GetDirectoryName(Platform::GetExecutableFilePath())) / StringUtils::GetFileName(flaxLibraryPath);
|
||||
}
|
||||
#endif
|
||||
if (!FileSystem::FileExists(flaxLibraryPath))
|
||||
{
|
||||
LOG(Error, "Flax Engine native library file is missing ({0})", flaxLibraryPath);
|
||||
}
|
||||
RegisterNativeLibrary("FlaxEngine", flaxLibraryPath.Get());
|
||||
|
||||
MRootDomain = New<MDomain>("Root");
|
||||
|
||||
@@ -43,7 +43,7 @@ public class Scripting : EngineModule
|
||||
if (options.Target is EngineTarget engineTarget && engineTarget.UseSeparateMainExecutable(options))
|
||||
{
|
||||
// Build target doesn't support linking again main executable (eg. Linux) thus additional shared library is used for the engine (eg. libFlaxEditor.so)
|
||||
var fileName = options.Platform.GetLinkOutputFileName(engineTarget.OutputName, LinkerOutput.SharedLibrary);
|
||||
var fileName = options.Platform.GetLinkOutputFileName(EngineTarget.LibraryName, LinkerOutput.SharedLibrary);
|
||||
options.CompileEnv.PreprocessorDefinitions.Add("MCORE_MAIN_MODULE_NAME=" + fileName);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user