CMake: Only link executables to enabled libraries
This commit is contained in:
@@ -99,6 +99,9 @@ endif()
|
||||
|
||||
wx_add_test(test_base ${TEST_SRC})
|
||||
target_compile_definitions(test_base PRIVATE wxUSE_GUI=0 wxUSE_BASE=1)
|
||||
if(wxUSE_SOCKETS)
|
||||
wx_exe_link_libraries(test_base net)
|
||||
endif()
|
||||
if(wxUSE_XML)
|
||||
wx_exe_link_libraries(test_base xml)
|
||||
endif()
|
||||
|
@@ -22,6 +22,9 @@ set(TEST_DRAWING_SRC
|
||||
drawing/fonttest.cpp
|
||||
)
|
||||
wx_add_test(test_drawing ${TEST_DRAWING_SRC})
|
||||
if(wxUSE_SOCKETS)
|
||||
wx_exe_link_libraries(test_drawing net)
|
||||
endif()
|
||||
wx_exe_link_libraries(test_drawing core)
|
||||
wx_test_enable_precomp(test_drawing)
|
||||
|
||||
|
@@ -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)
|
||||
|
Reference in New Issue
Block a user