mirror of
https://github.com/KhronosGroup/SPIRV-Cross.git
synced 2024-11-15 00:11:06 +00:00
9bbdccddb7
This adds a new C API for SPIRV-Cross which is intended to be stable, both API and ABI wise. The C++ API has been refactored a bit to make the C wrapper easier and cleaner to write. Especially the vertex attribute / resource interfaces for MSL has been rewritten to avoid taking mutable pointers into the interface. This would be very annoying to wrap and it didn't fit well with the rest of the C++ API to begin with. While doing this, I went ahead and removed all the old deprecated interfaces. The CMake build system has also seen an overhaul. It is now possible to build static/shared/CLI separately with -D options. The shared library only exposes the C API, as it is the only ABI-stable API. pkg-configs as well as CMake modules are exported and installed for the shared library configuration.
42 lines
795 B
Makefile
42 lines
795 B
Makefile
TARGET := spirv-cross
|
|
|
|
SOURCES := $(wildcard spirv_*.cpp)
|
|
CLI_SOURCES := main.cpp
|
|
|
|
OBJECTS := $(SOURCES:.cpp=.o)
|
|
CLI_OBJECTS := $(CLI_SOURCES:.cpp=.o)
|
|
|
|
STATIC_LIB := lib$(TARGET).a
|
|
|
|
DEPS := $(OBJECTS:.o=.d) $(CLI_OBJECTS:.o=.d)
|
|
|
|
CXXFLAGS += -std=c++11 -Wall -Wextra -Wshadow
|
|
|
|
ifeq ($(DEBUG), 1)
|
|
CXXFLAGS += -O0 -g
|
|
else
|
|
CXXFLAGS += -O2 -DNDEBUG
|
|
endif
|
|
|
|
ifeq ($(SPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS), 1)
|
|
CXXFLAGS += -DSPIRV_CROSS_EXCEPTIONS_TO_ASSERTIONS -fno-exceptions
|
|
endif
|
|
|
|
all: $(TARGET)
|
|
|
|
-include $(DEPS)
|
|
|
|
$(TARGET): $(CLI_OBJECTS) $(STATIC_LIB)
|
|
$(CXX) -o $@ $(CLI_OBJECTS) $(STATIC_LIB) $(LDFLAGS)
|
|
|
|
$(STATIC_LIB): $(OBJECTS)
|
|
$(AR) rcs $@ $(OBJECTS)
|
|
|
|
%.o: %.cpp
|
|
$(CXX) -c -o $@ $< $(CXXFLAGS) -MMD
|
|
|
|
clean:
|
|
rm -f $(TARGET) $(OBJECTS) $(CLI_OBJECTS) $(STATIC_LIB) $(DEPS)
|
|
|
|
.PHONY: clean
|