Commit 0e06788c authored by Stephen Kelly's avatar Stephen Kelly Committed by Brad King
Browse files

CMP0022: Add test for target_link_libraries plain signature

parent c0f4a610
...@@ -28,3 +28,10 @@ endif() ...@@ -28,3 +28,10 @@ endif()
add_executable(staticlib_exe staticlib_exe.cpp) add_executable(staticlib_exe staticlib_exe.cpp)
target_link_libraries(staticlib_exe staticlib1) 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)
#include "onlyplainlib1.h"
OnlyPlainLib1::OnlyPlainLib1()
: result(0)
{
}
int OnlyPlainLib1::GetResult()
{
return result;
}
struct
#ifdef _WIN32
__declspec(dllexport)
#endif
OnlyPlainLib1
{
OnlyPlainLib1();
int GetResult();
private:
int result;
};
#include "onlyplainlib2.h"
OnlyPlainLib1 onlyPlainLib2()
{
OnlyPlainLib1 opl1;
return opl1;
}
#include "onlyplainlib1.h"
#ifdef _WIN32
__declspec(dllexport)
#endif
OnlyPlainLib1 onlyPlainLib2();
#include "onlyplainlib2.h"
int main(int argc, char **argv)
{
return onlyPlainLib2().GetResult();
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment