-
Notifications
You must be signed in to change notification settings - Fork 379
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update build scripts to use vcpkg and add vcx files
- Loading branch information
Showing
403 changed files
with
6,793 additions
and
64,849 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
Language: Cpp | ||
BasedOnStyle: LLVM | ||
IndentWidth: 4 | ||
|
||
BreakBeforeBraces: Stroustrup | ||
FixNamespaceComments: true | ||
IndentCaseLabels: true | ||
NamespaceIndentation: None | ||
|
||
BreakConstructorInitializersBeforeComma: true | ||
|
||
AllowShortFunctionsOnASingleLine: None | ||
|
||
ColumnLimit: 80 | ||
Language: Cpp | ||
BasedOnStyle: LLVM | ||
IndentWidth: 4 | ||
BreakBeforeBraces: Allman | ||
FixNamespaceComments: true | ||
IndentCaseLabels: true | ||
NamespaceIndentation: All | ||
BreakConstructorInitializersBeforeComma: true | ||
ColumnLimit: 100 | ||
AlwaysBreakTemplateDeclarations: true | ||
PointerAlignment: Left | ||
AllowShortFunctionsOnASingleLine: None | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,24 @@ | ||
#Visual Studio | ||
Debug/ | ||
Release/ | ||
*.sln | ||
*.vcxproj | ||
*.filters | ||
*.users | ||
*.user | ||
*.dll | ||
.vs | ||
|
||
# Visual Studio Code | ||
.vscode/ | ||
|
||
|
||
# Builds | ||
bin/ | ||
Makefile | ||
build/ | ||
|
||
# Manually Added | ||
CMakeFiles/ | ||
cmake_install.cmake | ||
CMakeCache.txt | ||
mc-one-week | ||
libglad.a | ||
development_notes.txt | ||
# Linux | ||
build/ | ||
|
||
# Windows | ||
*.dll | ||
*.exe | ||
*.filters | ||
*.user | ||
*.vs | ||
.vscode | ||
Debug/ | ||
Release/ | ||
|
||
# Misc | ||
*.zip | ||
*.temp | ||
*.srctrlprj | ||
*.srctrldb | ||
*.srctrlbm | ||
|
||
# Vcpkg | ||
vcpkg_installed/ | ||
|
||
mc-one-week-challenge/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,124 +1,100 @@ | ||
cmake_minimum_required(VERSION 3.10) | ||
|
||
#Set up project | ||
project(mc-one-week VERSION 1.0) | ||
|
||
configure_file(config.txt ${CMAKE_BINARY_DIR}/config.txt COPYONLY) | ||
|
||
# Copy the resource files to the new binary dir | ||
add_custom_target(copy_resources ALL | ||
COMMAND ${CMAKE_COMMAND} -E copy_directory | ||
${PROJECT_SOURCE_DIR}/Res | ||
${PROJECT_BINARY_DIR}/Res | ||
COMMENT "Copying game resources into Res folder") | ||
|
||
|
||
add_custom_target(copy_shaders ALL | ||
COMMAND ${CMAKE_COMMAND} -E copy_directory | ||
${PROJECT_SOURCE_DIR}/Shaders | ||
${PROJECT_BINARY_DIR}/Shaders | ||
COMMENT "Copying shaders into Shaders folder") | ||
|
||
#Set executable | ||
add_executable(mc-one-week | ||
Source/Item/Material.cpp | ||
Source/Item/ItemStack.cpp | ||
Source/Application.cpp | ||
Source/World/Event/PlayerDigEvent.cpp | ||
Source/World/Block/BlockDatabase.cpp | ||
Source/World/Block/BlockData.cpp | ||
Source/World/Block/ChunkBlock.cpp | ||
Source/World/Block/BlockTypes/BlockType.cpp | ||
Source/World/World.cpp | ||
Source/World/Generation/Biome/LightForest.cpp | ||
Source/World/Generation/Biome/Biome.cpp | ||
Source/World/Generation/Biome/DesertBiome.cpp | ||
Source/World/Generation/Biome/GrasslandBiome.cpp | ||
Source/World/Generation/Biome/TemperateForestBiome.cpp | ||
Source/World/Generation/Biome/OceanBiome.cpp | ||
Source/World/Generation/Structures/TreeGenerator.cpp | ||
Source/World/Generation/Structures/StructureBuilder.cpp | ||
Source/World/Generation/Terrain/SuperFlatGenerator.cpp | ||
Source/World/Generation/Terrain/ClassicOverWorldGenerator.cpp | ||
Source/World/Chunk/ChunkMesh.cpp | ||
Source/World/Chunk/ChunkManager.cpp | ||
Source/World/Chunk/Chunk.cpp | ||
Source/World/Chunk/ChunkSection.cpp | ||
Source/World/Chunk/ChunkMeshBuilder.cpp | ||
Source/States/PlayState.cpp | ||
Source/Player/Player.cpp | ||
Source/Maths/Ray.cpp | ||
Source/Maths/Frustum.cpp | ||
Source/Maths/NoiseGenerator.cpp | ||
Source/Maths/Vector2XZ.cpp | ||
Source/Maths/Matrix.cpp | ||
Source/Maths/GeneralMaths.cpp | ||
Source/Camera.cpp | ||
Source/GL/GLFunctions.cpp | ||
Source/Context.cpp | ||
Source/Texture/CubeTexture.cpp | ||
Source/Texture/BasicTexture.cpp | ||
Source/Texture/TextureAtlas.cpp | ||
Source/Input/ToggleKey.cpp | ||
Source/Input/Keyboard.cpp | ||
Source/Main.cpp | ||
Source/Controller.cpp | ||
Source/Util/Random.cpp | ||
Source/Util/FPSCounter.cpp | ||
Source/Util/FileUtil.cpp | ||
Source/Shaders/FloraShader.cpp | ||
Source/Shaders/WaterShader.cpp | ||
Source/Shaders/SkyboxShader.cpp | ||
Source/Shaders/Shader.cpp | ||
Source/Shaders/ChunkShader.cpp | ||
Source/Shaders/BasicShader.cpp | ||
Source/Shaders/ShaderLoader.cpp | ||
Source/Renderer/RenderMaster.cpp | ||
Source/Renderer/WaterRenderer.cpp | ||
Source/Renderer/ChunkRenderer.cpp | ||
Source/Renderer/SkyboxRenderer.cpp | ||
Source/Renderer/FloraRenderer.cpp | ||
Source/Model.cpp | ||
) | ||
|
||
#Set module path | ||
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules" ${CMAKE_MODULE_PATH}) | ||
|
||
#Find libraries | ||
find_package(Threads) | ||
find_package(SFML REQUIRED audio network graphics window system) | ||
|
||
add_subdirectory(deps/glm) | ||
add_subdirectory(deps/glad) | ||
|
||
function(setup_target TARGET) | ||
#Set C++17 | ||
target_compile_features(${TARGET} PUBLIC cxx_std_17) | ||
set_target_properties(${TARGET} PROPERTIES CXX_EXTENSIONS OFF) | ||
|
||
#Set flags | ||
if(MSVC) | ||
target_compile_options(${TARGET} PRIVATE | ||
/W4 /WX) | ||
else() | ||
target_compile_options(${TARGET} PRIVATE | ||
-Wall -Wextra -pedantic) | ||
endif() | ||
|
||
target_include_directories( | ||
${TARGET} | ||
PRIVATE | ||
deps | ||
) | ||
endfunction(setup_target) | ||
|
||
setup_target(mc-one-week) | ||
|
||
target_link_libraries(mc-one-week | ||
glm | ||
glad | ||
Threads::Threads | ||
${SFML_LIBRARIES} | ||
${SFML_DEPENDENCIES} | ||
${CMAKE_DL_LIBS} | ||
) | ||
cmake_minimum_required(VERSION 3.10) | ||
|
||
project( | ||
mc-one-week-challenge | ||
VERSION 1.0 | ||
) | ||
|
||
include("$ENV{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake") | ||
|
||
add_executable(${PROJECT_NAME} | ||
Source/Item/Material.cpp | ||
Source/Item/ItemStack.cpp | ||
Source/Application.cpp | ||
Source/World/Event/PlayerDigEvent.cpp | ||
Source/World/Block/BlockDatabase.cpp | ||
Source/World/Block/BlockData.cpp | ||
Source/World/Block/ChunkBlock.cpp | ||
Source/World/Block/BlockTypes/BlockType.cpp | ||
Source/World/World.cpp | ||
Source/World/Generation/Biome/LightForest.cpp | ||
Source/World/Generation/Biome/Biome.cpp | ||
Source/World/Generation/Biome/DesertBiome.cpp | ||
Source/World/Generation/Biome/GrasslandBiome.cpp | ||
Source/World/Generation/Biome/TemperateForestBiome.cpp | ||
Source/World/Generation/Biome/OceanBiome.cpp | ||
Source/World/Generation/Structures/TreeGenerator.cpp | ||
Source/World/Generation/Structures/StructureBuilder.cpp | ||
Source/World/Generation/Terrain/SuperFlatGenerator.cpp | ||
Source/World/Generation/Terrain/ClassicOverWorldGenerator.cpp | ||
Source/World/Chunk/ChunkMesh.cpp | ||
Source/World/Chunk/ChunkManager.cpp | ||
Source/World/Chunk/Chunk.cpp | ||
Source/World/Chunk/ChunkSection.cpp | ||
Source/World/Chunk/ChunkMeshBuilder.cpp | ||
Source/States/PlayState.cpp | ||
Source/Player/Player.cpp | ||
Source/Maths/Ray.cpp | ||
Source/Maths/Frustum.cpp | ||
Source/Maths/NoiseGenerator.cpp | ||
Source/Maths/Vector2XZ.cpp | ||
Source/Maths/Matrix.cpp | ||
Source/Maths/GeneralMaths.cpp | ||
Source/Camera.cpp | ||
Source/GL/GLFunctions.cpp | ||
Source/Context.cpp | ||
Source/Texture/CubeTexture.cpp | ||
Source/Texture/BasicTexture.cpp | ||
Source/Texture/TextureAtlas.cpp | ||
Source/Input/ToggleKey.cpp | ||
Source/Input/Keyboard.cpp | ||
Source/Main.cpp | ||
Source/Controller.cpp | ||
Source/Util/Random.cpp | ||
Source/Util/FPSCounter.cpp | ||
Source/Util/FileUtil.cpp | ||
Source/Shaders/FloraShader.cpp | ||
Source/Shaders/WaterShader.cpp | ||
Source/Shaders/SkyboxShader.cpp | ||
Source/Shaders/Shader.cpp | ||
Source/Shaders/ChunkShader.cpp | ||
Source/Shaders/BasicShader.cpp | ||
Source/Shaders/ShaderLoader.cpp | ||
Source/Renderer/RenderMaster.cpp | ||
Source/Renderer/WaterRenderer.cpp | ||
Source/Renderer/ChunkRenderer.cpp | ||
Source/Renderer/SkyboxRenderer.cpp | ||
Source/Renderer/FloraRenderer.cpp | ||
Source/Model.cpp | ||
) | ||
|
||
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_23) | ||
set_target_properties(${PROJECT_NAME} PROPERTIES CXX_EXTENSIONS OFF) | ||
|
||
target_compile_definitions(${PROJECT_NAME} PRIVATE GLM_ENABLE_EXPERIMENTAL) | ||
|
||
if(MSVC) | ||
set(CMAKE_CXX_FLAGS_RELEASE "/O2") | ||
set(CMAKE_CXX_FLAGS_RELEASE "/Ox") | ||
target_compile_options(${PROJECT_NAME} PRIVATE | ||
/W4) | ||
else() | ||
target_compile_options(${PROJECT_NAME} PRIVATE | ||
-Wall -Wextra -pedantic) | ||
endif() | ||
|
||
find_package(glm CONFIG REQUIRED) | ||
find_package(SFML COMPONENTS system audio network window graphics CONFIG REQUIRED) | ||
|
||
add_subdirectory(deps) | ||
target_include_directories( | ||
${PROJECT_NAME} | ||
PRIVATE | ||
deps | ||
) | ||
|
||
target_link_libraries(${PROJECT_NAME} PRIVATE | ||
sfml-system sfml-audio sfml-network sfml-graphics sfml-window | ||
glm::glm | ||
glad | ||
) |
Oops, something went wrong.