Skip to content

Commit

Permalink
Reworked CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
Zang3th committed Apr 22, 2024
1 parent e0fe0c9 commit ae6a038
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Apps/Liquefied/LiquefiedApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ namespace Liq

void LiquefiedApp::VisualizeSmoke()
{
float* smokeField = _fluidSimulator->GetSmokeField();
//float* smokeField = _fluidSimulator->GetSmokeField();

//Iterate over smoke field

Expand Down
36 changes: 33 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,41 @@
############################### Project-Setup ###############################

cmake_minimum_required(VERSION 3.16)
cmake_minimum_required(VERSION 3.20)

set(SALINITYGL_ENGINE_VERSION "0.3.0")
set(SALINITYGL_ENGINE_VERSION_SUFFIX "alpha")
add_compile_definitions(SALINITYGL_ENGINE_VERSION="${SALINITYGL_ENGINE_VERSION}")
add_compile_definitions(SALINITYGL_ENGINE_VERSION_SUFFIX="${SALINITYGL_ENGINE_VERSION_SUFFIX}")
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(CMAKE_BUILD_TYPE "Debug")
set(CMAKE_CXX_FLAGS "-Wall -Wextra -Wpedantic -Wno-unused-parameter --std=c++17 -g")
project(SalinityGL)

project(SalinityGL
VERSION "${SALINITYGL_ENGINE_VERSION}"
LANGUAGES CXX
DESCRIPTION "OpenGL baselayer library in C++"
)

add_compile_options(
-Waddress
-Wformat-nonliteral
-Wformat-security
-Wformat
-Winit-self
-Wmissing-include-dirs
-Wno-multichar
-Wno-parentheses
-Wno-type-limits
-Wno-unused-parameter
-Wunreachable-code
-Wwrite-strings
-Wpointer-arith
-Werror
-Wall
-Wextra
-Wpedantic
-g
)

############################### Settings ####################################

Expand Down
19 changes: 15 additions & 4 deletions Engine/Core/Window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,19 @@ namespace Engine
glfwWindowHint(GLFW_MAXIMIZED, GLFW_FALSE);
glfwWindowHint(GLFW_DOUBLEBUFFER, GLFW_TRUE);

//Create window
//Create window title
_windowName = title;

#ifdef SALINITYGL_ENGINE_VERSION
std::string versionString = SALINITYGL_ENGINE_VERSION;
#ifdef SALINITYGL_ENGINE_VERSION_SUFFIX
versionString += "-";
versionString += SALINITYGL_ENGINE_VERSION_SUFFIX;
#endif
_windowName += " (" + versionString + ")";
#endif

//Create window
_window = glfwCreateWindow(WindowParams::WIDTH, WindowParams::HEIGHT, _windowName.c_str(), nullptr, nullptr);

if(!_window)
Expand All @@ -47,9 +58,9 @@ namespace Engine
}

//Log version
std::string rendererString(reinterpret_cast<const char*>(glGetString(GL_RENDERER)));
std::string versionString(reinterpret_cast<const char*>(glGetString(GL_VERSION)));
Logger::Info("Loaded", "OpenGL", std::string(rendererString + ", " + versionString));
std::string gpuString(reinterpret_cast<const char*>(glGetString(GL_RENDERER)));
std::string driverString(reinterpret_cast<const char*>(glGetString(GL_VERSION)));
Logger::Info("Loaded", "OpenGL", std::string(gpuString + ", " + driverString));

GLRenderSettings::SetViewport(WindowParams::WIDTH, WindowParams::HEIGHT);
GLRenderSettings::EnableDebugging();
Expand Down

0 comments on commit ae6a038

Please sign in to comment.