Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some minor error and warning fixes for MinGW and MSVC #9

Closed
wants to merge 7 commits into from
Closed
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
164 changes: 87 additions & 77 deletions premake/shaderc.lua
Original file line number Diff line number Diff line change
@@ -1,77 +1,87 @@
project "shaderc"
uuid "f3cd2e90-52a4-11e1-b86c-0800200c9a66"
kind "ConsoleApp"

local GLSL_OPTIMIZER = (BGFX_DIR .. "3rdparty/glsl-optimizer/")
local FCPP_DIR = (BGFX_DIR .. "3rdparty/fcpp/")

configuration { "vs*" }
includedirs {
GLSL_OPTIMIZER .. "src/glsl/msvc",
}

configuration { "windows", "vs*" }
includedirs {
GLSL_OPTIMIZER .. "include/c99",
}

configuration { "windows" }
includedirs {
"$(DXSDK_DIR)/include",
}

links {
"d3dx9",
"d3dcompiler",
"dxguid",
}

configuration {}

defines { -- fcpp
"NINCLUDE=64",
"NWORK=65536",
"NBUFF=65536",
}

includedirs {
BX_DIR .. "include",

FCPP_DIR,

GLSL_OPTIMIZER .. "include",
GLSL_OPTIMIZER .. "src/mesa",
GLSL_OPTIMIZER .. "src/mapi",
GLSL_OPTIMIZER .. "src/glsl",
}

files {
BGFX_DIR .. "tools/shaderc/**.cpp",
BGFX_DIR .. "tools/shaderc/**.h",
FCPP_DIR .. "**.h",
FCPP_DIR .. "cpp1.c",
FCPP_DIR .. "cpp2.c",
FCPP_DIR .. "cpp3.c",
FCPP_DIR .. "cpp4.c",
FCPP_DIR .. "cpp5.c",
FCPP_DIR .. "cpp6.c",
FCPP_DIR .. "cpp6.c",

GLSL_OPTIMIZER .. "src/mesa/**.c",
GLSL_OPTIMIZER .. "src/glsl/**.cpp",
GLSL_OPTIMIZER .. "src/mesa/**.h",
GLSL_OPTIMIZER .. "src/glsl/**.c",
GLSL_OPTIMIZER .. "src/glsl/**.cpp",
GLSL_OPTIMIZER .. "src/glsl/**.h",
}

excludes {
GLSL_OPTIMIZER .. "src/glsl/glcpp/glcpp.c",
GLSL_OPTIMIZER .. "src/glsl/glcpp/tests/**",
GLSL_OPTIMIZER .. "src/glsl/glcpp/**.l",
GLSL_OPTIMIZER .. "src/glsl/glcpp/**.y",
GLSL_OPTIMIZER .. "src/glsl/ir_set_program_inouts.cpp",
GLSL_OPTIMIZER .. "src/glsl/main.cpp",
GLSL_OPTIMIZER .. "src/glsl/builtin_stubs.cpp",
}

project "shaderc"
uuid "f3cd2e90-52a4-11e1-b86c-0800200c9a66"
kind "ConsoleApp"

local GLSL_OPTIMIZER = (BGFX_DIR .. "3rdparty/glsl-optimizer/")
local FCPP_DIR = (BGFX_DIR .. "3rdparty/fcpp/")

configuration { "vs*" }
includedirs {
GLSL_OPTIMIZER .. "src/glsl/msvc",
}

configuration { "windows", "vs*" }
buildoptions {
"/wd\"4005\"", -- disable warning: macro redefinition
"/wd\"4018\"", -- disable warning: signed/unsigned mismatch
"/wd\"4065\"", -- disable warning: switch statement contains 'default' but no 'case' labels
"/wd\"4090\"", -- disable warning: 'function' : different 'const' qualifiers
"/wd\"4099\"", -- disable warning: type name first seen using 'class' now seen using 'struct'
"/wd\"4244\"", -- disable warning: conversion from 'double' to 'float'
"/wd\"4345\"", -- disable warning: behavior change: an object of POD type constructed with an initializer of the form () will be default-initialized
"/wd\"4800\"", -- disable warning: forcing value to bool 'true' or 'false'
}
includedirs {
GLSL_OPTIMIZER .. "include/c99",
}

configuration { "windows" }
includedirs {
"$(DXSDK_DIR)/include",
}

links {
"d3dx9",
"d3dcompiler",
"dxguid",
}

configuration {}

defines { -- fcpp
"NINCLUDE=64",
"NWORK=65536",
"NBUFF=65536",
}

includedirs {
BX_DIR .. "include",

FCPP_DIR,

GLSL_OPTIMIZER .. "include",
GLSL_OPTIMIZER .. "src/mesa",
GLSL_OPTIMIZER .. "src/mapi",
GLSL_OPTIMIZER .. "src/glsl",
}

files {
BGFX_DIR .. "tools/shaderc/**.cpp",
BGFX_DIR .. "tools/shaderc/**.h",
FCPP_DIR .. "**.h",
FCPP_DIR .. "cpp1.c",
FCPP_DIR .. "cpp2.c",
FCPP_DIR .. "cpp3.c",
FCPP_DIR .. "cpp4.c",
FCPP_DIR .. "cpp5.c",
FCPP_DIR .. "cpp6.c",
FCPP_DIR .. "cpp6.c",

GLSL_OPTIMIZER .. "src/mesa/**.c",
GLSL_OPTIMIZER .. "src/glsl/**.cpp",
GLSL_OPTIMIZER .. "src/mesa/**.h",
GLSL_OPTIMIZER .. "src/glsl/**.c",
GLSL_OPTIMIZER .. "src/glsl/**.cpp",
GLSL_OPTIMIZER .. "src/glsl/**.h",
}

excludes {
GLSL_OPTIMIZER .. "src/glsl/glcpp/glcpp.c",
GLSL_OPTIMIZER .. "src/glsl/glcpp/tests/**",
GLSL_OPTIMIZER .. "src/glsl/glcpp/**.l",
GLSL_OPTIMIZER .. "src/glsl/glcpp/**.y",
GLSL_OPTIMIZER .. "src/glsl/ir_set_program_inouts.cpp",
GLSL_OPTIMIZER .. "src/glsl/main.cpp",
GLSL_OPTIMIZER .. "src/glsl/builtin_stubs.cpp",
}

7 changes: 5 additions & 2 deletions src/bgfx_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,14 @@ namespace tinystl
# include <TINYSTL/unordered_set.h>
namespace stl = tinystl;
#else
namespace std { namespace tr1 {} using namespace tr1; } // namespace std
# include <string>
# include <unordered_map>
# include <unordered_set>
namespace stl = std;
namespace std { namespace tr1 {} }
namespace stl {
using namespace std;
using namespace std::tr1;
}
#endif // BGFX_CONFIG_USE_TINYSTL
#include <list>

Expand Down