Fix Makefile

This commit is contained in:
msiglreith 2017-12-01 00:50:59 +01:00
parent d2dc11f229
commit f297339838
2 changed files with 8 additions and 7 deletions

View file

@ -5,7 +5,7 @@ TARGET=$(NATIVE_DIR)/test
OBJECTS=$(NATIVE_DIR)/test.o OBJECTS=$(NATIVE_DIR)/test.o
LIBRARY=target/debug/libportability.a LIBRARY=target/debug/libportability.a
CC=gcc CC=g++
CFLAGS=-ggdb -O0 -I$(VULKAN_DIR) CFLAGS=-ggdb -O0 -I$(VULKAN_DIR)
DEPS= DEPS=
LDFLAGS=-lpthread -ldl -lm -lX11 LDFLAGS=-lpthread -ldl -lm -lX11
@ -19,15 +19,15 @@ binding: $(BINDING)
$(BINDING): $(VULKAN_DIR)/vulkan/*.h $(BINDING): $(VULKAN_DIR)/vulkan/*.h
bindgen --no-layout-tests --rustfmt-bindings $(VULKAN_DIR)/vulkan/vulkan.h -o $(BINDING) bindgen --no-layout-tests --rustfmt-bindings $(VULKAN_DIR)/vulkan/vulkan.h -o $(BINDING)
$(LIBRARY): src/*.rs Cargo.toml Cargo.lock $(LIBRARY): src/*.rs Cargo.toml $(wildcard Cargo.lock)
cargo build cargo build
mkdir -p target/native mkdir -p target/native
$(NATIVE_DIR)/%.o: native/%.c $(DEPS) Makefile $(NATIVE_DIR)/%.o: native/%.cpp $(DEPS) Makefile
$(CC) -c -o $@ $< $(CFLAGS) $(CC) -c -o $@ $< $(CFLAGS)
$(TARGET): $(LIBRARY) $(OBJECTS) Makefile $(TARGET): $(LIBRARY) $(OBJECTS) Makefile
$(CC) -o $(TARGET) $(LDFLAGS) $(OBJECTS) $(LIBRARY) $(CC) -o $(TARGET) $(OBJECTS) $(LIBRARY) $(LDFLAGS)
run: $(TARGET) run: $(TARGET)
$(TARGET) $(TARGET)

View file

@ -5827,7 +5827,8 @@ pub fn vkCreateWin32SurfaceKHR(
pAllocator: *const VkAllocationCallbacks, pAllocator: *const VkAllocationCallbacks,
pSurface: *mut VkSurfaceRawKHR, pSurface: *mut VkSurfaceRawKHR,
) -> VkResult { ) -> VkResult {
if cfg!(target_os = "windows") { #[cfg(target_os = "windows")]
{
unsafe { unsafe {
assert_eq!((*pCreateInfos).flags, 0); assert_eq!((*pCreateInfos).flags, 0);
assert!(pAllocator.is_null()); assert!(pAllocator.is_null());
@ -5835,9 +5836,9 @@ pub fn vkCreateWin32SurfaceKHR(
*pSurface = Handle::new(instance.create_surface_from_hwnd((*pCreateInfos).hwnd)); *pSurface = Handle::new(instance.create_surface_from_hwnd((*pCreateInfos).hwnd));
VkResult::VK_SUCCESS VkResult::VK_SUCCESS
} }
} else {
unreachable!()
} }
#[cfg(not(target_os = "windows"))]
unreachable!()
} }
#[repr(C)] #[repr(C)]
#[derive(Debug, Copy)] #[derive(Debug, Copy)]