Zeex / cmake-modules

CMake modules for SA-MP plugin development
Do What The F*ck You Want To Public License
9 stars 3 forks source link

About 64bit plugins #3

Open AGraber opened 1 year ago

AGraber commented 1 year ago

Hi, recently we've been working to add 64bit support on open.mp. Plugins have to be recompiled, and I'm working on updating some popular plugins without fully porting them to the open.mp SDK since it would take too much time and open.mp has a perfectly serviceable SA-MP plugin loader.

However, when porting plugins to x64, this part of the CMake module gets in the way on compiling for 64bit: https://github.com/Zeex/cmake-modules/blob/c0a898698b0003b83c2b2aeaa8a2950d573cc79b/AddSAMPPlugin.cmake#L6-L9

Could there be a way to prevent this from being added to the build file? Generally speaking, most plugins already enforce -m32 on the whole project, so the addition of it on this file could be considered kind of superfluous. Removing that part entirely shouldn't be too much of an issue; it wouldn't break existing projects unless they actively update their submodules. Alternatively, you can add some kind of CMake variable to tell your module to not add -m32. Both would work in any case.

Zeex commented 1 year ago

Hi Adrian,

I'd like to keep the existing behavior of add_samp_plugin function unchanged as it was made for SA-MP, which is only 32-bit as you know. I can add an extra flag parameter to it that would deactivate that part of logic, e.g.

add_samp_plugin(target_name NO_FORCE_32BIT)

Would that work for you?