# ------------------------------------------------------------ # # -------------- DO NOT TOUCH BELOW THIS LINE ---------------- # # ------------------------------------------------------------ # # this must be the first line of a CMake script. # sets the lowerbound on what CMake version can be used. cmake_minimum_required(VERSION 3.0) # the name of this CMake project and what language it uses # we could list more languages if we were using more. project(COMP6771_LAB_001 LANGUAGES CXX) # we use C++20 set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED YES) set(CMAKE_CXX_EXTENSIONS NO) # this is helpful for editors like VS Code set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # helpful compiler flags for gcc/clang # the descriptions for these flags can be found on the GNU Compiler Collection's webpage. add_compile_options( -Wall -Wextra -Werror -pedantic-errors -Wconversion -Wsign-conversion -Wdouble-promotion -Wcast-align -Wformat=2 -Wuninitialized -Wnull-dereference -Wnon-virtual-dtor -Woverloaded-virtual -Wdeprecated-copy-dtor -Wold-style-cast -Wzero-as-null-pointer-constant -Wsuggest-override -fstack-protector-strong ) # debug builds should be compiled with sanitizers # sanitizers are small libraries that check things like buffer overrun with minimal runtime overhead. set(CMAKE_CXX_FLAGS_DEBUG_INIT "-fsanitize=address,undefined") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-fsanitize=address,undefined") set(CMAKE_CXX_EXE_LINKER_FLAGS_DEBUG_INIT "-fsanitize=address,undefined") set(CMAKE_CXX_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "-fsanitize=address,undefined") # add the testing library Catch2 enable_testing() add_library(catch2_main lib/catch2_main.cpp) target_include_directories(catch2_main PUBLIC lib) # link the library so that other programs can get it link_libraries(catch2_main) # ------------------------------------------------------------ # # -------------- DO NOT MODIFY ABOVE THIS LINE --------------- # # ------------------------------------------------------------ # add_subdirectory(1.1) add_subdirectory(1.2) add_subdirectory(2.1) add_subdirectory(2.2) add_subdirectory(2.3) add_subdirectory(3.1) add_subdirectory(4.1) add_subdirectory(4.2) add_subdirectory(5.1) add_subdirectory(5.2) add_subdirectory(5.3) add_subdirectory(7.1) add_subdirectory(8.1) add_subdirectory(9.1)