Can i build both OSS and x-pack modules for metricbeat

Hello, I'm trying to metricbeat from source and it seems I can build the binary for either the oss modules or x-pack modules.

The binary in the image(elastic/metricbeat:8.17.3) is built for both.

Is that something I can do while building it locally from source?

Sorry, could you explain better what you're trying ti build?