Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,17 @@ if(NOT DEFINED CPPJIEBA_TOP_LEVEL_PROJECT)
endif()
endif()

add_library(cppjieba INTERFACE)
target_include_directories(cppjieba INTERFACE
${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/deps/limonp/include
)
Comment on lines +24 to +28
Copy link

Copilot AI Jul 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider checking if the cppjieba target already exists before creating it to avoid potential conflicts when this CMakeLists.txt is included multiple times. You can use if(NOT TARGET cppjieba) to guard the library creation.

Suggested change
add_library(cppjieba INTERFACE)
target_include_directories(cppjieba INTERFACE
${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/deps/limonp/include
)
if(NOT TARGET cppjieba)
add_library(cppjieba INTERFACE)
target_include_directories(cppjieba INTERFACE
${PROJECT_SOURCE_DIR}/include
${PROJECT_SOURCE_DIR}/deps/limonp/include
)
endif()

Copilot uses AI. Check for mistakes.

if(CPPJIEBA_TOP_LEVEL_PROJECT)
ENABLE_TESTING()

message(STATUS "MSVC value: ${MSVC}")
ADD_SUBDIRECTORY(test)
ADD_TEST(NAME ./test/test.run COMMAND ./test/test.run)
ADD_TEST(NAME ./load_test COMMAND ./load_test)
endif()
endif()
Loading