aboutsummaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorNicolas James <Eele1Ephe7uZahRie@tutanota.com>2025-04-13 20:42:31 +1000
committerNicolas James <Eele1Ephe7uZahRie@tutanota.com>2025-04-13 20:42:31 +1000
commit12ad6ebd615f57b7b1032953ab9ea9b29ca1bc87 (patch)
tree76e8ad4bb3d8d322e2bd3ba260e0a5de1c7f5ea9 /src/CMakeLists.txt
parent4d026618caf38124ed87fafe578798be37c127ed (diff)
Add ability to write userspace tests, update cmake build process
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000..27d5504
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,37 @@
+cmake_minimum_required(VERSION 3.14)
+
+project(test_fastmouse)
+
+set(CMAKE_CXX_STANDARD 20)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+set(CMAKE_CXX_EXTENSIONS OFF)
+cmake_policy(SET CMP0135 NEW)
+
+include(FetchContent)
+FetchContent_Declare(
+ googletest
+ URL https://github.com/google/googletest/archive/refs/tags/v1.16.0.zip
+)
+
+FetchContent_MakeAvailable(googletest)
+
+file (GLOB SOURCE_FILES CONFIGURE_DEPENDS
+ "*.cc"
+)
+add_executable(${PROJECT_NAME}
+ ${SOURCE_FILES}
+)
+
+target_compile_options(${PROJECT_NAME} PRIVATE
+ -Wall -Wextra -Wshadow -Wdouble-promotion -Wformat=2 -Wundef -fno-common
+ -Wconversion -Wpedantic -std=c++20 -O2
+ -Wno-exceptions
+ -Wno-missing-field-initializers -Wno-unknown-pragmas
+)
+target_link_libraries(${PROJECT_NAME} PRIVATE
+ GTest::gtest_main
+)
+
+enable_testing()
+include(GoogleTest)
+gtest_discover_tests(test_fastmouse)