Fastbuild all work for static linking
Need : Dll for game and lib to do hot reload Need : static for release only Way to compile only julietapp only shader app, only juliet.dll and game.dll
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
#include <type_traits>
|
||||
|
||||
// Add any new fields into the concept below
|
||||
#define DECLARE_ENTITY(entity) \
|
||||
#define DECLARE_ENTITY() \
|
||||
Entity* Base; \
|
||||
static const Juliet::Class* Kind;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace Game
|
||||
return Manager;
|
||||
}
|
||||
|
||||
void RegisterEntity(EntityManager& manager, Entity* entity)
|
||||
void RegisterEntity(EntityManager& /*manager*/, Entity* entity)
|
||||
{
|
||||
entity->ID = EntityManager::ID++;
|
||||
}
|
||||
|
||||
51
Game/Game.bff
Normal file
51
Game/Game.bff
Normal file
@@ -0,0 +1,51 @@
|
||||
// Juliet - Lib
|
||||
//------------------------------------------------------------------------------
|
||||
{
|
||||
.ProjectName = 'Game'
|
||||
.ProjectPath = 'Game'
|
||||
.JulietIncludePath = ' "-IJuliet/include"'
|
||||
|
||||
// Library
|
||||
//--------------------------------------------------------------------------
|
||||
.ProjectConfigs = {}
|
||||
ForEach( .BuildConfig in .BuildConfigs )
|
||||
{
|
||||
Using( .BuildConfig )
|
||||
.OutputBase + '\$Platform$-$BuildConfigName$'
|
||||
|
||||
// Unity
|
||||
//--------------------------------------------------------------------------
|
||||
Unity( '$ProjectName$-Unity-$Platform$-$BuildConfigName$' )
|
||||
{
|
||||
.UnityInputPath = '$ProjectPath$/'
|
||||
.UnityOutputPath = '$OutputBase$/$ProjectPath$/'
|
||||
.UnityOutputPattern = '$ProjectName$_Unity*.cpp'
|
||||
}
|
||||
|
||||
// Library
|
||||
//--------------------------------------------------------------------------
|
||||
ObjectList( '$ProjectName$-Lib-$Platform$-$BuildConfigName$' )
|
||||
{
|
||||
// Input (Unity)
|
||||
.CompilerInputUnity = '$ProjectName$-Unity-$Platform$-$BuildConfigName$'
|
||||
|
||||
// Extra Compiler Options
|
||||
.CompilerOptions + .JulietIncludePath
|
||||
+ ' "-IGame"'
|
||||
|
||||
#if __WINDOWS__
|
||||
.CompilerOptions + ' -DJULIET_WIN32'
|
||||
#endif
|
||||
|
||||
// Output
|
||||
.CompilerOutputPath = '$OutputBase$/$ProjectPath$/'
|
||||
}
|
||||
Alias( '$ProjectName$-$Platform$-$BuildConfigName$' ) { .Targets = '$ProjectName$-Lib-$Platform$-$BuildConfigName$' }
|
||||
^'Targets_$Platform$_$BuildConfigName$' + { '$ProjectName$-$Platform$-$BuildConfigName$' }
|
||||
|
||||
#if __WINDOWS__
|
||||
.ProjectConfig = [ Using( .'Project_$Platform$_$BuildConfigName$' ) .Target = '$ProjectName$-$Platform$-$BuildConfigName$' ]
|
||||
^ProjectConfigs + .ProjectConfig
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
#include <cstdio>
|
||||
#include <windows.h> // TODO: remove because our dll should not be platform dependant
|
||||
#include <Windows.h> // TODO: remove because our dll should not be platform dependant
|
||||
#undef min
|
||||
#undef max
|
||||
|
||||
@@ -42,7 +42,7 @@ extern "C" __declspec(dllexport) void __cdecl GameInit()
|
||||
door->IsOpened = true;
|
||||
|
||||
Entity* ent = door->Base;
|
||||
Door* stillDoor = DownCast<Door>(ent);
|
||||
[[maybe_unused]] Door* stillDoor = DownCast<Door>(ent);
|
||||
Assert(door == stillDoor);
|
||||
|
||||
Rock* rock = MakeEntity<Rock>(manager, 1.f, 2.f);
|
||||
@@ -64,7 +64,7 @@ extern "C" __declspec(dllexport) void __cdecl GameShutdown()
|
||||
printf("Shutting down game...\n");
|
||||
}
|
||||
|
||||
extern "C" __declspec(dllexport) void __cdecl GameUpdate(float deltaTime)
|
||||
extern "C" __declspec(dllexport) void __cdecl GameUpdate([[maybe_unused]] float deltaTime)
|
||||
{
|
||||
//printf("Updating game...\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user