Apple can't detect if it contains malware

I have no problem compiling juce in windows, but compiling with xocde on mac, although it works, but when I open the plugin through the daw, it shows that it contains malware?

You will need to sign/notarize it if you plan to distribute it:

It should run on the computer you build it on though…

If the plugin is just for you, you can remove the quarantine flag or code sign it to run locally.