Skip to content

Commit

Permalink
Build debug with mvsc
Browse files Browse the repository at this point in the history
  • Loading branch information
Miepee committed May 30, 2024
1 parent a3ffb99 commit 9e6c06d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/build-unoptimized.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ jobs:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
# TODO: build using MSVC. It currently errors and warns on a whole bunch of stuff
# Also yes, that requires either shenanigans or a seperate action. - uses: ilammy/msvc-dev-cmd@v1
# Build using MSVC. It currently warns on a bit of stuff because apparently -Wall warns on basically everything
# Also yes, using mvsc requires either shenanigans or a seperate action.
- uses: ilammy/msvc-dev-cmd@v1
- name: Make target ${{ matrix.target }}
run: $env:TARGET='${{ matrix.target }}'; make
run: $env:CXX='cl.exe'; $env:TARGET='${{ matrix.target }}'; make
13 changes: 12 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
SRCDIR := $(abspath $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST))))))

CFLAGS_gtk = -DFLIPS_GTK $(GTKFLAGS) $(GTKLIBS)
CFLAGS_windows := -DFLIPS_WINDOWS -mwindows -lgdi32 -lcomdlg32 -lcomctl32 -luser32 -lkernel32 -lshell32 -ladvapi32
CFLAGS_windows_base := -DFLIPS_WINDOWS
CFLAGS_windows_gcc := -mwindows -lgdi32 -lcomdlg32 -lcomctl32 -luser32 -lkernel32 -lshell32 -ladvapi32
CFLAGS_windows := $(CFLAGS_windows_base) $(CFLAGS_windows_gcc)
LFLAGS_windows_msvc := gdi32.lib comdlg32.lib comctl32.lib user32.lib kernel32.lib shell32.lib advapi32.lib
CFLAGS_cli := -DFLIPS_CLI

CFLAGS_G = -fno-rtti -fno-exceptions -DNDEBUG -Wall
Expand Down Expand Up @@ -52,6 +55,14 @@ ifeq ($(TARGET),)
endif
endif

ifeq ($(TARGET),windows)
ifneq (,$(filter $(CXX),cl cl.exe))
override CFLAGS_windows := $(CFLAGS_windows_base)
LFLAGS += $(LFLAGS_windows_msvc)
endif

endif

ifeq ($(TARGET),gtk)
ifeq ($(GTKFLAGS),)
GTKFLAGS := $(shell pkg-config --cflags --libs gtk+-3.0)
Expand Down

0 comments on commit 9e6c06d

Please sign in to comment.