summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-11-02 10:54:15 -0400
committerCMake Topic Stage <kwrobot@kitware.com>2013-11-02 10:54:15 -0400
commit53ac9b8d86daeff15a446fe14a9ed3dd6981fa3e (patch)
tree6fcfa5569107cbb66c0542001f422fd24dcefd72
parent2043a86b6a25cfbd97a3d9cbbe3ccbf60d423276 (diff)
parent5a2fc3d69659717e530becddb3cbebb04583f4e9 (diff)
downloadcmake-53ac9b8d86daeff15a446fe14a9ed3dd6981fa3e.tar.gz
Merge topic 'object-library-missing-source'
5a2fc3d Check for OBJECT_LIBRARY source files at start of generation
-rw-r--r--Source/cmGlobalGenerator.cxx1
-rw-r--r--Tests/RunCMake/ObjectLibrary/MissingSource-result.txt1
-rw-r--r--Tests/RunCMake/ObjectLibrary/MissingSource-stderr.txt9
-rw-r--r--Tests/RunCMake/ObjectLibrary/MissingSource.cmake1
-rw-r--r--Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake1
5 files changed, 13 insertions, 0 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 8a8d61ac52..4fe5033b1d 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1242,6 +1242,7 @@ bool cmGlobalGenerator::CheckTargets()
target.GetType() == cmTarget::STATIC_LIBRARY ||
target.GetType() == cmTarget::SHARED_LIBRARY ||
target.GetType() == cmTarget::MODULE_LIBRARY ||
+ target.GetType() == cmTarget::OBJECT_LIBRARY ||
target.GetType() == cmTarget::UTILITY)
{
if(!target.FindSourceFiles())
diff --git a/Tests/RunCMake/ObjectLibrary/MissingSource-result.txt b/Tests/RunCMake/ObjectLibrary/MissingSource-result.txt
new file mode 100644
index 0000000000..d00491fd7e
--- /dev/null
+++ b/Tests/RunCMake/ObjectLibrary/MissingSource-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/ObjectLibrary/MissingSource-stderr.txt b/Tests/RunCMake/ObjectLibrary/MissingSource-stderr.txt
new file mode 100644
index 0000000000..411cd7cb76
--- /dev/null
+++ b/Tests/RunCMake/ObjectLibrary/MissingSource-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at MissingSource.cmake:1 \(add_library\):
+ Cannot find source file:
+
+ missing.c
+
+ Tried extensions( \.[A-Za-z+]+|
+ )*
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/ObjectLibrary/MissingSource.cmake b/Tests/RunCMake/ObjectLibrary/MissingSource.cmake
new file mode 100644
index 0000000000..258eaedb2f
--- /dev/null
+++ b/Tests/RunCMake/ObjectLibrary/MissingSource.cmake
@@ -0,0 +1 @@
+add_library(A OBJECT missing.c)
diff --git a/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake b/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake
index a74eaa8ebc..42973f8af2 100644
--- a/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake
+++ b/Tests/RunCMake/ObjectLibrary/RunCMakeTest.cmake
@@ -11,6 +11,7 @@ run_cmake(Install)
run_cmake(LinkObjLHS)
run_cmake(LinkObjRHS1)
run_cmake(LinkObjRHS2)
+run_cmake(MissingSource)
run_cmake(ObjWithObj)
run_cmake(PostBuild)
run_cmake(PreBuild)