Build is slower on linux

I have a problem with compiling an OpenCV project in Linux.
In windows, it takes about 7s to run but in Linux it takes 90s.
Is there any method to optimize speed?
Please help me.

you should ask that on a forum for general C++. you haven’t given any details, which are required to investigate your issue.

your build likely uses all CPU cores (12-16?) on windows, but just one CPU on linux, because you haven’t told the tool chain to use all CPUs.