mirror of
https://github.com/reactos/CMake.git
synced 2025-02-13 08:06:16 +00:00
Autogen: Tests: Add test for STATIC_LIBRARY cycles
This commit is contained in:
parent
798e4f2fad
commit
3a4db8617e
@ -213,6 +213,10 @@ add_subdirectory(objectLibrary)
|
||||
# Source files with the same basename in different subdirectories
|
||||
add_subdirectory(sameName)
|
||||
|
||||
# -- Test
|
||||
# Tests static library cycles
|
||||
add_subdirectory(staticLibraryCycle)
|
||||
|
||||
# -- Test
|
||||
# Complex test case
|
||||
add_subdirectory(complex)
|
||||
|
17
Tests/QtAutogen/staticLibraryCycle/CMakeLists.txt
Normal file
17
Tests/QtAutogen/staticLibraryCycle/CMakeLists.txt
Normal file
@ -0,0 +1,17 @@
|
||||
# Test AUTOMOC and AUTORCC on source files with the same name
|
||||
# but in different subdirectories
|
||||
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
|
||||
# Cyclic static libraries
|
||||
add_library(slc_a STATIC a.cpp)
|
||||
target_link_libraries(slc_a ${QT_LIBRARIES} slc_b)
|
||||
|
||||
add_library(slc_b STATIC b.cpp)
|
||||
target_link_libraries(slc_b ${QT_LIBRARIES} slc_c)
|
||||
|
||||
add_library(slc_c STATIC c.cpp)
|
||||
target_link_libraries(slc_c ${QT_LIBRARIES} slc_a)
|
||||
|
||||
add_executable(slc main.cpp)
|
||||
target_link_libraries(slc ${QT_LIBRARIES} slc_a)
|
7
Tests/QtAutogen/staticLibraryCycle/a.cpp
Normal file
7
Tests/QtAutogen/staticLibraryCycle/a.cpp
Normal file
@ -0,0 +1,7 @@
|
||||
#include "a.h"
|
||||
#include "b.h"
|
||||
|
||||
A::A()
|
||||
{
|
||||
B b;
|
||||
}
|
13
Tests/QtAutogen/staticLibraryCycle/a.h
Normal file
13
Tests/QtAutogen/staticLibraryCycle/a.h
Normal file
@ -0,0 +1,13 @@
|
||||
#ifndef CLASSA_HPP
|
||||
#define CLASSA_HPP
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class A : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
A();
|
||||
};
|
||||
|
||||
#endif
|
7
Tests/QtAutogen/staticLibraryCycle/b.cpp
Normal file
7
Tests/QtAutogen/staticLibraryCycle/b.cpp
Normal file
@ -0,0 +1,7 @@
|
||||
#include "b.h"
|
||||
#include "c.h"
|
||||
|
||||
B::B()
|
||||
{
|
||||
C c;
|
||||
}
|
13
Tests/QtAutogen/staticLibraryCycle/b.h
Normal file
13
Tests/QtAutogen/staticLibraryCycle/b.h
Normal file
@ -0,0 +1,13 @@
|
||||
#ifndef CLASSB_HPP
|
||||
#define CLASSB_HPP
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class B : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
B();
|
||||
};
|
||||
|
||||
#endif
|
7
Tests/QtAutogen/staticLibraryCycle/c.cpp
Normal file
7
Tests/QtAutogen/staticLibraryCycle/c.cpp
Normal file
@ -0,0 +1,7 @@
|
||||
#include "c.h"
|
||||
#include "a.h"
|
||||
|
||||
C::C()
|
||||
{
|
||||
A a;
|
||||
}
|
13
Tests/QtAutogen/staticLibraryCycle/c.h
Normal file
13
Tests/QtAutogen/staticLibraryCycle/c.h
Normal file
@ -0,0 +1,13 @@
|
||||
#ifndef CLASSC_HPP
|
||||
#define CLASSC_HPP
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class C : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
C();
|
||||
};
|
||||
|
||||
#endif
|
8
Tests/QtAutogen/staticLibraryCycle/main.cpp
Normal file
8
Tests/QtAutogen/staticLibraryCycle/main.cpp
Normal file
@ -0,0 +1,8 @@
|
||||
#include "a.h"
|
||||
|
||||
int main(int argv, char** args)
|
||||
{
|
||||
// Object instances
|
||||
A a;
|
||||
return 0;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user