School grounds (not just inside the buildings) are included in the definition premises for penal code 46.03 which makes it illegal to have a firearm on school premises.
(a) A person commits an offense if the person intentionally, knowingly, or recklessly possesses or goes with a firearm, location-restricted knife, club, or prohibited weapon listed in Section 46.05(a):
(1) on the premises of a school or postsecondary educational institution, on any grounds or building owned by and under the control of a school or postsecondary educational institution and on which an activity sponsored by the school or institution is being conducted, or in a passenger transportation vehicle of a school or postsecondary educational institution, whether the school or postsecondary educational institution is public or private, unless:
(A) pursuant to written regulations or written authorization of the school or institution; or
(B) the person possesses or goes with a concealed handgun that the person is licensed to carry under Subchapter H, Chapter 411, Government Code, and no other weapon to which this section applies, on the premises of a postsecondary educational institution, on any grounds or building owned by and under the control of the institution and on which an activity sponsored by the institution is being conducted, or in a passenger transportation vehicle of the institution;