Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Build

on:
push:
branches: [ "main", "master", "develop" ]
pull_request:
branches: [ "main", "master" ]

jobs:
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup Premake5
run: |
Invoke-WebRequest -Uri "https://github.com/premake/premake-core/releases/download/v5.0.0-beta2/premake-5.0.0-beta2-windows.zip" -OutFile "premake5.zip"
Expand-Archive -Path premake5.zip -DestinationPath .
shell: pwsh

- name: Generate project files
run: ./premake5.exe vs2022

- name: Build Debug
run: msbuild ARC-Engine.sln /p:Configuration=Debug /p:Platform=x64 /m

- name: Build Release
run: msbuild ARC-Engine.sln /p:Configuration=Release /p:Platform=x64 /m

build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y -qq \
build-essential \
libgl1-mesa-dev \
libglu1-mesa-dev \
libxrandr-dev \
libxinerama-dev \
libxcursor-dev \
libxi-dev \
libxext-dev \
libwayland-dev \
libxkbcommon-dev \
libdbus-1-dev

- name: Setup Premake5
run: |
wget -q "https://github.com/premake/premake-core/releases/download/v5.0.0-beta2/premake-5.0.0-beta2-linux.tar.gz" -O /tmp/premake5.tar.gz
sudo tar -xzf /tmp/premake5.tar.gz -C /usr/local/bin/ premake5
sudo chmod +x /usr/local/bin/premake5

- name: Generate makefiles
run: premake5 gmake2

- name: Build Tests
run: make Tests config=release -j$(nproc)

- name: Run Tests
run: ./_bin/Release-linux-x86_64/Tests/Tests
10 changes: 6 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,13 @@
.vs/
_bin/
_int/
**/logs/
**/logs/
Makefile*
*.make

#files
*.user

# Prerequisites
*.d

#visual studio
.vs/
**.sln
Expand Down Expand Up @@ -47,3 +46,6 @@ _int/
*.out
*.app
/Sandbox/logs/*.json

# Linux build artifacts
/obj/
7 changes: 4 additions & 3 deletions ARC-Editor/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ project "ARC-Editor"
filter "system:windows"
systemversion "latest"

defines
{
}
defines {}

filter "system:linux"
defines {}

filter "configurations:Debug"
defines "ARC_DEBUG"
Expand Down
38 changes: 34 additions & 4 deletions ARC-Engine/premake5.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,42 @@ project "ARC-Engine"
"out/entt/src/entt/**.hpp",
}

filter "system:windows"
files
{
"src/Platform/Windows/**.h",
"src/Platform/Windows/**.cpp",
}

filter "system:linux"
files
{
"src/Platform/Linux/**.h",
"src/Platform/Linux/**.cpp",
}

filter "files:out/ImGuizmo/**.cpp"
flags "NoPCH"

filter {}

links
{
"Box2D",
"GLFW",
"GLAD",
"ImGui",
"yaml-cpp",
"opengl32.lib"
}

filter "system:windows"
links { "opengl32.lib" }

filter "system:linux"
links { "GL", "dl", "pthread" }

filter {}

defines
{
"_CRT_SECURE_NO_WARNINGS",
Expand Down Expand Up @@ -60,16 +86,20 @@ project "ARC-Engine"
"%{IncludeDir.entt}"
}

filter "files:out/ImGuizmo/**.cpp"
flags "NoPCH"

filter "system:windows"
systemversion "latest"

defines
{
}

filter "system:linux"
defines
{
"GLFW_INCLUDE_NONE",
"YAML_CPP_STATIC_DEFINE"
}

filter "configurations:Debug"
defines "ARC_DEBUG"
runtime "Debug"
Expand Down
10 changes: 5 additions & 5 deletions ARC-Engine/src/ARC/Core/EntryPoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "Macros.h"
#include "ARC/Profiling/Timer.h"

#ifdef ARC_PLATFORM_WINDOWS
#if defined(ARC_PLATFORM_WINDOWS) || defined(ARC_PLATFORM_LINUX)

extern ARC::CApplication* ARC::CreateApplication();

Expand All @@ -15,7 +15,7 @@ int main(int p_ArgA, char** p_ArgB)
printf("Starting-ARC----\n");

//-------------------Log-Init-------------------//
ARC_PROFILE_BEGIN_SESSION("CSandBox2D::Log::Init", "logs/CSandBox2D-Log-Init.json");
ARC_PROFILE_BEGIN_SESSION("ARC::Log::Init", "logs/ARC-Log-Init.json");
printf("Initializing-Logger----\n");
bool bInitLogger = ARC::CLog::Init();
if(!bInitLogger)
Expand All @@ -26,23 +26,23 @@ int main(int p_ArgA, char** p_ArgB)
//-----------------Log-Init-End-----------------//

//--------------Create-Application--------------//
ARC_PROFILE_BEGIN_SESSION("CSandBox2D::Create::Application", "logs/CSandBox2D-Create-Application.json");
ARC_PROFILE_BEGIN_SESSION("ARC::Create::Application", "logs/ARC-Create-Application.json");
ARC_CORE_INFO("Creating-Application");
ARC::CApplication* App = ARC::CreateApplication();
ARC_CORE_INFO("Application:[{0}]-Created-Successfully", App->GetAppName());
ARC_PROFILE_END_SESSION();
//--------------Application-Created-------------//

//----------------RunLoop-Started---------------//
ARC_PROFILE_BEGIN_SESSION("CSandBox2D::RunLoop", "logs/CSandBox2D-RunLoop.json");
ARC_PROFILE_BEGIN_SESSION("ARC::RunLoop", "logs/ARC-RunLoop.json");
ARC_CORE_INFO("Run-Loop-Started");
App->Run();
ARC_CORE_INFO("Run-Loop-Ended");
ARC_PROFILE_END_SESSION();
//-----------------RunLoop-Ended----------------//

//-------------Application-Deleting-------------//
ARC_PROFILE_BEGIN_SESSION("CSandBox2D::End", "logs/CSandBox2D-End.json");
ARC_PROFILE_BEGIN_SESSION("ARC::End", "logs/ARC-End.json");
ARC_CORE_INFO("Destroying-Application-[]");
delete App;
ARC_CORE_INFO("Application-Destroyed-Successfully");
Expand Down
17 changes: 15 additions & 2 deletions ARC-Engine/src/ARC/Core/Macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,17 @@
#endif

#ifdef ARC_ENABLE_ASSERTS
#define ARC_ASSERT(x, ...) { if(!(x)) { ARC_ERROR("Assertion Failed: "__VA_ARGS__); __debugbreak(); } }
#define ARC_CORE_ASSERT(x, ...) { if(!(x)) { ARC_CORE_ERROR("Assertion Failed: "__VA_ARGS__); __debugbreak(); } }
#if defined(ARC_PLATFORM_WINDOWS)
#define ARC_DEBUGBREAK() __debugbreak()
#elif defined(ARC_PLATFORM_LINUX)
#include <signal.h>
#define ARC_DEBUGBREAK() raise(SIGTRAP)
#else
#define ARC_DEBUGBREAK() __builtin_trap()
#endif

#define ARC_ASSERT(x, ...) { if(!(x)) { ARC_ERROR("Assertion Failed: " __VA_ARGS__); ARC_DEBUGBREAK(); } }
#define ARC_CORE_ASSERT(x, ...) { if(!(x)) { ARC_CORE_ERROR("Assertion Failed: " __VA_ARGS__); ARC_DEBUGBREAK(); } }
#else
#define ARC_ASSERT(x, ...)
#define ARC_CORE_ASSERT(x, ...)
Expand All @@ -34,7 +43,11 @@
#define ARC_PROFILE
#ifdef ARC_PROFILE
#define ARC_PROFILE_SCOPE(name) ::ARC::CTimer COMBINE2(ARC_timer, __LINE__)(name, true, true)
#if defined(_MSC_VER)
#define ARC_PROFILE_FUNCTION() ARC_PROFILE_SCOPE(__FUNCSIG__)
#else
#define ARC_PROFILE_FUNCTION() ARC_PROFILE_SCOPE(__PRETTY_FUNCTION__)
#endif
#define ARC_PROFILE_BEGIN_SESSION(name, filepath) ::ARC::CInstrumentor::Get().BeginSession(name, filepath)
#define ARC_PROFILE_END_SESSION() ::ARC::CInstrumentor::Get().EndSession()
#else
Expand Down
18 changes: 8 additions & 10 deletions ARC-Engine/src/ARC/Core/PlatformDetection.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#pragma once

// Platform detection
#ifdef _WIN32
#ifdef _WIN64
#define ARC_PLATFORM_WINDOWS
Expand All @@ -7,18 +9,14 @@
#endif
#elif defined(__APPLE__) || defined(__MACH__)
#include <TargetConditionals.h>
/* TARGET_OS_MAC exists on all the platforms
* so we must check all of them (in this order)
* to ensure that we're running on MAC
* and not some other Apple platform */
#if TARGET_IPHONE_SIMULATOR == 1
#error "IOS simulator is not supported"
#error "iOS simulator is not supported"
#elif TARGET_OS_IPHONE == 1
#define ARC_PLATFORM_IOS
#error "IOS is not supported"
#error "iOS is not supported"
#elif TARGET_OS_MAC == 1
#define ARC_PLATFORM_MACOS
#error "MacOS is not supported"
#error "macOS is not supported"
#else
#error "Unknown Apple platform"
#endif
Expand All @@ -27,13 +25,13 @@
#error "Android is not supported"
#elif defined(__linux__)
#define ARC_PLATFORM_LINUX
#error "Linux is not supported"
#else
#error "Unknown platform"
#endif

// DLL export/import macros (Windows) or empty (Linux/Mac)
#ifdef ARC_PLATFORM_WINDOWS
#ifdef ARC_DYNAIMC_LINK
#ifdef ARC_DYNAMIC_LINK
#ifdef ARC_BUILD_DLL
#define ARC_API __declspec(dllexport)
#else
Expand All @@ -43,5 +41,5 @@
#define ARC_API
#endif
#else
#error ARC only supports Windows
#define ARC_API
#endif
Loading