Skip to content

Commit ef0ed48

Browse files
tadashibashibwrsandmangithub-actions[bot]
authored
Fix broken shader platform checks, add checks for iOS, Android, Orbis (#254)
* Fix broken shader platform checks, add checks for iOS, Android, Orbis, remove NaCl * Fix formatting issue Co-authored-by: Sandy <1013356+bwrsandman@users.noreply.github.com> * Update cmake/bgfxToolUtils.cmake formatting Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: Sandy <1013356+bwrsandman@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 2c33050 commit ef0ed48

File tree

1 file changed

+20
-12
lines changed

1 file changed

+20
-12
lines changed

cmake/bgfxToolUtils.cmake

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ if(TARGET bgfx::shaderc)
364364
# FILE filename
365365
# OUTPUT filename
366366
# FRAGMENT|VERTEX|COMPUTE
367-
# ANDROID|ASM_JS|IOS|LINUX|NACL|OSX|WINDOWS
367+
# ANDROID|ASM_JS|IOS|LINUX|OSX|WINDOWS|ORBIS
368368
# PROFILE profile
369369
# [O 0|1|2|3]
370370
# [VARYINGDEF filename]
@@ -382,7 +382,7 @@ if(TARGET bgfx::shaderc)
382382
function(_bgfx_shaderc_parse ARG_OUT)
383383
cmake_parse_arguments(
384384
ARG
385-
"DEPENDS;ANDROID;ASM_JS;IOS;LINUX;NACL;OSX;WINDOWS;PREPROCESS;RAW;FRAGMENT;VERTEX;COMPUTE;VERBOSE;DEBUG;DISASM;WERROR"
385+
"DEPENDS;ANDROID;ASM_JS;IOS;LINUX;OSX;WINDOWS;ORBIS;PREPROCESS;RAW;FRAGMENT;VERTEX;COMPUTE;VERBOSE;DEBUG;DISASM;WERROR"
386386
"FILE;OUTPUT;VARYINGDEF;BIN2C;PROFILE;O"
387387
"INCLUDES;DEFINES"
388388
${ARGN}
@@ -423,7 +423,7 @@ if(TARGET bgfx::shaderc)
423423

424424
# --platform
425425
set(PLATFORM "")
426-
set(PLATFORMS "ANDROID;ASM_JS;IOS;LINUX;NACL;OSX;WINDOWS")
426+
set(PLATFORMS "ANDROID;ASM_JS;IOS;LINUX;OSX;WINDOWS;ORBIS")
427427
foreach(P ${PLATFORMS})
428428
if(ARG_${P})
429429
if(PLATFORM)
@@ -436,20 +436,20 @@ if(TARGET bgfx::shaderc)
436436
if(PLATFORM STREQUAL "")
437437
message(SEND_ERROR "Call to _bgfx_shaderc_parse() must have a platform flag: ${PLATFORMS}")
438438
return()
439-
elseif(PLATFORM STREQUAL ANDROID)
439+
elseif(PLATFORM STREQUAL "ANDROID")
440440
list(APPEND CLI "--platform" "android")
441-
elseif(PLATFORM STREQUAL ASM_JS)
441+
elseif(PLATFORM STREQUAL "ASM_JS")
442442
list(APPEND CLI "--platform" "asm.js")
443-
elseif(PLATFORM STREQUAL IOS)
443+
elseif(PLATFORM STREQUAL "IOS")
444444
list(APPEND CLI "--platform" "ios")
445-
elseif(PLATFORM STREQUAL NACL)
446-
list(APPEND CLI "--platform" "nacl")
447-
elseif(PLATFORM STREQUAL OSX)
445+
elseif(PLATFORM STREQUAL "OSX")
448446
list(APPEND CLI "--platform" "osx")
449-
elseif(PLATFORM STREQUAL UNIX)
447+
elseif(PLATFORM STREQUAL "LINUX")
450448
list(APPEND CLI "--platform" "linux")
451-
elseif(PLATFORM STREQUAL WINDOWS)
449+
elseif(PLATFORM STREQUAL "WINDOWS")
452450
list(APPEND CLI "--platform" "windows")
451+
elseif(PLATFORM STREQUAL "ORBIS")
452+
list(APPEND CLI "--platform" "orbis")
453453
endif()
454454

455455
# --preprocess
@@ -576,7 +576,12 @@ if(TARGET bgfx::shaderc)
576576
cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" "${ARGN}")
577577

578578
set(PROFILES 120 300_es spirv)
579-
if(UNIX AND NOT APPLE)
579+
if(IOS)
580+
set(PLATFORM IOS)
581+
list(APPEND PROFILES metal)
582+
elseif(ANDROID)
583+
set(PLATFORM ANDROID)
584+
elseif(UNIX AND NOT APPLE)
580585
set(PLATFORM LINUX)
581586
elseif(EMSCRIPTEN)
582587
set(PLATFORM ASM_JS)
@@ -592,6 +597,9 @@ if(TARGET bgfx::shaderc)
592597
set(PLATFORM WINDOWS)
593598
list(APPEND PROFILES s_4_0)
594599
list(APPEND PROFILES s_5_0)
600+
elseif(ORBIS) # ORBIS should be defined by a PS4 CMake toolchain
601+
set(PLATFORM ORBIS)
602+
list(APPEND PROFILES pssl)
595603
else()
596604
# pssl for Agc and Gnm renderers
597605
# nvn for Nvn renderer

0 commit comments

Comments
 (0)