Skip to content

Conversation

@CrazeTheDragon
Copy link

This based on commit cafc6c8

Rework 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.txt

  • Replaced add_custom_command for version.inc generation with execute_process. git describe is 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) for genbundle.sh (with fix raw string literal limit in MSVC).

MSVC

4. Fixed build issue with MSVC:

  • In src/File.cpp deleted __cxx11 from File::File(const std::filesystem::path& path, const string& mode, bool throwOnError).
  • MSVC-specific code is added under #ifdef directives to implement conditional compilation in files: src/File.h, src/common.h and src/main.cpp.
  • Added static_cast<u32>() for CARRY_AUTO where required (required for compil with MSVC)
  • In src/Gpu.h changeg sturct Task to class Task.
  • In src/main.cpp added directive with _putenv_s("ROC_SIGNAL_POOL_SIZE", "32") to fix problem with string what use %n (Microsoft think its dangerous).
  • In src/File.cpp added directive with FORMAT_PRINTF(fmt_idx, arg_idx). __attribute__ is feature GCC/clang.

Tested on:

Linux

  • cmake with GCC

Windows

  • MSCV
  • MinGw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant