QtAutogen: Add test for empty qrc file

This commit is contained in:
Sebastian Holtermann 2016-09-30 09:53:35 +02:00 committed by Brad King
parent 98b11f252c
commit bcafc399c5
3 changed files with 19 additions and 0 deletions

View File

@ -44,10 +44,16 @@ else()
endif() endif()
# -- RCC only
add_executable(rcconly rcconly.cpp second_resource.qrc) add_executable(rcconly rcconly.cpp second_resource.qrc)
set_property(TARGET rcconly PROPERTY AUTORCC ON) set_property(TARGET rcconly PROPERTY AUTORCC ON)
target_link_libraries(rcconly ${QT_QTCORE_TARGET}) target_link_libraries(rcconly ${QT_QTCORE_TARGET})
# -- RCC empty
add_executable(rcc_empty rcc_empty.cpp rcc_empty_resource.qrc)
set_property(TARGET rcc_empty PROPERTY AUTORCC ON)
target_link_libraries(rcc_empty ${QT_QTCORE_TARGET})
include_directories(${CMAKE_CURRENT_BINARY_DIR}) include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_definitions(-DFOO -DSomeDefine="Barx") add_definitions(-DFOO -DSomeDefine="Barx")

View File

@ -0,0 +1,9 @@
extern int qInitResources_rcc_empty_resource();
int main(int, char**)
{
// Fails to link if the symbol is not present.
qInitResources_rcc_empty_resource();
return 0;
}

View File

@ -0,0 +1,4 @@
<!DOCTYPE RCC><RCC version="1.0">
<qresource>
</qresource>
</RCC>