diff options
author | Cristian Adam <cristian.adam@gmail.com> | 2019-12-07 14:03:16 (GMT) |
---|---|---|
committer | Cristian Adam <cristian.adam@gmail.com> | 2019-12-07 14:44:38 (GMT) |
commit | fa93b4a59bd639c995ffdf8a5c41dc587c160716 (patch) | |
tree | b7adad006caae1acba0339f1ed96b2c5073afbbe /Tests/RunCMake/UnityBuild | |
parent | 5ae07e7166c6cb7eada2a2d171d216039d977058 (diff) | |
download | CMake-fa93b4a59bd639c995ffdf8a5c41dc587c160716.zip CMake-fa93b4a59bd639c995ffdf8a5c41dc587c160716.tar.gz CMake-fa93b4a59bd639c995ffdf8a5c41dc587c160716.tar.bz2 |
Unity: Proper handling of object libraries
Fixes: #20051
Diffstat (limited to 'Tests/RunCMake/UnityBuild')
-rw-r--r-- | Tests/RunCMake/UnityBuild/RunCMakeTest.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/UnityBuild/unitybuild_object_library.cmake | 13 |
2 files changed, 14 insertions, 0 deletions
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) |