mirror of
https://github.com/bkaradzic/bgfx.cmake.git
synced 2026-02-18 05:13:04 +01:00
Fixed fcpp overflow error
This commit is contained in:
committed by
Joshua Brookover
parent
e5f453dd73
commit
aeda0f7c67
9
cmake/3rdparty/fcpp.cmake
vendored
9
cmake/3rdparty/fcpp.cmake
vendored
@@ -16,8 +16,17 @@ file( GLOB FCPP_SOURCES ${BGFX_DIR}/3rdparty/fcpp/*.c ${BGFX_DIR}/3rdparty/fcpp/
|
||||
|
||||
add_library( fcpp STATIC ${FCPP_SOURCES} )
|
||||
target_include_directories( fcpp PUBLIC ${BGFX_DIR}/3rdparty/fcpp )
|
||||
target_compile_definitions( fcpp
|
||||
PRIVATE
|
||||
NINCLUDE=64
|
||||
NWORK=65536
|
||||
NBUFF=65536
|
||||
OLD_PREPROCESSOR=0
|
||||
)
|
||||
|
||||
if( MSVC )
|
||||
set_target_properties( fcpp PROPERTIES COMPILE_FLAGS "/W0" )
|
||||
endif()
|
||||
|
||||
set_target_properties( fcpp PROPERTIES FOLDER "bgfx/3rdparty" )
|
||||
set_source_files_properties( ${BGFX_DIR}/3rdparty/fcpp/usecpp.c PROPERTIES HEADER_FILE_ONLY ON )
|
||||
|
||||
26
cmake/3rdparty/glsl-optimizer.cmake
vendored
26
cmake/3rdparty/glsl-optimizer.cmake
vendored
@@ -30,7 +30,7 @@ file( GLOB GLCPP_SOURCES ${BGFX_DIR}/3rdparty/glsl-optimizer/src/glsl/glcpp/*.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")
|
||||
target_compile_options( glcpp PRIVATE "-fno-strict-aliasing")
|
||||
endif()
|
||||
if( MSVC )
|
||||
set_target_properties( glcpp PROPERTIES COMPILE_FLAGS "/W0" )
|
||||
@@ -42,7 +42,7 @@ file( GLOB MESA_SOURCES ${BGFX_DIR}/3rdparty/glsl-optimizer/src/mesa/program/*.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")
|
||||
target_compile_options( mesa PRIVATE "-fno-strict-aliasing")
|
||||
endif()
|
||||
if( MSVC )
|
||||
set_target_properties( mesa PROPERTIES COMPILE_FLAGS "/W0" )
|
||||
@@ -56,9 +56,29 @@ 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")
|
||||
target_compile_options( glsl-optimizer
|
||||
PRIVATE
|
||||
-fno-strict-aliasing
|
||||
-Wno-implicit-fallthrough
|
||||
-Wno-parentheses
|
||||
-Wno-sign-compare
|
||||
-Wno-unused-function
|
||||
-Wno-unused-parameter
|
||||
)
|
||||
endif()
|
||||
if( MSVC )
|
||||
set_target_properties( glsl-optimizer PROPERTIES COMPILE_FLAGS "/W0" )
|
||||
target_compile_definitions( glsl-optimizer
|
||||
__STDC__
|
||||
__STDC_VERSION__=199901L
|
||||
strdup=_strdup
|
||||
alloca=_alloca
|
||||
isascii=__isascii
|
||||
)
|
||||
elseif(APPLE)
|
||||
target_compile_options( glsl-optimizer
|
||||
PRIVATE
|
||||
-Wno-deprecated-register
|
||||
)
|
||||
endif()
|
||||
set_target_properties( glsl-optimizer PROPERTIES FOLDER "bgfx/3rdparty" )
|
||||
|
||||
17
cmake/3rdparty/glslang.cmake
vendored
17
cmake/3rdparty/glslang.cmake
vendored
@@ -41,28 +41,36 @@ set_target_properties( glslang PROPERTIES FOLDER "bgfx/3rdparty" )
|
||||
if( MSVC )
|
||||
target_compile_options( glslang PRIVATE
|
||||
"/wd4005"
|
||||
"/wd4065"
|
||||
"/wd4100"
|
||||
"/wd4127"
|
||||
"/wd4189"
|
||||
"/wd4244"
|
||||
"/wd4310"
|
||||
"/wd4389"
|
||||
"/wd4456"
|
||||
"/wd4457"
|
||||
"/wd4458"
|
||||
"/wd4702"
|
||||
"/wd4715"
|
||||
"/wd4838"
|
||||
)
|
||||
else()
|
||||
target_compile_options( glslang PRIVATE
|
||||
"-Wno-deprecated-register"
|
||||
"-Wno-ignored-qualifiers"
|
||||
"-Wno-inconsistent-missing-override"
|
||||
"-Wno-implicit-fallthrough"
|
||||
"-Wno-missing-field-initializers"
|
||||
"-Wno-reorder"
|
||||
"-Wno-return-type"
|
||||
"-Wno-shadow"
|
||||
"-Wno-sign-compare"
|
||||
"-Wno-switch"
|
||||
"-Wno-undef"
|
||||
"-Wno-unknown-pragmas"
|
||||
"-Wno-unused-function"
|
||||
"-Wno-unused-parameter"
|
||||
"-Wno-unused-variable"
|
||||
"-fno-strict-aliasing"
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -70,6 +78,7 @@ if( APPLE )
|
||||
target_compile_options( glslang PRIVATE
|
||||
"-Wno-c++11-extensions"
|
||||
"-Wno-unused-const-variable"
|
||||
"-Wno-deprecated-register"
|
||||
)
|
||||
endif()
|
||||
|
||||
@@ -80,6 +89,6 @@ if( UNIX AND NOT APPLE )
|
||||
endif()
|
||||
|
||||
target_compile_definitions( glslang PRIVATE
|
||||
"ENABLE_OPT=1"
|
||||
"ENABLE_HLSL=1"
|
||||
ENABLE_OPT=1
|
||||
ENABLE_HLSL=1
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user