summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-12-09 15:16:20 (GMT)
committerKitware Robot <kwrobot@kitware.com>2019-12-09 15:16:31 (GMT)
commitbde1bc73869d426523169996ab0eae3cdbf92f78 (patch)
tree17cf167e187556b7fa985d95e562ed23009710ec /Tests
parent63c9a71eeb73e30ebeff00eb235ca380661e636c (diff)
parentfc9913075213e7636add2a811d41b6f3a7c37374 (diff)
downloadCMake-bde1bc73869d426523169996ab0eae3cdbf92f78.zip
CMake-bde1bc73869d426523169996ab0eae3cdbf92f78.tar.gz
CMake-bde1bc73869d426523169996ab0eae3cdbf92f78.tar.bz2
Merge topic 'unity-object-libraries'
fc99130752 Merge branch 'backport-unity-object-libraries' into unity-object-libraries fa93b4a59b Unity: Proper handling of object libraries 5ae07e7166 Unity: Generic source file handling for all generators f742f7ac1f Unity/PCH: Skip more target types when adding automatic sources Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4110
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/ObjectLibrary/OwnSources-stderr.txt6
-rw-r--r--Tests/RunCMake/UnityBuild/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/UnityBuild/unitybuild_object_library.cmake13
3 files changed, 20 insertions, 0 deletions
diff --git a/Tests/RunCMake/ObjectLibrary/OwnSources-stderr.txt b/Tests/RunCMake/ObjectLibrary/OwnSources-stderr.txt
index 208f3c9..cb1a2e5 100644
--- a/Tests/RunCMake/ObjectLibrary/OwnSources-stderr.txt
+++ b/Tests/RunCMake/ObjectLibrary/OwnSources-stderr.txt
@@ -4,4 +4,10 @@
Call Stack \(most recent call first\):
CMakeLists.txt:[0-9]+ \(include\)
+
+CMake Error at OwnSources.cmake:[0-9]+ \(add_library\):
+ The SOURCES of "A" use a generator expression that depends on the SOURCES
+ themselves.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
++
CMake Generate step failed\. Build files cannot be regenerated correctly\.$
diff --git a/Tests/RunCMake/UnityBuild/RunCMakeTest.cmake b/Tests/RunCMake/UnityBuild/RunCMakeTest.cmake
index 8e484d0..24daa64 100644
--- a/Tests/RunCMake/UnityBuild/RunCMakeTest.cmake
+++ b/Tests/RunCMake/UnityBuild/RunCMakeTest.cmake
@@ -21,3 +21,4 @@ function(run_test name)
endfunction()
run_test(unitybuild_runtest)
+run_test(unitybuild_object_library)
diff --git a/Tests/RunCMake/UnityBuild/unitybuild_object_library.cmake b/Tests/RunCMake/UnityBuild/unitybuild_object_library.cmake
new file mode 100644
index 0000000..b400517
--- /dev/null
+++ b/Tests/RunCMake/UnityBuild/unitybuild_object_library.cmake
@@ -0,0 +1,13 @@
+project(unitybuild_object_library C)
+
+set(CMAKE_UNITY_BUILD ON) # This tests that the variable works in addition to the property
+
+add_library(lib OBJECT func.c)
+
+add_library(other-lib STATIC func.c)
+
+add_executable(main main.c)
+target_link_libraries(main PRIVATE lib)
+
+enable_testing()
+add_test(NAME main COMMAND main)