build.rst 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. Build cglm
  2. ================================
  3. | **cglm** does not have external dependencies except for unit testing. When you pulled **cglm** repo with submodules all dependencies will be pulled too. `build-deps.sh` will pull all dependencies/submodules and build for you.
  4. External dependencies:
  5. * cmocka - for unit testing
  6. **NOTE:**
  7. If you only need to inline versions, you don't need to build **cglm**, you don't need to link it to your program.
  8. Just import cglm to your project as dependency / external lib by copy-paste then use it as usual
  9. Unix (Autotools):
  10. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  11. .. code-block:: bash
  12. :linenos:
  13. $ sh ./build-deps.sh # run this only once (dependencies)
  14. $ sh autogen.sh
  15. $ ./configure
  16. $ make
  17. $ make check # run tests (optional)
  18. $ [sudo] make install # install to system (optional)
  19. **make** will build cglm to **.libs** sub folder in project folder.
  20. If you don't want to install **cglm** to your system's folder you can get static and dynamic libs in this folder.
  21. Windows (MSBuild):
  22. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  23. Windows related build files, project files are located in `win` folder,
  24. make sure you are inside in cglm/win folder.
  25. Code Analysis are enabled, it may take awhile to build.
  26. .. code-block:: bash
  27. :linenos:
  28. $ cd win
  29. $ .\build.bat
  30. if *msbuild* is not worked (because of multi versions of Visual Studio)
  31. then try to build with *devenv*:
  32. .. code-block:: bash
  33. :linenos:
  34. $ devenv cglm.sln /Build Release
  35. Currently tests are not available on Windows.
  36. Documentation (Sphinx):
  37. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  38. **cglm** uses sphinx framework for documentation, it allows lot of formats for documentation. To see all options see sphinx build page:
  39. https://www.sphinx-doc.org/en/master/man/sphinx-build.html
  40. Example build:
  41. .. code-block:: bash
  42. :linenos:
  43. $ cd cglm/docs
  44. $ sphinx-build source build