CMake refactored and support for MSVC #327
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This based on commit
cafc6c8Rework CMake and add some fixes in code for MSVC.
Changes:
CMake
1. Min required cmake changed to version 3.16 for compatibility with modern features.
2. Refactored
src/CMakeLists.txtadd_custom_commandforversion.incgeneration withexecute_process.git describeis now called directly from CMake using execute_process, which works consistently across common terminal environments (e.g., Bash, CMD, PowerShell).3. Added
genbundle.cmake(CMake replacement) forgenbundle.sh(with fixraw string literallimit in MSVC).MSVC
4. Fixed build issue with MSVC:
src/File.cppdeleted__cxx11fromFile::File(const std::filesystem::path& path, const string& mode, bool throwOnError).src/File.h,src/common.handsrc/main.cpp.static_cast<u32>()forCARRY_AUTOwhere required (required for compil with MSVC)src/Gpu.hchangegsturct Tasktoclass Task.src/main.cppadded directive with_putenv_s("ROC_SIGNAL_POOL_SIZE", "32")to fix problem with string what use%n(Microsoft think its dangerous).src/File.cppadded directive withFORMAT_PRINTF(fmt_idx, arg_idx).__attribute__is feature GCC/clang.Tested on:
Linux
Windows