build: update .gitignore and CMakeLists for test configuration

- Added entries to .gitignore for temporary test files.
- Included a message to display MSVC value during build.
- Added UTF-8 compile option for MSVC in unittest CMakeLists.
This commit is contained in:
Yanyi Wu 2025-05-02 21:28:28 +08:00
parent 8141d8f434
commit b5dc8e7a35
3 changed files with 4 additions and 0 deletions

2
.gitignore vendored
View File

@ -15,3 +15,5 @@ tmp
t.*
*.pid
build
Testing/Temporary/CTestCostData.txt
Testing/Temporary/LastTest.log

View File

@ -31,6 +31,7 @@ option(CPPJIEBA_BUILD_TESTS "Build cppjieba tests" ${CPPJIEBA_TOP_LEVEL_PROJECT}
if(CPPJIEBA_BUILD_TESTS)
ENABLE_TESTING()
message(STATUS "MSVC value: ${MSVC}")
ADD_SUBDIRECTORY(test)
if(NOT MSVC)
ADD_TEST(NAME ./test/test.run COMMAND ./test/test.run)

View File

@ -1,6 +1,7 @@
if (MSVC)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreadedDebugDLL")
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
add_compile_options(/utf-8)
endif()
include(FetchContent)