diff options
author | Keuin <[email protected]> | 2022-04-11 10:07:48 +0800 |
---|---|---|
committer | Keuin <[email protected]> | 2022-04-11 10:07:48 +0800 |
commit | 00bfec66319e3e53a3b51d1d1ffbc899633f29a2 (patch) | |
tree | 6f2d2a6bf962a9b6d376847b03387d81723e7675 /CMakeLists.txt |
Basic 3d vector operations. Testing with GoogleTest.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000..a5c54e5 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,32 @@ +cmake_minimum_required(VERSION 3.0) +project(rt) + +set(CMAKE_CXX_STANDARD 11) +set(CMAKE_CXX_STANDARD_REQUIRED True) + +set(common_compiler_args "-Wall -Werror -Wno-unused -std=c++11 -pthread") +set(CMAKE_CXX_FLAGS_DEBUG "${common_compiler_args} -g -ggdb -fsanitize=address") +set(CMAKE_CXX_FLAGS_RELEASE "${common_compiler_args} -O2") + +set(CMAKE_VERBOSE_MAKEFILE on) + +# main executable + +add_executable(rt main.cpp vec.h) + +# googletest + +add_executable(all_tests test.cpp) + +target_link_libraries(all_tests gtest_main) +include(FetchContent) +FetchContent_Declare( + googletest + URL https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip +) + +FetchContent_MakeAvailable(googletest) + +include(GoogleTest) + +gtest_discover_tests(all_tests)
\ No newline at end of file |