diff --git a/.gitignore b/.gitignore index 8ce11a1..f5e2724 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,6 @@ /.vscode /.devcontainer /.github +/.cache /build /.clang-format diff --git a/CMakeLists.txt b/CMakeLists.txt index 796c46f..f0adf5f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,11 +4,23 @@ include(CTest) set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g -fsanitize=address -fsanitize=undefined -fsanitize=leak") +option(TEST_BPT_ONLY "Only build BPT tests" ON) include(FetchContent) FetchContent_Declare( googletest - URL https://github.com/google/googletest/archive/refs/tags/v1.14.0.zip + URL_HASH SHA256=1f357c27ca988c3f7c6b4bf68a9395005ac6761f034046e9dde0896e3aba00e4 + URL ${CMAKE_SOURCE_DIR}/deps/googletest-v1.14.0-mirror.zip ) FetchContent_MakeAvailable(googletest) include(GoogleTest) -enable_testing() \ No newline at end of file +FetchContent_Declare( + argparse + URL_HASH SHA256=674e724c2702f0bfef1619161815257a407e1babce30d908327729fba6ce4124 + URL ${CMAKE_SOURCE_DIR}/deps/argparse-v3.0-mirror.zip +) +FetchContent_MakeAvailable(argparse) +include_directories(${CMAKE_SOURCE_DIR}/include) +include_directories(${CMAKE_SOURCE_DIR}/bpt/include) +include_directories(${CMAKE_SOURCE_DIR}/stlite) +enable_testing() +add_subdirectory(test) \ No newline at end of file diff --git a/deps/argparse-v3.0-mirror.zip b/deps/argparse-v3.0-mirror.zip new file mode 100644 index 0000000..9079baf Binary files /dev/null and b/deps/argparse-v3.0-mirror.zip differ diff --git a/deps/googletest-v1.14.0-mirror.zip b/deps/googletest-v1.14.0-mirror.zip new file mode 100644 index 0000000..1b1f703 Binary files /dev/null and b/deps/googletest-v1.14.0-mirror.zip differ diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..e69de29 diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 0000000..930ffaf --- /dev/null +++ b/test/CMakeLists.txt @@ -0,0 +1,8 @@ +if(TEST_BPT_ONLY) + add_executable(code oj_test_interface_for_bpt.cpp) + target_link_libraries(code argparse) + set_target_properties(code PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) +else() + add_executable(oj_test_interface_for_bpt oj_test_interface_for_bpt.cpp) + target_link_libraries(oj_test_interface_for_bpt argparse) +endif() \ No newline at end of file diff --git a/test/oj_test_interface_for_bpt.cpp b/test/oj_test_interface_for_bpt.cpp new file mode 100644 index 0000000..662973d --- /dev/null +++ b/test/oj_test_interface_for_bpt.cpp @@ -0,0 +1,5 @@ +#include +int main() +{ + return 0; +} \ No newline at end of file