foone / 3DMMForever

A modernized version of the Microsoft 3D Movie Maker release
MIT License
538 stars 24 forks source link

PR misfire, please ignore #9

Closed imuerte-fn closed 2 years ago

imuerte-fn commented 2 years ago

A brief summary of squash commits that are all within this one:

šŸ”Ø Fix linker warning regarding default libraries šŸ”Ø Enable C compiler in CMake šŸ”Ø Add CMakePresets.json šŸ”Ø Add cmake/FindAudioMan.cmake šŸ”Ø Add cmake/FindClangTidy.cmake šŸ”Ø Add cmake/FindCCache.cmake šŸ”Ø Add cmake/FindBRender.cmake ā™»ļø Remove DLL form of MSVC_RUNTIME_LIBRARY šŸ› Fix missing C files for BRender library šŸ› Fix typo in cmake/FindBRender.cmake šŸ©¹ Add temporary stub files for audioman within kauai library šŸšš Move BREN/*.C files to be lowercase

Explanation

This is because CMake (and most C++ compilers on other platforms!) assume that .C is a C++ file (yeah I don't know why either)

This now compiles in a (mostly) clean manner while still letting a few MSVC extensions make its way through. A lot more work is needed to make it compile cleanly with clang-tidy or even just clang with no warnings enabled.

There are a few warnings that are legitimate bugs but these are not the focus of this change.

I've also adjusted the README to support the workflow I'm using for this regarding configure+build steps.

What's left to do (in other PRs!):

However what's been provided here should work as a good starting base.

This change incorporates a few things from @clemenswasser and @frank-weindel, who deserve credit for figuring a few things out I had not run into yet, or who had solved a similar issue or two that I adopted to reduce conflicts or breakage.

Furthermore, a brief explanation of why I chose to use the file(GLOB) feature: speed. I doubt new files are going to be added anytime soon, the overhead (even on windows) of using the glob feature are 0.2s when building, and more time is spent linking and compiling than building the list of necessary files. If putting the files explicitly in every location is desired, I'll leave that up to someone else.

Additionally, I've written multiple versions in the past of cmake/ExtractVersion.cmake which contains a "magic regex" to find almost every version number in existence for executables. This should come in handy if needed to lock down external tooling to a minimum version range. This is just a copy paste from a personal project, and I'm giving it here under the MIT License instead of the Apache license so that additional licensing isn't needed.

The ClangTidy and CCache find packages were written from scratch using a blog post I wrote at the very tail end of 2020. This can be used as a reference to understand why things are declared the way they are.

Lastly, the BRender and AudioMan find_package files are intended to act as a shim so that if the source for other BRender implementations are ever "massaged" to work with 3DMMForever, they can be dropped in place whether prebuilt or pulled in via CMake's FetchContent module. AudioMan is also given this treatment, to keep the CMakeLists.txt file more uniform