build: enforce C++17 and add gpt example

This commit is contained in:
2026-10-30 17:01:51 +01:00
parent 2702167244
commit 513413515e
3 changed files with 41 additions and 1 deletions
+21 -1
View File
@@ -2,7 +2,8 @@ cmake_minimum_required(VERSION 3.14)
project(cenet CXX)
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_library(cenet INTERFACE
include/cenet/mat.hpp
@@ -20,3 +21,22 @@ target_link_libraries(mnist PRIVATE cenet)
add_executable(tokenizer example/tokenizer.cpp)
target_link_libraries(tokenizer PRIVATE cenet)
add_executable(gpt example/gpt.cpp)
target_link_libraries(gpt PRIVATE cenet)
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
)
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
enable_testing()
add_executable(math_test test/tensor.cpp)
target_link_libraries(math_test GTest::gtest_main cenet)
include(GoogleTest)
gtest_discover_tests(math_test)