mirror of
https://github.com/bkaradzic/bgfx.cmake.git
synced 2026-02-19 05:43:00 +01:00
Fix shaderc:glsloptimizer requires -fno-strict-aliasing
This commit is contained in:
9
cmake/3rdparty/glsl-optimizer.cmake
vendored
9
cmake/3rdparty/glsl-optimizer.cmake
vendored
@@ -24,6 +24,9 @@ set( GLSL-OPTIMIZER_INCLUDES
|
||||
file( GLOB GLCPP_SOURCES ${BGFX_DIR}/3rdparty/glsl-optimizer/src/glsl/glcpp/*.c ${BGFX_DIR}/3rdparty/glsl-optimizer/src/util/*.c )
|
||||
add_library( glcpp ${GLCPP_SOURCES} )
|
||||
target_include_directories( glcpp PUBLIC ${GLSL-OPTIMIZER_INCLUDES} )
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
target_compile_options( glcpp PRIVATE "-fno-strict-aliasing")
|
||||
endif()
|
||||
if( MSVC )
|
||||
set_target_properties( glcpp PROPERTIES COMPILE_FLAGS "/W0" )
|
||||
endif()
|
||||
@@ -33,6 +36,9 @@ set_target_properties( glcpp PROPERTIES FOLDER "bgfx/3rdparty" )
|
||||
file( GLOB MESA_SOURCES ${BGFX_DIR}/3rdparty/glsl-optimizer/src/mesa/program/*.c ${BGFX_DIR}/3rdparty/glsl-optimizer/src/mesa/main/*.c )
|
||||
add_library( mesa ${MESA_SOURCES} )
|
||||
target_include_directories( mesa PUBLIC ${GLSL-OPTIMIZER_INCLUDES} )
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "GNU" OR CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
target_compile_options( mesa PRIVATE "-fno-strict-aliasing")
|
||||
endif()
|
||||
if( MSVC )
|
||||
set_target_properties( mesa PROPERTIES COMPILE_FLAGS "/W0" )
|
||||
endif()
|
||||
@@ -44,6 +50,9 @@ file( GLOB GLSL-OPTIMIZER_SOURCES_REMOVE ${BGFX_DIR}/3rdparty/glsl-optimizer/src
|
||||
list( REMOVE_ITEM GLSL-OPTIMIZER_SOURCES ${GLSL-OPTIMIZER_SOURCES_REMOVE} )
|
||||
add_library( glsl-optimizer ${GLSL-OPTIMIZER_SOURCES} )
|
||||
target_link_libraries( glsl-optimizer glcpp mesa )
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||
target_compile_options( glsl-optimizer PRIVATE "-fno-strict-aliasing")
|
||||
endif()
|
||||
if( MSVC )
|
||||
set_target_properties( glsl-optimizer PROPERTIES COMPILE_FLAGS "/W0" )
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user