Skip to content

Commit

Permalink
mk: reorganize the link flags, add dbghelp under Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
jpcima committed Sep 27, 2020
1 parent b73955f commit fcca631
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 20 deletions.
26 changes: 26 additions & 0 deletions common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ SFIZZ_CPU_AARCH64 := 1
SFIZZ_CPU_ARM_OR_AARCH64 := 1
endif

ifneq (,$(findstring linux,$(SFIZZ_MACHINE)))
SFIZZ_OS_LINUX := 1
endif
ifneq (,$(findstring mingw,$(SFIZZ_MACHINE)))
SFIZZ_OS_WINDOWS := 1
endif

###

SFIZZ_C_FLAGS = -I$(SFIZZ_DIR)/src
Expand Down Expand Up @@ -227,6 +234,10 @@ SFIZZ_SOURCES += \
SFIZZ_SOURCES += \
external/abseil-cpp/absl/numeric/int128.cc

ifdef SFIZZ_OS_WINDOWS
SFIZZ_LINK_FLAGS += -ldbghelp
endif

### Spline dependency

SFIZZ_C_FLAGS += -I$(SFIZZ_DIR)/src/external/spline
Expand Down Expand Up @@ -263,5 +274,20 @@ SFIZZ_SOURCES += \
src/external/tunings/src/Tunings.cpp

### jsl dependency

SFIZZ_CXX_FLAGS += \
-I$(SFIZZ_DIR)/external/jsl/include

### math dependency

ifdef SFIZZ_OS_LINUX
SFIZZ_LINK_FLAGS += -lm
endif

### pthread dependency

ifdef SFIZZ_OS_LINUX
SFIZZ_C_FLAGS += -pthread
SFIZZ_CXX_FLAGS += -pthread
SFIZZ_LINK_FLAGS += -pthread
endif
10 changes: 0 additions & 10 deletions dpf.mk
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,6 @@ SFIZZ_LINK_FLAGS = $(SFIZZ_BUILD_DIR)/libsfizz.a
SFIZZ_PKG_CONFIG ?= $(PKG_CONFIG)
include $(SFIZZ_DIR)/common.mk

ifeq ($(LINUX),true)
SFIZZ_C_FLAGS += -pthread
SFIZZ_CXX_FLAGS += -pthread
SFIZZ_LINK_FLAGS += -pthread
endif

ifeq ($(LINUX),true)
SFIZZ_LINK_FLAGS += -lm
endif

sfizz-all: sfizz-lib

sfizz-lib: $(SFIZZ_BUILD_DIR)/libsfizz.a
Expand Down
10 changes: 0 additions & 10 deletions rack.mk
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,6 @@ include $(SFIZZ_DIR)/common.mk

###

ifdef ARCH_LIN
SFIZZ_C_FLAGS += -pthread
SFIZZ_CXX_FLAGS += -pthread
SFIZZ_LINK_FLAGS += -pthread
endif

ifdef ARCH_LIN
SFIZZ_LINK_FLAGS += -lm
endif

SFIZZ_TARGET := $(SFIZZ_BUILD_DIR)/libsfizz.a

###
Expand Down

0 comments on commit fcca631

Please sign in to comment.