2022-10-14 15:26:51 -04:00
|
|
|
cmake_minimum_required(VERSION 3.23)
|
|
|
|
project(Step_2)
|
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 20)
|
|
|
|
|
2022-10-19 19:08:22 -04:00
|
|
|
# used to debug memory related issues
|
2022-10-18 23:11:51 -04:00
|
|
|
if (UNIX AND (CMAKE_BUILD_TYPE MATCHES Debug))
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address -g")
|
|
|
|
add_compile_options(-fsanitize=address)
|
|
|
|
add_link_options(-fsanitize=address)
|
|
|
|
endif()
|
2022-10-17 00:29:34 -04:00
|
|
|
|
2022-10-19 19:08:22 -04:00
|
|
|
# enables AVX instructions. if you have issues, try disabling this.
|
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=native")
|
|
|
|
|
2022-10-14 15:26:51 -04:00
|
|
|
#Setup project source compilation
|
|
|
|
set(source_dir "${PROJECT_SOURCE_DIR}/src/")
|
|
|
|
file(GLOB_RECURSE source_files "${source_dir}/*.cpp")
|
|
|
|
file(GLOB_RECURSE source_c_files "${source_dir}/*.c")
|
|
|
|
|
|
|
|
#Setup project header files
|
|
|
|
include_directories(${PROJECT_SOURCE_DIR}/include)
|
|
|
|
|
|
|
|
add_executable(${PROJECT_NAME} ${source_files} ${source_c_files})
|