PHILADELPHIA — “Narcissism. Can men and women be friends? What constitutes cheating?”

Those were a few of the things on Joe Swanberg’s mind when he set out to make “Drinking Buddies.” He also wanted to celebrate a passion: beer. Olivia Wilde and Jake Johnson’s characters work at a Chicago brewery (the real Revolution Brewing). Other breweries get a plug here and there, via a T-shirt, a cap.

“Craft beer is at its trendy tipping point right now,” says Swanberg, in town recently and finding a Yards Jefferson Tavern Ale to his liking at a lunch interview. “And I know what that feels like –to love something and then see it get popular and feel a little ownership over it.”

Wilde and Johnson play colleagues and pals. Each has a significant other (Ron Livingston, Anna Kendrick), but in the film the lines between friendship, flirtation and an all-out affair get blurry indeed.

“It’s depressing to me to think that 50 percent of the population is shut off to me, as potential friendships,” Swanberg says. “And anybody who feels that way — that men and women can’t be friends — it’s just a bad attitude to approach the world with.

“But it’s also complicated. It is inherently a different kind of friendship than a friendship with a guy. I’ve found in my own experience it’s much more intimate, the things that are mutual grounds to have conversations about are more emotion-based, which opens the door for intimacy in a different way.”

Swanberg, a prolific indie director who can cite Phillip Roth, Mike Nichols, sports culture, the poet Tony Hoagland and the genius of the first 20 minutes of “Ishtar” practically in the same breath, goes on: “I value my relationship with my wife, and I value the specialness of it. And it’s tough to feel like I may possibly be taking away from that by sharing things with another woman outside of that relationship. … My feeling is, the only way to do it is either for there not to be sexual attraction, or if there is, to acknowledge it, really stare it in the face, and get over it. Which is also tricky.”

In “Drinking Buddies,” Swanberg paints that picture.

“You know, what is it like to walk right up to the line? But I feel like at the end, hopefully, I’ve given this sense that they can get over it. They’ve gotten close enough to see what their relationship might look like, and that they actually value the friendship more than they value the possibility of a relationship.”