Refactor BinaryTable file handling to use C-style file operations and improve memory management
This commit is contained in:
@@ -1,24 +1,20 @@
|
||||
cmake_minimum_required(VERSION 3.16)
|
||||
project(BinaryTable)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 20)
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
# Add the binary table library
|
||||
# Core Binary Table Library
|
||||
add_library(binary_table
|
||||
binary_table.h
|
||||
binary_table.cpp
|
||||
)
|
||||
|
||||
# Main executable
|
||||
# Main Application
|
||||
add_executable(main main.cpp)
|
||||
target_link_libraries(main binary_table)
|
||||
|
||||
# Test executable
|
||||
add_executable(test test.cpp)
|
||||
target_link_libraries(test binary_table)
|
||||
|
||||
# Debug executables
|
||||
# Debug Test Executables
|
||||
add_executable(debug_multi_key debug/debug_multi_key.cpp)
|
||||
target_link_libraries(debug_multi_key binary_table)
|
||||
|
||||
@@ -34,16 +30,17 @@ target_link_libraries(debug_step_by_step binary_table)
|
||||
add_executable(debug_simple debug/debug_simple.cpp)
|
||||
target_link_libraries(debug_simple binary_table)
|
||||
|
||||
# Enable compiler warnings
|
||||
# Compiler Settings
|
||||
if(MSVC)
|
||||
target_compile_options(binary_table PRIVATE /W4)
|
||||
target_compile_options(main PRIVATE /W4)
|
||||
else()
|
||||
target_compile_options(binary_table PRIVATE -Wall -Wextra -pedantic)
|
||||
target_compile_options(main PRIVATE -Wall -Wextra -pedantic)
|
||||
# Apply warnings to debug executables too
|
||||
target_compile_options(debug_multi_key PRIVATE -Wall -Wextra -pedantic)
|
||||
target_compile_options(debug_alloc PRIVATE -Wall -Wextra -pedantic)
|
||||
target_compile_options(debug_address_table PRIVATE -Wall -Wextra -pedantic)
|
||||
target_compile_options(debug_step_by_step PRIVATE -Wall -Wextra -pedantic)
|
||||
target_compile_options(debug_simple PRIVATE -Wall -Wextra -pedantic)
|
||||
endif()
|
||||
add_executable(debug_detailed debug_detailed.cpp)
|
||||
target_link_libraries(debug_detailed binary_table)
|
||||
|
||||
add_executable(debug_simple_fixed debug_simple_fixed.cpp)
|
||||
target_link_libraries(debug_simple_fixed binary_table)
|
||||
|
||||
Reference in New Issue
Block a user