Removed src directory

This commit is contained in:
Andreas Tsouchlos 2022-02-13 17:29:55 +01:00
parent 55ff861f67
commit 50635a8e2f
3 changed files with 25 additions and 42 deletions

View File

@ -1,29 +0,0 @@
cmake_minimum_required(VERSION 3.21)
project(logger)
set(CMAKE_CXX_STANDARD 20)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
include_directories(.)
add_executable(logger src/main.cpp)
if(MSVC)
target_compile_options(logger PRIVATE /W4 /WX)
else()
target_compile_options(logger PRIVATE -O3 -Wall -Wextra -pedantic -fno-exceptions)
endif()
option(PACKAGE_TESTS "Build the tests" ON)
if(PACKAGE_TESTS)
enable_testing()
include(GoogleTest)
add_subdirectory(test)
endif()

View File

@ -1,13 +0,0 @@
#include <const_fmt/Logger.h>
int main(int argc, char* argv[]) {
auto formatted = "Test: {:12} {:012.5} {:8}"_fmt(argv[0], 123.45, -1234567);
for (const auto& c : formatted)
std::cout << c;
std::cout << std::endl;
// return formatted[6];
return 0;
}

View File

@ -1,3 +1,21 @@
cmake_minimum_required(VERSION 3.21)
project(logger)
set(CMAKE_CXX_STANDARD 20)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release)
endif()
include_directories(..)
enable_testing()
include(GoogleTest)
add_subdirectory("googletest")
mark_as_advanced(
@ -14,8 +32,15 @@ macro(package_add_test TESTNAME)
PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY "${PROJECT_DIR}"
)
set_target_properties(${TESTNAME} PROPERTIES FOLDER tests)
if(MSVC)
target_compile_options(${TESTNAME} PRIVATE /W4 /WX)
else()
target_compile_options(${TESTNAME} PRIVATE -O3 -Wall -Wextra -pedantic -fno-exceptions)
endif()
endmacro()
package_add_test(utility_test src/utility.cpp)
package_add_test(parse_test src/parse.cpp)
package_add_test(format_test src/format.cpp)