2020-08-30 11:54:41 +02:00
|
|
|
cmake_policy(SET CMP0057 NEW)
|
|
|
|
|
2016-07-09 11:21:54 +02:00
|
|
|
include(RunCMake)
|
2019-11-11 23:01:05 +01:00
|
|
|
cmake_policy(SET CMP0054 NEW)
|
2018-04-23 21:13:27 +02:00
|
|
|
|
2021-09-14 00:13:48 +02:00
|
|
|
if(CMAKE_C_COMPILER_ID STREQUAL "MSVC" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 19.27)
|
|
|
|
run_cmake(LanguageStandard)
|
|
|
|
endif()
|
|
|
|
|
2023-07-02 19:51:09 +02:00
|
|
|
run_cmake(CMakeInputs)
|
2021-09-14 00:13:48 +02:00
|
|
|
run_cmake(CustomCommandGenex)
|
2023-07-02 19:51:09 +02:00
|
|
|
if(NOT RunCMake_GENERATOR MATCHES "^Visual Studio 1[1-5] ")
|
|
|
|
run_cmake(CustomCommandParallel)
|
|
|
|
endif()
|
2020-08-30 11:54:41 +02:00
|
|
|
run_cmake(VsCsharpSourceGroup)
|
2019-11-11 23:01:05 +01:00
|
|
|
run_cmake(VsCSharpCompilerOpts)
|
2018-04-23 21:13:27 +02:00
|
|
|
run_cmake(ExplicitCMakeLists)
|
2021-09-14 00:13:48 +02:00
|
|
|
run_cmake(InterfaceLibSources)
|
|
|
|
run_cmake(NoImpLib)
|
2019-11-11 23:01:05 +01:00
|
|
|
run_cmake(RuntimeLibrary)
|
|
|
|
run_cmake(SourceGroupCMakeLists)
|
2020-02-01 23:06:01 +01:00
|
|
|
run_cmake(SourceGroupTreeCMakeLists)
|
2022-09-13 21:35:23 +02:00
|
|
|
run_cmake(SourceGroupFileSet)
|
2016-07-09 11:21:54 +02:00
|
|
|
run_cmake(VsConfigurationType)
|
2017-04-14 19:02:05 +02:00
|
|
|
run_cmake(VsTargetsFileReferences)
|
|
|
|
run_cmake(VsCustomProps)
|
|
|
|
run_cmake(VsDebuggerWorkingDir)
|
2018-08-09 18:06:22 +02:00
|
|
|
run_cmake(VsDebuggerCommand)
|
2018-10-28 12:09:07 +01:00
|
|
|
run_cmake(VsDebuggerCommandArguments)
|
|
|
|
run_cmake(VsDebuggerEnvironment)
|
2017-04-14 19:02:05 +02:00
|
|
|
run_cmake(VsCSharpCustomTags)
|
2020-08-30 11:54:41 +02:00
|
|
|
run_cmake(VsCSharpDocumentationFile)
|
2018-01-26 17:06:56 +01:00
|
|
|
run_cmake(VsCSharpReferenceProps)
|
2018-04-23 21:13:27 +02:00
|
|
|
run_cmake(VsCSharpWithoutSources)
|
2019-11-11 23:01:05 +01:00
|
|
|
run_cmake(VsCSharpDeployFiles)
|
|
|
|
run_cmake(VSCSharpDefines)
|
2018-08-09 18:06:22 +02:00
|
|
|
run_cmake(VsSdkDirectories)
|
2018-10-28 12:09:07 +01:00
|
|
|
run_cmake(VsGlobals)
|
2019-11-11 23:01:05 +01:00
|
|
|
run_cmake(VsProjectImport)
|
|
|
|
run_cmake(VsPackageReferences)
|
2020-02-01 23:06:01 +01:00
|
|
|
run_cmake(VsDpiAware)
|
|
|
|
run_cmake(VsDpiAwareBadParam)
|
2022-08-04 22:12:04 +02:00
|
|
|
run_cmake(VsForceInclude)
|
2020-02-01 23:06:01 +01:00
|
|
|
run_cmake(VsPrecompileHeaders)
|
|
|
|
run_cmake(VsPrecompileHeadersReuseFromCompilePDBName)
|
2020-08-30 11:54:41 +02:00
|
|
|
run_cmake(VsDeployEnabled)
|
|
|
|
run_cmake(VsSettings)
|
|
|
|
run_cmake(VsSourceSettingsTool)
|
|
|
|
run_cmake(VsPlatformToolset)
|
2022-03-29 21:10:50 +02:00
|
|
|
run_cmake(VsControlFlowGuardLinkSetting)
|
2020-08-30 11:54:41 +02:00
|
|
|
|
|
|
|
run_cmake(VsWinRTByDefault)
|
|
|
|
|
|
|
|
set(RunCMake_GENERATOR_TOOLSET "VCTargetsPath=$(VCTargetsPath)")
|
|
|
|
run_cmake(VsVCTargetsPath)
|
|
|
|
unset(RunCMake_GENERATOR_TOOLSET)
|
2019-11-11 23:01:05 +01:00
|
|
|
|
|
|
|
if(CMAKE_C_COMPILER_ID STREQUAL "MSVC" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 19.05)
|
|
|
|
run_cmake(VsJustMyCode)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CMAKE_C_COMPILER_ID STREQUAL "MSVC" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 19.20)
|
|
|
|
run_cmake(VsSpectreMitigation)
|
|
|
|
endif()
|
2020-02-01 23:06:01 +01:00
|
|
|
|
|
|
|
# Visual Studio 2017 has toolset version 141
|
|
|
|
string(REPLACE "v" "" generator_toolset "${RunCMake_GENERATOR_TOOLSET}")
|
|
|
|
if (RunCMake_GENERATOR MATCHES "Visual Studio 1[0-4] 201[0-5]" OR
|
|
|
|
(RunCMake_GENERATOR_TOOLSET AND generator_toolset VERSION_LESS "141"))
|
|
|
|
run_cmake(UnityBuildPre2017)
|
|
|
|
else()
|
|
|
|
run_cmake(UnityBuildNative)
|
2020-08-30 11:54:41 +02:00
|
|
|
run_cmake(UnityBuildNativeGrouped)
|
2022-03-29 21:10:50 +02:00
|
|
|
|
|
|
|
function(run_UnityBuildPCH)
|
|
|
|
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/UnityBuildPCH-build)
|
|
|
|
run_cmake(UnityBuildPCH)
|
|
|
|
set(RunCMake_TEST_NO_CLEAN 1)
|
|
|
|
set(vcxproj "${RunCMake_TEST_BINARY_DIR}/UnityBuildPCH.vcxproj")
|
|
|
|
if(EXISTS "${vcxproj}")
|
|
|
|
file(STRINGS ${vcxproj} vcxproj_strings REGEX "ClCompile[^\n]*UnityBuildPCH\\.c")
|
|
|
|
endif()
|
|
|
|
if(vcxproj_strings MATCHES "Include=\"([^\"]+)\"")
|
|
|
|
set(src "${CMAKE_MATCH_1}")
|
|
|
|
run_cmake_command(UnityBuildPCH-build ${CMAKE_COMMAND} --build . --config Debug --target UnityBuildPCH -- -t:ClCompile -p:SelectedFiles=${src})
|
|
|
|
endif()
|
|
|
|
endfunction()
|
|
|
|
run_UnityBuildPCH()
|
2020-02-01 23:06:01 +01:00
|
|
|
endif()
|
2020-08-30 11:54:41 +02:00
|
|
|
|
2022-08-04 22:12:04 +02:00
|
|
|
run_cmake(VsDotnetStartupObject)
|
2020-08-30 11:54:41 +02:00
|
|
|
run_cmake(VsDotnetTargetFramework)
|
|
|
|
run_cmake(VsDotnetTargetFrameworkVersion)
|
2022-08-04 22:12:04 +02:00
|
|
|
run_cmake(VsNoCompileBatching)
|
2022-11-16 20:14:03 +01:00
|
|
|
run_cmake(DebugInformationFormat)
|
2023-05-23 16:38:00 +02:00
|
|
|
run_cmake(VsCLREmpty)
|
|
|
|
run_cmake(VsCLRPure)
|
|
|
|
run_cmake(VsCLRSafe)
|
|
|
|
|
|
|
|
if(CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL 19.20)
|
|
|
|
run_cmake(VsCLRNetcore)
|
|
|
|
endif()
|