зеркало из https://github.com/microsoft/FX11.git
Code review cmake (#45)
This commit is contained in:
Родитель
7aa481d2f9
Коммит
2753afc79f
|
@ -43,6 +43,18 @@ jobs:
|
|||
- os: windows-2022
|
||||
build_type: x86-Release
|
||||
arch: amd64_x86
|
||||
- os: windows-2022
|
||||
build_type: arm64-Debug
|
||||
arch: amd64_arm64
|
||||
- os: windows-2022
|
||||
build_type: arm64-Release
|
||||
arch: amd64_arm64
|
||||
- os: windows-2022
|
||||
build_type: arm64ec-Debug
|
||||
arch: amd64_arm64
|
||||
- os: windows-2022
|
||||
build_type: arm64ec-Release
|
||||
arch: amd64_arm64
|
||||
- os: windows-2022
|
||||
build_type: x64-Debug-Clang
|
||||
arch: amd64
|
||||
|
@ -56,16 +68,10 @@ jobs:
|
|||
build_type: x86-Release-Clang
|
||||
arch: amd64_x86
|
||||
- os: windows-2022
|
||||
build_type: arm64-Debug
|
||||
build_type: arm64-Debug-Clang
|
||||
arch: amd64_arm64
|
||||
- os: windows-2022
|
||||
build_type: arm64-Release
|
||||
arch: amd64_arm64
|
||||
- os: windows-2022
|
||||
build_type: arm64ec-Debug
|
||||
arch: amd64_arm64
|
||||
- os: windows-2022
|
||||
build_type: arm64ec-Release
|
||||
build_type: arm64-Release-Clang
|
||||
arch: amd64_arm64
|
||||
|
||||
steps:
|
||||
|
|
|
@ -45,6 +45,10 @@
|
|||
"strategy": "external"
|
||||
},
|
||||
"cacheVariables": { "DIRECTX_ARCH": "arm64ec" },
|
||||
"environment": {
|
||||
"CFLAGS": "/arm64EC",
|
||||
"CXXFLAGS": "/arm64EC"
|
||||
},
|
||||
"hidden": true
|
||||
},
|
||||
|
||||
|
@ -85,6 +89,22 @@
|
|||
"strategy": "external"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Clang-X86",
|
||||
"environment": {
|
||||
"CFLAGS": "-m32",
|
||||
"CXXFLAGS": "-m32"
|
||||
},
|
||||
"hidden": true
|
||||
},
|
||||
{
|
||||
"name": "Clang-AArch64",
|
||||
"environment": {
|
||||
"CFLAGS": "--target=arm64-pc-windows-msvc",
|
||||
"CXXFLAGS": "--target=arm64-pc-windows-msvc"
|
||||
},
|
||||
"hidden": true
|
||||
},
|
||||
|
||||
{
|
||||
"name": "UWP",
|
||||
|
@ -101,8 +121,8 @@
|
|||
{ "name": "x86-Release" , "description": "MSVC for x86 (Release)", "inherits": [ "base", "x86", "Release", "MSVC" ] },
|
||||
{ "name": "arm64-Debug" , "description": "MSVC for ARM64 (Debug)", "inherits": [ "base", "ARM64", "Debug", "MSVC" ] },
|
||||
{ "name": "arm64-Release" , "description": "MSVC for ARM64 (Release)", "inherits": [ "base", "ARM64", "Release", "MSVC" ] },
|
||||
{ "name": "arm64ec-Debug" , "description": "MSVC for ARM64EC (Debug)", "inherits": [ "base", "ARM64EC", "Debug", "MSVC" ], "environment": { "CXXFLAGS": "/arm64EC" } },
|
||||
{ "name": "arm64ec-Release" , "description": "MSVC for ARM64EC (Release)", "inherits": [ "base", "ARM64EC", "Release", "MSVC" ], "environment": { "CXXFLAGS": "/arm64EC" } },
|
||||
{ "name": "arm64ec-Debug" , "description": "MSVC for ARM64EC (Debug)", "inherits": [ "base", "ARM64EC", "Debug", "MSVC" ] },
|
||||
{ "name": "arm64ec-Release" , "description": "MSVC for ARM64EC (Release)", "inherits": [ "base", "ARM64EC", "Release", "MSVC" ] },
|
||||
|
||||
{ "name": "x64-Debug-UWP" , "description": "MSVC for x64 (Debug) for UWP", "inherits": [ "base", "x64", "Debug", "MSVC", "UWP" ] },
|
||||
{ "name": "x64-Release-UWP" , "description": "MSVC for x64 (Release) for UWP", "inherits": [ "base", "x64", "Release", "MSVC", "UWP" ] },
|
||||
|
@ -113,17 +133,17 @@
|
|||
|
||||
{ "name": "x64-Debug-Clang" , "description": "Clang/LLVM for x64 (Debug)", "inherits": [ "base", "x64", "Debug", "Clang" ] },
|
||||
{ "name": "x64-Release-Clang" , "description": "Clang/LLVM for x64 (Release)", "inherits": [ "base", "x64", "Release", "Clang" ] },
|
||||
{ "name": "x86-Debug-Clang" , "description": "Clang/LLVM for x86 (Debug)", "inherits": [ "base", "x86", "Debug", "Clang" ], "environment": { "CXXFLAGS": "-m32" } },
|
||||
{ "name": "x86-Release-Clang" , "description": "Clang/LLVM for x86 (Release)", "inherits": [ "base", "x86", "Release", "Clang" ], "environment": { "CXXFLAGS": "-m32" } },
|
||||
{ "name": "arm64-Debug-Clang" , "description": "Clang/LLVM for AArch64 (Debug)", "inherits": [ "base", "ARM64", "Debug", "Clang" ], "environment": { "CXXFLAGS": "--target=arm64-pc-windows-msvc" } },
|
||||
{ "name": "arm64-Release-Clang", "description": "Clang/LLVM for AArch64 (Release)", "inherits": [ "base", "ARM64", "Release", "Clang" ], "environment": { "CXXFLAGS": "--target=arm64-pc-windows-msvc" } },
|
||||
{ "name": "x86-Debug-Clang" , "description": "Clang/LLVM for x86 (Debug)", "inherits": [ "base", "x86", "Debug", "Clang", "Clang-X86" ] },
|
||||
{ "name": "x86-Release-Clang" , "description": "Clang/LLVM for x86 (Release)", "inherits": [ "base", "x86", "Release", "Clang", "Clang-X86" ] },
|
||||
{ "name": "arm64-Debug-Clang" , "description": "Clang/LLVM for AArch64 (Debug)", "inherits": [ "base", "ARM64", "Debug", "Clang", "Clang-AArch64" ] },
|
||||
{ "name": "arm64-Release-Clang", "description": "Clang/LLVM for AArch64 (Release)", "inherits": [ "base", "ARM64", "Release", "Clang", "Clang-AArch64" ] },
|
||||
|
||||
{ "name": "x64-Debug-UWP-Clang" , "description": "Clang/LLVM for x64 (Debug) for UWP", "inherits": [ "base", "x64", "Debug", "Clang", "UWP" ] },
|
||||
{ "name": "x64-Release-UWP-Clang" , "description": "Clang/LLVM for x64 (Release) for UWP", "inherits": [ "base", "x64", "Release", "Clang", "UWP" ] },
|
||||
{ "name": "x86-Debug-UWP-Clang" , "description": "Clang/LLVM for x86 (Debug) for UWP", "inherits": [ "base", "x86", "Debug", "Clang", "UWP" ], "environment": { "CXXFLAGS": "-m32" } },
|
||||
{ "name": "x86-Release-UWP-Clang" , "description": "Clang/LLVM for x86 (Release) for UWP", "inherits": [ "base", "x86", "Release", "Clang", "UWP" ], "environment": { "CXXFLAGS": "-m32" } },
|
||||
{ "name": "arm64-Debug-UWP-Clang" , "description": "Clang/LLVM for AArch64 (Debug) for UWP", "inherits": [ "base", "ARM64", "Debug", "Clang", "UWP" ], "environment": { "CXXFLAGS": "--target=arm64-pc-windows-msvc" } },
|
||||
{ "name": "arm64-Release-UWP-Clang", "description": "Clang/LLVM for AArch64 (Release) for UWP", "inherits": [ "base", "ARM64", "Release", "Clang", "UWP" ], "environment": { "CXXFLAGS": "--target=arm64-pc-windows-msvc" } }
|
||||
{ "name": "x86-Debug-UWP-Clang" , "description": "Clang/LLVM for x86 (Debug) for UWP", "inherits": [ "base", "x86", "Debug", "Clang", "Clang-X86", "UWP" ] },
|
||||
{ "name": "x86-Release-UWP-Clang" , "description": "Clang/LLVM for x86 (Release) for UWP", "inherits": [ "base", "x86", "Release", "Clang", "Clang-X86", "UWP" ] },
|
||||
{ "name": "arm64-Debug-UWP-Clang" , "description": "Clang/LLVM for AArch64 (Debug) for UWP", "inherits": [ "base", "ARM64", "Debug", "Clang", "Clang-AArch64", "UWP" ] },
|
||||
{ "name": "arm64-Release-UWP-Clang", "description": "Clang/LLVM for AArch64 (Release) for UWP", "inherits": [ "base", "ARM64", "Release", "Clang", "Clang-AArch64", "UWP" ] }
|
||||
|
||||
]
|
||||
}
|
|
@ -32,6 +32,13 @@ elseif(CMAKE_VS_PLATFORM_NAME_DEFAULT MATCHES "^[Aa][Rr][Mm]64EC$")
|
|||
set(DIRECTX_ARCH arm64ec)
|
||||
endif()
|
||||
|
||||
#--- Determines host architecture
|
||||
if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "[Aa][Rr][Mm]64|aarch64|arm64")
|
||||
set(DIRECTX_HOST_ARCH arm64)
|
||||
else()
|
||||
set(DIRECTX_HOST_ARCH x64)
|
||||
endif()
|
||||
|
||||
#--- Build with Unicode Win32 APIs per "UTF-8 Everywhere"
|
||||
if(WIN32)
|
||||
list(APPEND COMPILER_DEFINES _UNICODE UNICODE)
|
||||
|
@ -42,7 +49,7 @@ if(MSVC)
|
|||
list(APPEND COMPILER_SWITCHES "$<$<NOT:$<CONFIG:DEBUG>>:/guard:cf>")
|
||||
list(APPEND LINKER_SWITCHES /DYNAMICBASE /NXCOMPAT /INCREMENTAL:NO)
|
||||
|
||||
if((${DIRECTX_ARCH} MATCHES "x86")
|
||||
if((${DIRECTX_ARCH} STREQUAL "x86")
|
||||
OR ((CMAKE_SIZEOF_VOID_P EQUAL 4) AND (NOT (${DIRECTX_ARCH} MATCHES "^arm"))))
|
||||
list(APPEND LINKER_SWITCHES /SAFESEH)
|
||||
endif()
|
||||
|
@ -64,7 +71,7 @@ if(XBOX_CONSOLE_TARGET STREQUAL "scarlett")
|
|||
elseif(XBOX_CONSOLE_TARGET MATCHES "xboxone|durango")
|
||||
list(APPEND COMPILER_SWITCHES $<IF:$<CXX_COMPILER_ID:MSVC>,/favor:AMD64 /arch:AVX,-march=btver2>)
|
||||
elseif(NOT (${DIRECTX_ARCH} MATCHES "^arm"))
|
||||
if((${DIRECTX_ARCH} MATCHES "x86") OR (CMAKE_SIZEOF_VOID_P EQUAL 4))
|
||||
if((${DIRECTX_ARCH} STREQUAL "x86") OR (CMAKE_SIZEOF_VOID_P EQUAL 4))
|
||||
set(ARCH_SSE2 $<$<CXX_COMPILER_ID:MSVC,Intel>:/arch:SSE2> $<$<NOT:$<CXX_COMPILER_ID:MSVC,Intel>>:-msse2>)
|
||||
else()
|
||||
set(ARCH_SSE2 $<$<NOT:$<CXX_COMPILER_ID:MSVC,Intel>>:-msse2>)
|
||||
|
|
Загрузка…
Ссылка в новой задаче