enable_language(C) link_libraries( foo ) add_library(lib SHARED empty.c) target_link_libraries(lib PRIVATE foo )