Merge pull request #2382 from openmv/clang_imlib

misc: Add support for building specific imlib files with clang.
This commit is contained in:
Ibrahim Abdelkader 2024-08-21 11:43:50 +03:00 committed by GitHub
commit b56df8dc1f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 11 additions and 0 deletions

View File

@ -17,6 +17,7 @@ endif
# Commands
CC = $(Q)arm-none-eabi-gcc
CLANG = $(Q)clang
CXX = $(Q)arm-none-eabi-g++
AS = $(Q)arm-none-eabi-as
LD = $(Q)arm-none-eabi-ld

View File

@ -109,6 +109,10 @@ SRCS += $(addprefix imlib/, \
SRCS += $(wildcard ports/$(PORT)/*.c)
OBJS = $(addprefix $(BUILD)/, $(SRCS:.c=.o))
ifeq ($(USE_CLANG),1)
CLANG_OBJS = $(BUILD)/imlib/bayer.o
endif
OBJ_DIRS = $(sort $(dir $(OBJS)))
all: | $(OBJ_DIRS) $(OBJS)
@ -123,6 +127,11 @@ $(BUILD)/%.o : %.s
$(ECHO) "AS $<"
$(AS) $(AFLAGS) $< -o $@
# Rule for compiling with clang
$(CLANG_OBJS): $(BUILD)/%.o : %.c
$(ECHO) "CL $<"
$(CLANG) $(CLANG_FLAGS) -c -o $@ $<
$(BUILD)/imlib/fmath.o: override CFLAGS += -fno-strict-aliasing
-include $(OBJS:%.o=%.d)

View File

@ -11,6 +11,7 @@
# Export Commands
export Q
export CC
export CLANG
export CXX
export AS
export LD