Wake of Gods Forum | Форум Во Имя Богов

Full Version: Нужна ли в Эре поддержка Windows XP?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
Попробуйте эту сборку запустить:
https://drive.google.com/file/d/1jdRBjTL...drive_link
Пароли в названии файла. 123, 321
На всякий случай делаю необязательную поддержку Windows XP для NH3API...
Кто захочет - переключит один флаг в CMake.

Code:
if ("${CMAKE_GENERATOR}" MATCHES "Visual Studio ([0-9]+)")
        if(NH3API_FLAG_TARGET_WINDOWS_XP)
            if(${CMAKE_MATCH_1} LESS 11)
                # Do nothing. Older versions of MSVC do support WinXP by default.
            elseif(${CMAKE_MATCH_1} EQUAL 11)
                # Visual Studio 2012
                set(CMAKE_GENERATOR_TOOLSET "v110_xp" CACHE STRING "CMAKE_GENERATOR_TOOLSET" FORCE)
                set(CMAK_VS_PLATFORM_TOOLSET "v110_xp" CACHE STRING "CMAKE_VS_PLATFORM_TOOLSET" FORCE)
            elseif (${CMAKE_MATCH_1} EQUAL 12)
                # Visual Studio 2013
                set(CMAKE_GENERATOR_TOOLSET "v120_xp" CACHE STRING "CMAKE_GENERATOR_TOOLSET" FORCE)
                set(CMAKE_VS_PLATFORM_TOOLSET "v120_xp" CACHE STRING "CMAKE_VS_PLATFORM_TOOLSET" FORCE)
            elseif (${CMAKE_MATCH_1} EQUAL 14)
                # Visual Studio 2015
                set(CMAKE_GENERATOR_TOOLSET "v140_xp" CACHE STRING "CMAKE_GENERATOR_TOOLSET" FORCE)
                set(CMAKE_VS_PLATFORM_TOOLSET "v140_xp" CACHE STRING "CMAKE_VS_PLATFORM_TOOLSET" FORCE)
            elseif (${CMAKE_MATCH_1} GREATER_EQUAL 15)
                # Visual Studio 2017 and greater
                set(CMAKE_GENERATOR_TOOLSET "v141_xp" CACHE STRING "CMAKE_GENERATOR_TOOLSET" FORCE)
                set(CMAKE_VS_PLATFORM_TOOLSET "v141_xp" CACHE STRING "CMAKE_VS_PLATFORM_TOOLSET" FORCE)
            endif()

            if(${CMAKE_MATCH_1} GREATER_EQUAL 14)
                # Visual Studio 2015 and greater:
                # Remove TLS static variables initialization optimization
                # Which uses Windows Vista syscalls
                # https://learn.microsoft.com/en-us/cpp/build/reference/zc-threadsafeinit-thread-safe-local-static-initialization
                add_compile_options(/Zc:threadSafeInit-)
            endif()
        endif() # target Windows XP with MSVC

        if(${CMAKE_MATCH_1} GREATER_EQUAL 15)
            # Visual Studio 2017 and greater:
            # Define __cplusplus macro properly
            add_compile_options(/Zc:__cplusplus)
        endif()
    endif() # Visual Studio major release regex lookup
void_17, хорошее решение.
Pages: 1 2 3
Reference URL's