Add basic project hierarchy and build config
This commit is contained in:
@@ -1,44 +1,64 @@
|
||||
# Copyright (c) 2025, Jayden Grubb <contact@jaydengrubb.com>
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON CACHE INTERNAL "")
|
||||
|
||||
project(Example)
|
||||
project(nova)
|
||||
enable_language(CXX)
|
||||
set(CMAKE_CXX_STANDARD 23)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
||||
add_compile_options(
|
||||
/W4
|
||||
/permissive-
|
||||
/EHsc
|
||||
)
|
||||
add_compile_definitions(
|
||||
NOVA_COMPILER_MSVC
|
||||
)
|
||||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||
add_compile_options(
|
||||
-Wall
|
||||
-Wextra
|
||||
-Wpedantic
|
||||
-Wshadow
|
||||
-Wold-style-cast
|
||||
)
|
||||
|
||||
add_executable(
|
||||
${PROJECT_NAME}
|
||||
src/main.cpp
|
||||
if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
add_compile_definitions(
|
||||
NOVA_COMPILER_GCC
|
||||
)
|
||||
|
||||
# find_package(Example REQUIRED)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/include
|
||||
# ${Example_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
target_link_libraries(
|
||||
${PROJECT_NAME}
|
||||
# ${Example_LIBRARIES}
|
||||
)
|
||||
|
||||
if (CMAKE_IMPORT_LIBRARY_SUFFIX)
|
||||
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_RUNTIME_DLLS:${PROJECT_NAME}> $<TARGET_FILE_DIR:${PROJECT_NAME}>
|
||||
COMMAND_EXPAND_LISTS
|
||||
else()
|
||||
add_compile_definitions(
|
||||
NOVA_COMPILER_CLANG
|
||||
)
|
||||
endif()
|
||||
else()
|
||||
error("Unsupported compiler")
|
||||
endif()
|
||||
|
||||
add_custom_target(run
|
||||
COMMAND ${PROJECT_NAME}
|
||||
DEPENDS ${PROJECT_NAME}
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
if (WIN32)
|
||||
add_compile_definitions(
|
||||
NOVA_PLATFORM_WINDOWS
|
||||
NOMINMAX
|
||||
WIN32_LEAN_AND_MEAN
|
||||
_CRT_SECURE_NO_WARNINGS
|
||||
_CRT_NONSTDC_NO_WARNINGS
|
||||
)
|
||||
elseif (APPLE)
|
||||
add_compile_definitions(
|
||||
NOVA_PLATFORM_MACOS
|
||||
)
|
||||
elseif (UNIX)
|
||||
add_compile_definitions(
|
||||
NOVA_PLATFORM_LINUX
|
||||
)
|
||||
else()
|
||||
error("Unsupported platform")
|
||||
endif()
|
||||
|
||||
add_subdirectory(engine)
|
||||
add_subdirectory(editor)
|
||||
|
||||
29
LICENSE.txt
Normal file
29
LICENSE.txt
Normal file
@@ -0,0 +1,29 @@
|
||||
BSD 3-Clause License
|
||||
|
||||
Copyright (c) 2025, Jayden Grubb
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its
|
||||
contributors may be used to endorse or promote products derived from
|
||||
this software without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
0
docs/.gitkeep
Normal file
0
docs/.gitkeep
Normal file
2
editor/CMakeLists.txt
Normal file
2
editor/CMakeLists.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
# Copyright (c) 2025, Jayden Grubb <contact@jaydengrubb.com>
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
0
editor/include/nova/editor/.gitkeep
Normal file
0
editor/include/nova/editor/.gitkeep
Normal file
7
editor/src/main.cpp
Normal file
7
editor/src/main.cpp
Normal file
@@ -0,0 +1,7 @@
|
||||
#include <cstdlib>
|
||||
#include <print>
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
std::print("Hello, World!\n");
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
2
engine/CMakeLists.txt
Normal file
2
engine/CMakeLists.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
# Copyright (c) 2025, Jayden Grubb <contact@jaydengrubb.com>
|
||||
# SPDX-License-Identifier: BSD-3-Clause
|
||||
0
engine/include/nova/audio/.gitkeep
Normal file
0
engine/include/nova/audio/.gitkeep
Normal file
0
engine/include/nova/core/.gitkeep
Normal file
0
engine/include/nova/core/.gitkeep
Normal file
0
engine/include/nova/ecs/.gitkeep
Normal file
0
engine/include/nova/ecs/.gitkeep
Normal file
0
engine/include/nova/graphics/.gitkeep
Normal file
0
engine/include/nova/graphics/.gitkeep
Normal file
0
engine/include/nova/math/.gitkeep
Normal file
0
engine/include/nova/math/.gitkeep
Normal file
0
engine/include/nova/networking/.gitkeep
Normal file
0
engine/include/nova/networking/.gitkeep
Normal file
0
engine/include/nova/physics/.gitkeep
Normal file
0
engine/include/nova/physics/.gitkeep
Normal file
0
engine/include/nova/platform/.gitkeep
Normal file
0
engine/include/nova/platform/.gitkeep
Normal file
0
engine/include/nova/utils/.gitkeep
Normal file
0
engine/include/nova/utils/.gitkeep
Normal file
0
engine/src/core/.gitkeep
Normal file
0
engine/src/core/.gitkeep
Normal file
12
src/main.cpp
12
src/main.cpp
@@ -1,12 +0,0 @@
|
||||
#include <cstdlib>
|
||||
#include <print>
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
std::println("Hello, World!");
|
||||
|
||||
for (int i = 0; i < argc; i++) {
|
||||
std::println("argv[{}] = {}", i, argv[i]);
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
0
templates/.gitkeep
Normal file
0
templates/.gitkeep
Normal file
0
tests/.gitkeep
Normal file
0
tests/.gitkeep
Normal file
Reference in New Issue
Block a user