Skip to content

Commit

Permalink
fix: 屏蔽test和sample的未使用变量warning (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
windsgo authored Mar 24, 2024
1 parent 21376c9 commit 6fd4208
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ if (BUILD_SAMPLE)
)
add_executable(sample ${sample_src})
target_link_libraries(sample meojson)
if(NOT (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" OR CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC"))
target_compile_options(sample PRIVATE -Wno-unused-variable -Wno-unused-but-set-variable)
endif()

source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${json_headers})
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${sample_src})
Expand All @@ -50,6 +53,9 @@ if (BUILD_TESTING)
)
add_executable(testing ${testing_src})
target_link_libraries(testing meojson)
if(NOT (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" OR CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC"))
target_compile_options(testing PRIVATE -Wno-unused-variable -Wno-unused-but-set-variable)
endif()

source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${json_headers})
source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR} FILES ${testing_src})
Expand Down

0 comments on commit 6fd4208

Please sign in to comment.