Segmentation fault when passing an object library as a parameter to target_sources.
Reduced test case:
cmake_minimum_required(VERSION 3.7)
project(bug CXX)
file(WRITE obj.cpp "void obj() {}")
add_library(mylib OBJECT ${PROJECT_SOURCE_DIR}/obj.cpp)
target_sources(mylib PRIVATE $<TARGET_OBJECTS:mylib>)
Happens when not linking with self too. Not even sure if this is possible but I'm guessing a segfault isn't the desired outcome either way! :)
Seen with version 3.7.1.