floooh / fips

High-level build system for distributed, multi-platform C/C++ projects.
MIT License
471 stars 82 forks source link

Unity3d native plugins / MultiMake / Find Package Config Mode / Dockercross #140

Open roscopecoltran opened 7 years ago

roscopecoltran commented 7 years ago

Hey @floooh ,

Hope you are all well !

I am having a try with your interesting project because I wanted to manage more easily my cross-platform builds and stacks of c/c++ dependencies. While making some tests, some questions popped from my mind :-) about several topics. Sorry for this long post, but I was wondering if it was worth to chunk it into sub-issues before having your overall point of view on that, so let me know if you want me to split it later on.

Questions:

Each of them starts with the following :-), would it be possible to build or manage it with FIPS ... ?

1. Build Unity3d Native plugins:

Goal: Automate the build of a project or a dependency for several platform builds (eg Android, iOS, PhoneSDK81, SDK81, Linux)

Reference: https://github.com/mixpanel/mixpanel-unity/blob/master/native/build/build_all.py

Output example: ./Assets/Plugins/OpenCV/Android/libs/armeabi-v7a/opencv-sharedlib.so ./Assets/Plugins/OpenCV/Android/libs/x86/opencv-sharedlib.so ./Assets/Plugins/OpenCV/iOS/opencv2.framework ./Assets/Plugins/OpenCV/iOS/libopencv.a (combined armv7/arm64) ./Assets/Plugins/OpenCV/opencv.bundle ./Assets/Plugins/OpenCV/WSA/PhoneSDK81/ARM/.dll ./Assets/Plugins/OpenCV/WSA/PhoneSDK81/x86/.dll ./Assets/Plugins/OpenCV/WSA/SDK81/ARM/.dll ./Assets/Plugins/OpenCV/WSA/SDK81/x86/.dll ./Assets/Plugins/OpenCV/WSA/SDK81/x64/.dll ./Assets/Plugins/OpenCV/x86/.dll ./Assets/Plugins/OpenCV/x86_64/*.dll One dll per OpenCV module, eg. opencv_xfeatures2d310.dll, opencv_core310.dll ~27 files)

2. Auto generated unsafe bindings for C#/.NET and Mono from C/C++ projects.

Goal: Build bindings (with CppSharp with the IDisposable interface to manage the memory and import some C/C++ libraries into Unity3D projects.

Requirements:

References:

Notes:

3. CMake/Fips - Import more easily different external projects with find_package config mode (autotools, autogen-autotools, csprojects).

Goals:

Requirements:

Example:

References: multimake: https://github.com/Pelagicore/multimake hunter: https://github.com/ruslo/hunter/wiki/example.find_package.config hunter: https://github.com/ruslo/hunter/wiki/example.find_package.config ExternalProjectMultiPlatform: https://github.com/janelia-flyem/buildem/blob/master/ExternalProjectMultiPlatform.cmake

**4. (Last question but really quick one) Analyse and prepare a project for FIPS compatibility

Goals:

Requirements:

References: CMake++: https://github.com/toeb/cmakepp

Global idea/intent:

  1. Manage more easily cross-build projects with wider sets of complex dependencies
  2. Prevent duplicate dependencies between projects by creating a package config for CMake and use a namespace
  3. Create stacks of dependencies per platforms with user-managed manifests like hunter (link) or CMake++ (json manifest, cmake manifest parser), I am much more keen to use yaml manifest as you are doing with FIPS
  4. Copy imported packages and projects libraries (eg. OpenCV+libpng,libturbo-jpeg,Protobuf+Tiny-DNN+Eigen,...) to a Unity3D project

That's all but I am already checking the scope of possibilities with FIPS as before I used to work with Polly as a build wrapper for cross-platform builds.

The suggestions above would make of FIPS a really really useful tool for any students or developers working on C/C++ projects and wanting to try their project on different platfroms.

Have an awesome day ! and thanks if you have read all of that post :-)

Cheers, Richard

roscopecoltran commented 7 years ago

last question ^^, is there any tutorial or wiki page explaining how to wrap an external project with FIPS ?

floooh commented 7 years ago

Hi, supporting all this in core-fips would introduce quite a lot of 'scope-creep', but it may be possible to do some of those things through project-specific extensions, for instance:

As for including more different types of external projects I'm thinking about adding support for conan (https://www.conan.io/), this would only support C/C++ dependencies though.

There's not much information for fipsifying projects, because there's so many different ways to do it.

Here are some examples:

roscopecoltran commented 7 years ago

I am giving a try now, I will let your know tomorrow if you do not mind ^^