CPM added and directory structure changed

Switch to using CPM package manager instead of vcpkg as its just a wrapper around cmake and makes things more simple.

Switch dependency from spdlog to fmt.

Changed the directory structure to match the setup recommended by GitLab
This commit is contained in:
McMassiveNZ
2023-05-28 20:42:15 +02:00
parent ea2f1c08b7
commit 0e7f06cdd2
14 changed files with 61 additions and 55 deletions

20
cmake/sanitizers.cmake Normal file
View File

@@ -0,0 +1,20 @@
include_guard()
function( target_enable_sanitizers _target )
if( MSVC )
string(FIND "$ENV{PATH}" "$ENV{VSINSTALLDIR}" index_of_vs_install_dir)
if("${index_of_vs_install_dir}" STREQUAL "-1")
message(
SEND_ERROR
"Using MSVC sanitizers requires setting the MSVC environment before building the project. Please manually open the MSVC command prompt and rebuild the project."
)
endif()
target_compile_options(${_target} PUBLIC /fsanitize=address /Zi /INCREMENTAL:NO)
target_link_options(${_target} PUBLIC /INCREMENTAL:NO)
else()
target_compile_options(${_target} INTERFACE -fsanitize=address,leak,undefined)
target_link_options(${_target} INTERFACE -fsanitize=address,leak,undefined)
endif()
endfunction()