Skip to content

Commit

Permalink
Merge pull request #1 from ChrisThrasher/cmake
Browse files Browse the repository at this point in the history
Add CMake build
  • Loading branch information
Kofybrek authored Jul 19, 2021
2 parents 2621dd7 + 065e926 commit 937ec24
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 9 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
build
18 changes: 18 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
cmake_minimum_required(VERSION 3.16)
project(tetris CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

find_package(SFML 2.5 REQUIRED COMPONENTS graphics window)

add_executable(tetris
Source/DrawText.cpp
Source/GetTetromino.cpp
Source/GetWallKickData.cpp
Source/Main.cpp
Source/Tetromino.cpp)
target_include_directories(tetris PRIVATE Source/Headers)
target_link_libraries(tetris PRIVATE sfml-graphics sfml-window)
install(TARGETS tetris)
2 changes: 1 addition & 1 deletion Source/Draw text.cpp → Source/DrawText.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <SFML/Graphics.hpp>

#include "Headers/Draw text.hpp"
#include "Headers/DrawText.hpp"

void draw_text(unsigned short i_x, unsigned short i_y, const std::string& i_text, sf::RenderWindow& i_window)
{
Expand Down
2 changes: 1 addition & 1 deletion Source/Get tetromino.cpp → Source/GetTetromino.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <vector>

#include "Headers/Global.hpp"
#include "Headers/Get tetromino.hpp"
#include "Headers/GetTetromino.hpp"

std::vector<Position> get_tetromino(unsigned char i_shape, unsigned char i_x, unsigned char i_y)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <vector>

#include "Headers/Global.hpp"
#include "Headers/Get wall kick data.hpp"
#include "Headers/GetWallKickData.hpp"

std::vector<Position> get_wall_kick_data(bool i_is_i_shape, unsigned char i_current_rotation, unsigned char i_next_rotation)
{
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions Source/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
#include <random>
#include <SFML/Graphics.hpp>

#include "Headers/Draw text.hpp"
#include "Headers/DrawText.hpp"
#include "Headers/Global.hpp"
#include "Headers/Get tetromino.hpp"
#include "Headers/Get wall kick data.hpp"
#include "Headers/GetTetromino.hpp"
#include "Headers/GetWallKickData.hpp"
#include "Headers/Tetromino.hpp"

int main()
Expand Down
6 changes: 3 additions & 3 deletions Source/Tetromino.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#include <vector>

#include "Headers/Global.hpp"
#include "Headers/Get tetromino.hpp"
#include "Headers/Get wall kick data.hpp"
#include "Headers/GetTetromino.hpp"
#include "Headers/GetWallKickData.hpp"
#include "Headers/Tetromino.hpp"

Tetromino::Tetromino(unsigned char i_shape, const std::vector<std::vector<unsigned char>>& i_matrix) :
Expand All @@ -26,7 +26,7 @@ Tetromino::Tetromino(unsigned char i_shape, const std::vector<std::vector<unsign
some bacteria like Escherichia coli can I can't believe you're still reading this. Get a life! divide every 20 minutes.
This means that in just seven hours one bacterium can generate 2, 097, 152 bacteria.
After one more hour the number of bacteria will have risen to a colossal 16, 777, 216.
Thats why we can quickly become ill when pathogenic microbes invade our bodies.
That's why we can quickly become ill when pathogenic microbes invade our bodies.
*/
}

Expand Down

0 comments on commit 937ec24

Please sign in to comment.