Skip to content

Commit 4c1f554

Browse files
committed
fix(Makefile): move linker flags definition
1 parent 5390b72 commit 4c1f554

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

Makefile

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,18 @@ COV_FILES = $(filter-out $(SRC_DIR)/lz4.c $(SRC_DIR)/network.c, $(SRC_FILES))
5656
CURL_LIB = $(CURL_DIR)/$(PLATFORM)/libcurl.a
5757
TEST_TARGET = $(patsubst %.c,$(DIST_DIR)/%$(EXE), $(notdir $(TEST_SRC)))
5858

59+
# Native network support only for Apple platforms
60+
ifdef NATIVE_NETWORK
61+
RELEASE_OBJ += $(patsubst %.m, $(BUILD_RELEASE)/%_m.o, $(notdir $(wildcard $(SRC_DIR)/*.m)))
62+
LDFLAGS = -framework Foundation
63+
CFLAGS += -DCLOUDSYNC_OMIT_CURL
64+
65+
$(BUILD_RELEASE)/%_m.o: %.m
66+
$(CC) $(CFLAGS) -fobjc-arc -O3 -fPIC -c $< -o $@
67+
else
68+
LDFLAGS = -L./$(CURL_DIR)/$(PLATFORM) -lcurl
69+
endif
70+
5971
# Platform-specific settings
6072
ifeq ($(PLATFORM),windows)
6173
TARGET := $(DIST_DIR)/cloudsync.dll
@@ -127,18 +139,6 @@ endif
127139
T_LDFLAGS += -fprofile-arcs -ftest-coverage
128140
endif
129141

130-
# Native network support only for Apple platforms
131-
ifdef NATIVE_NETWORK
132-
RELEASE_OBJ += $(patsubst %.m, $(BUILD_RELEASE)/%_m.o, $(notdir $(wildcard $(SRC_DIR)/*.m)))
133-
LDFLAGS += -framework Foundation
134-
CFLAGS += -DCLOUDSYNC_OMIT_CURL
135-
136-
$(BUILD_RELEASE)/%_m.o: %.m
137-
$(CC) $(CFLAGS) -fobjc-arc -O3 -fPIC -c $< -o $@
138-
else
139-
LDFLAGS += -L./$(CURL_DIR)/$(PLATFORM) -lcurl
140-
endif
141-
142142
# Windows .def file generation
143143
$(DEF_FILE):
144144
ifeq ($(PLATFORM),windows)

0 commit comments

Comments
 (0)