restricted access Cubulating graphs of free groups with cyclic edge groups

We prove that if $G$ is a group that splits as a finite graph of finitely generated free groups with cyclic edge groups, and $G$ has no non-Euclidean Baumslag-Solitar subgroups, then $G$ is the fundamental group of a compact nonpositively curved cube complex. In addition, if $G$ is also word-hyperbolic (i.e., if $G$ contains no Baumslag-Solitar subgroups of any type), we show that $G$ is linear (in fact, is a subgroup of $SL_n(Z)$).