Skip to content

Commit

Permalink
change default compilation to release for C API
Browse files Browse the repository at this point in the history
Originally I was trying to add a variable to determine which mode to use but Make is very annoying and convoluted sometimes that this just made things more complicated than they needed to be. Defaulting to release mode so when the user agent(s) build the bindings, they don't have to change the mode
  • Loading branch information
Kiyoshika committed Dec 2, 2023
1 parent 608003a commit eb2f1a2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions crates/gosub-bindings/Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# "global" compile settings
CFLAGS_DEBUG := -std=c99 -g -Wall -Wextra -O0
CFLAGS_RELEASE := -std=c99 -Wall -Wextra -O2
CFLAGS := $(CFLAGS_RELEASE) # *** CONFIGURE RELEASE OR DUBUG MODE ***

INCLUDE_DIR := include
SRC_DIR := src
CPPFLAGS := -I$(INCLUDE_DIR) -I$(INCLUDE_DIR)/nodes
CFLAGS_DEBUG := -std=c99 -g -Wall -Wextra -O0
CFLAGS_RELEASE := -std=c99 -Wall -Wextra -O2
CFLAGS := $(CFLAGS_DEBUG)
CC := gcc
TARGET_DIR := ../../target/debug

LDFLAGS := -L$(TARGET_DIR)
NODE_SRC_DIR := $(SRC_DIR)/nodes

bindings: # build gosub static library to be used externally
$(CC) $(CFLAGS) $(CPPFLAGS) -c $(SRC_DIR)/gosub_api.c $(SRC_DIR)/nodes.c $(NODE_SRC_DIR)/text.c
ar rcs libgosub.a gosub_api.o nodes.o text.o
Expand Down

0 comments on commit eb2f1a2

Please sign in to comment.