mLib icon indicating copy to clipboard operation
mLib copied to clipboard

Add full CMake support for Windows(contemporary MSVC) & Linux (g++/clang++)

Open Algomorph opened this issue 4 years ago • 1 comments

Allows to build MLib as a static library on either Windows or Linux platforms (probably will work on Mac OS as well, but haven't tested that).

  1. Note: the following modules are excluded from build unless the platform is Windows
  • application-base
  • application-d3d11
  • ext-d3d11font
  1. Switched to the D3DCompileFromFile solution (from D3DX11CompileFromFile) D3D11Utility.cpp, now line 100. I realize this is untested and might break things (although it shouldn't, based on the info I read so far), but tests should be added later to the test folder after I provide the foundations for continuous integration in the next PR.

  2. Had to change API of intersection.h (functions now camelCase, like the rest of the library) to avoid conflicts with triangleIntersection.cpp with both MSVC and GCC. If the reverse is better, that can be changed in a separate PR/commit... But preferably not, to keep naming consistent with the rest of the library.

  3. Some ".cpp" files contained template definitions and were included in headers. I changed to a different convention, renaming these files to ".tpp" extension, including the ".h" files in them and removing their inclusions from the headers. I have also updated the corresponding headers which use the headers to use ".tpp" files instead. See the TODO notes: this is a good solution to add explicit instantiations to the static library, hence saving compile time for any user projects. ".tpp" files should not be included in the main headers in the future.

  4. I removed dependence on including broad groups of headers by making explicit includes wherever necessary, making the entire library more modular and reducing compilation times in certain instances.

Algomorph avatar Aug 22 '19 23:08 Algomorph

Bump

Algomorph avatar Nov 29 '19 17:11 Algomorph