Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions docs/how/cmake_bgfx/cmake/CMakeTSLANGInformation.cmake
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
# bx propagates -msse4.2 via PUBLIC compile options on GCC/Clang. tslang does
# not accept those flags, so filter them through a small wrapper on Unix.
# not accept those flags, so filter them through a small portable wrapper
# invoked via `cmake -P` (works the same under Ninja on Windows and Unix,
# unlike a #!/usr/bin/env bash script which Ninja cannot exec on Windows).
get_filename_component(_TSLANG_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" DIRECTORY)
set(_TSLANG_COMPILE_TEMPLATE
"<CMAKE_TSLANG_COMPILER> <FLAGS> --default-lib-path=${CMAKE_TSLANG_DIR} --emit=obj --export=none -o=<OBJECT> <SOURCE>")
if(NOT CMAKE_TSLANG_COMPILE_OBJECT)
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
set(CMAKE_TSLANG_COMPILE_OBJECT
"${_TSLANG_CMAKE_DIR}/tslang_compile.sh ${_TSLANG_COMPILE_TEMPLATE}")
else()
set(CMAKE_TSLANG_COMPILE_OBJECT "${_TSLANG_COMPILE_TEMPLATE}")
endif()
set(CMAKE_TSLANG_COMPILE_OBJECT
"\"${CMAKE_COMMAND}\" -P \"${_TSLANG_CMAKE_DIR}/tslang_filter_flags.cmake\" -- ${_TSLANG_COMPILE_TEMPLATE}")
endif()

if(NOT CMAKE_TSLANG_LINK_EXECUTABLE)
Expand Down
8 changes: 7 additions & 1 deletion docs/how/cmake_bgfx/cmake/LocateTSLang.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,16 @@ function(setup_tslang_link_paths)
message(FATAL_ERROR "setup_tslang_link_paths: TSLANG_PREFIX is not set")
endif()

if(CMAKE_BUILD_TYPE STREQUAL "Release")
set(_defaultlib_config "release")
else()
set(_defaultlib_config "debug")
endif()

set(_link_dirs
"${TSLANG_BIN_DIR}"
"${TSLANG_PREFIX}/lib"
"${TSLANG_BIN_DIR}/defaultlib/lib")
"${TSLANG_BIN_DIR}/defaultlib/lib/${_defaultlib_config}")

if(TSLANG_ROOT)
if(EXISTS "${TSLANG_ROOT}/gc/release")
Expand Down
14 changes: 0 additions & 14 deletions docs/how/cmake_bgfx/cmake/tslang_compile.sh

This file was deleted.

34 changes: 34 additions & 0 deletions docs/how/cmake_bgfx/cmake/tslang_filter_flags.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Filter C++ CPU flags that linked targets (bx/bgfx) export via PUBLIC
# compile options. tslang does not accept those flags.
#
# Invoked as:
# cmake -P tslang_filter_flags.cmake -- <compiler> <args...>
#
# Everything after the literal "--" argument is forwarded, with the
# blocked flags removed, to COMMAND.
#
# Note: CMAKE_ARGV<n> is indexed access (CMAKE_ARGC gives the count); there
# is no plain CMAKE_ARGV list variable.

set(_args)
set(_seen_dashdash FALSE)
math(EXPR _last "${CMAKE_ARGC} - 1")
foreach(_i RANGE 0 ${_last})
set(_raw_arg "${CMAKE_ARGV${_i}}")
if(NOT _seen_dashdash)
if(_raw_arg STREQUAL "--")
set(_seen_dashdash TRUE)
endif()
continue()
endif()

if(_raw_arg MATCHES "^-m(sse4\\.2|sse4\\.1|avx|avx2)$")
continue()
endif()
list(APPEND _args "${_raw_arg}")
endforeach()

execute_process(COMMAND ${_args} RESULT_VARIABLE _result)
if(NOT _result EQUAL 0)
message(FATAL_ERROR "tslang compile failed (exit ${_result})")
endif()
2 changes: 1 addition & 1 deletion tag.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
git tag -a v0.0-pre-alpha78 -m "pre alpha v0.0-78"
git tag -a v0.0-pre-alpha79 -m "pre alpha v0.0-79"
git push origin --tags
4 changes: 2 additions & 2 deletions tag_del.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
git push --delete origin v0.0-pre-alpha78
git tag -d v0.0-pre-alpha78
git push --delete origin v0.0-pre-alpha79
git tag -d v0.0-pre-alpha79
Loading