CMP0022: Add test for target_link_libraries plain signature

This commit is contained in:
Stephen Kelly 2013-10-30 13:21:53 +01:00 committed by Brad King
parent c0f4a61074
commit 0e06788c0a
6 changed files with 56 additions and 0 deletions

View File

@ -28,3 +28,10 @@ endif()
add_executable(staticlib_exe staticlib_exe.cpp)
target_link_libraries(staticlib_exe staticlib1)
add_library(onlyplainlib1 SHARED onlyplainlib1.cpp)
add_library(onlyplainlib2 SHARED onlyplainlib2.cpp)
target_link_libraries(onlyplainlib2 onlyplainlib1)
add_executable(onlyplainlib_user onlyplainlib_user.cpp)
target_link_libraries(onlyplainlib_user onlyplainlib2)

View File

@ -0,0 +1,13 @@
#include "onlyplainlib1.h"
OnlyPlainLib1::OnlyPlainLib1()
: result(0)
{
}
int OnlyPlainLib1::GetResult()
{
return result;
}

View File

@ -0,0 +1,14 @@
struct
#ifdef _WIN32
__declspec(dllexport)
#endif
OnlyPlainLib1
{
OnlyPlainLib1();
int GetResult();
private:
int result;
};

View File

@ -0,0 +1,8 @@
#include "onlyplainlib2.h"
OnlyPlainLib1 onlyPlainLib2()
{
OnlyPlainLib1 opl1;
return opl1;
}

View File

@ -0,0 +1,7 @@
#include "onlyplainlib1.h"
#ifdef _WIN32
__declspec(dllexport)
#endif
OnlyPlainLib1 onlyPlainLib2();

View File

@ -0,0 +1,7 @@
#include "onlyplainlib2.h"
int main(int argc, char **argv)
{
return onlyPlainLib2().GetResult();
}