mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-11 13:38:35 +00:00
Make imgui build successfully with directx even when not on windows
This commit is contained in:
parent
041098da85
commit
b97bb58a56
@ -21,6 +21,7 @@ travis-ci = { repository = "Gekkio/imgui-rs" }
|
||||
gfx = "0.18"
|
||||
imgui = { version = "0.0.24-pre", path = "../" }
|
||||
imgui-sys = { version = "0.0.24-pre", path = "../imgui-sys", features = ["gfx"] }
|
||||
cfg-if = "0.1"
|
||||
|
||||
[target.'cfg(windows)'.build-dependencies]
|
||||
winapi = { version = "0.3", features = ["d3dcompiler"] }
|
||||
|
||||
@ -168,19 +168,19 @@ impl Shaders {
|
||||
include_bytes!("shader/glsles_100.frag"),
|
||||
),
|
||||
HlslSm40 => {
|
||||
#[cfg(not(feature = "directx"))]
|
||||
{
|
||||
// panic instead?
|
||||
(&[0], &[0])
|
||||
cfg_if::cfg_if! {
|
||||
if #[cfg(all(feature = "directx", windows))] {
|
||||
const HLSL_BYTECODE: (&[u8], &[u8]) = (
|
||||
include_bytes!(concat!(env!("OUT_DIR"), "/hlsl_vertex_shader_bytecode")),
|
||||
include_bytes!(concat!(env!("OUT_DIR"), "/hlsl_pixel_shader_bytecode")),
|
||||
);
|
||||
} else {
|
||||
// panic instead?
|
||||
const HLSL_BYTECODE: (&[u8], &[u8]) = (&[0], &[0]);
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "directx")]
|
||||
{
|
||||
(
|
||||
include_bytes!(concat!(env!("OUT_DIR"), "/hlsl_vertex_shader_bytecode")),
|
||||
include_bytes!(concat!(env!("OUT_DIR"), "/hlsl_pixel_shader_bytecode")),
|
||||
)
|
||||
}
|
||||
HLSL_BYTECODE
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user