radioegor146 / native-obfuscator

Java .class to .cpp converter for use with JNI
GNU General Public License v3.0
499 stars 67 forks source link

Easy crossplatform build option #67

Open EpicCatto opened 10 months ago

EpicCatto commented 10 months ago

cmake --build . --config Release only created native_library.dll image Instead of expected

x64-windows.dll
x64-linux.so
x86-windows.dll
x64-macos.dylib
arm64-linux.so
arm64-windows.dll
radioegor146 commented 10 months ago

If you need all the other libraries, you need to compile C++ for other platforms manually. Right now there is no easy crossplatform build option, but some time later it may be implemented.

radioegor146 commented 2 months ago

So after my initial thoughts about the issue, there is currently only one option that fits all platforms and is fairly easy to set up: zig. It provides a compatible C/C++ compiler. However, it is not clear about how to properly integrate it into this project, although I have some options from the top of my head:

  1. Create an additional subproject that allows people to very easily use Zig just by providing the directory with the project (but this approach eliminates an easy option to edit result C++ code in IDE and build it in it in the same configuration as new subproject will)
  2. Add another variant of the CMake file that uses Zig, however, users still will need to manually compile all the libraries, because as for now, there is no easy approach for using multiple toolchains on a single CMake project
  3. Provide a guide on how to use Zig with CMake as it is