Berserker
Posts: 16657
|
|
10.01.2024 23:27 |
|
void_17
Posts: 39
|
На всякий случай делаю необязательную поддержку 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
IDA-База HOMM 3 Discord Server
|
|
14.09.2024 11:51 |
|
Berserker
Posts: 16657
|
|
14.09.2024 18:38 |
|