@Echonic Not generally, literally- that is what makes these determinations: the publisher's target reader. Your example: shounen. You gave exactly the same situation as Angelic Layer, a girly and frilly CLAMP series. It's a shounen series though because it ran in Shounen Ace. Shounen. Seinen, Shoujo, Jousei, etc are not genres, they're demographics; in of themselves they do not impose any particular subject, content, or look. Weekly Shonen Jump publishing a magical girl series would still be a shounen series, that's the magazine's demographic. Shueisha would be highly unlikely to run such a thing in WSJ nowadays because WSJ pretty much forces everything in it follow a particular template, but that's neither here not there for this context- closest equivalent I can think of would be Cat's Eye, but that was about a trio of phantom thief sisters, no magic involved. However, Kimagure Orange Road, a series possibly more influential than even Dragonball, ran in Jump and that was maybe 85+% about romance, as one of the figuratively original shonen romantic comedies- to drive home the point that these are reader demographics, not genres.
Like with all my previous examples: March Comes Like a Lion: A shogi prodigy struggles to overcome his childhood of exploitation and abuse with the aid of various relationships who forced themselves into his life- seinen series. Your Lie in April: A piano prodigy struggles to overcome his childhood of exploitation and abuse to rekindle his passion for music through a relationship with a violinist that forced herself into his life- shounen. They sure do sound very similar don't they? Not the content that decides which is which.