Skip to content

Commit

Permalink
Fix unused variable warnings when building tests in plugin mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Wentzell committed Feb 22, 2024
1 parent 15d22fc commit 3dac2f1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ macro(c2py_add_test_1 modulename module_extension)
endmacro()

macro(c2py_add_test modulename)
c2py_add_test_1(${modulename} $<IF:$<TARGET_EXISTS:clair::c2py_plugin>,cpp,wrap.cxx>)
target_link_libraries(${modulename} PRIVATE $<TARGET_NAME_IF_EXISTS:clair::c2py_plugin>)
if(IS_CLAIR_BUILD)
c2py_add_test_1(${modulename} cpp)
target_link_libraries(${modulename} PRIVATE clair::c2py_plugin)
target_compile_options(${modulename} PRIVATE -Wno-unused-const-variable -Wno-unused-variable)
else()
c2py_add_test_1(${modulename} wrap.cxx)
endif()
endmacro()

#--------------------------------------------------------
Expand Down

0 comments on commit 3dac2f1

Please sign in to comment.