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
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
project(modern_cpp)
cmake_minimum_required(VERSION 2.8)
aux_source_directory(. SRC_LIST)
include_directories(./includes)
add_definitions(-Wall -Wpedantic -Werror -Wextra)
add_executable(${PROJECT_NAME} ${SRC_LIST})
20 changes: 20 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
CXX= g++
CXXFLAGS= -std=c++17 -Wall -Wpedantic -Wextra
SOURCES= *.cpp
OBJECTS= $(SOURCES:.cpp=.o)
INCLUDES= includes/*.hpp
include_dirs= -Iincludes
all_target= debug release

.PHONY: all
all: $(all_target)

debug: $(SOURCES) $(INCLUDES)
$(CXX) $< $(CXXFLAGS) -g -o $@ $(include_dir)

release: $(SOURCES) $(INCLUDES)
$(CXX) $< $(CXXFLAGS) -O3 -o $@ $(include_dir)

.PHONY: clean
clean:
rm $(all_target)
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion Shape.hpp → includes/Shape.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class Shape
{
public:
virtual ~Shape() {}
virtual ~Shape() {};

virtual double getArea() const = 0;
virtual double getPerimeter() const = 0;
Expand Down
File renamed without changes.