CMake: Only link executables to enabled libraries

This commit is contained in:
Maarten Bent
2018-01-20 00:55:43 +01:00
parent 76617ddb1e
commit fb8403a064
5 changed files with 34 additions and 3 deletions

View File

@@ -107,5 +107,27 @@ set(TEST_GUI_SRC
xml/xrctest.cpp
)
wx_add_test(test_gui ${TEST_GUI_SRC})
wx_exe_link_libraries(test_gui core richtext media xrc xml adv html net webview)
wx_exe_link_libraries(test_gui core)
if(wxUSE_RICHTEXT)
wx_exe_link_libraries(test_gui richtext)
endif()
if(wxUSE_MEDIACTRL)
wx_exe_link_libraries(test_gui media)
endif()
if(wxUSE_XRC)
wx_exe_link_libraries(test_gui xrc)
endif()
if(wxUSE_XML)
wx_exe_link_libraries(test_gui xml)
endif()
wx_exe_link_libraries(test_gui adv)
if(wxUSE_HTML)
wx_exe_link_libraries(test_gui html)
endif()
if(wxUSE_SOCKETS)
wx_exe_link_libraries(test_gui net)
endif()
if(wxUSE_WEBVIEW)
wx_exe_link_libraries(test_gui webview)
endif()
wx_test_enable_precomp(test_gui)