If there were one. The closest thing is the Treaty of Lisbon, which in turn was an update on the Treaties of Maastricht and Rome.
However, the matter has been heard in the European Court of Justice in 2002, and the short version is "Community law does not preclude compulsory military service being reserved to men."
For more details, feel free to study the legal opinion behind the ruling: https://eur-lex.europa.eu/legal-content/EN/TXT/HTML/?uri=CEL...