Skip to content
This repository was archived by the owner on May 21, 2025. It is now read-only.

Commit 9e6c06d

Browse files
committed
Build debug with mvsc
1 parent a3ffb99 commit 9e6c06d

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

.github/workflows/build-unoptimized.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ jobs:
4040
runs-on: windows-latest
4141
steps:
4242
- uses: actions/checkout@v4
43-
# TODO: build using MSVC. It currently errors and warns on a whole bunch of stuff
44-
# Also yes, that requires either shenanigans or a seperate action. - uses: ilammy/msvc-dev-cmd@v1
43+
# Build using MSVC. It currently warns on a bit of stuff because apparently -Wall warns on basically everything
44+
# Also yes, using mvsc requires either shenanigans or a seperate action.
45+
- uses: ilammy/msvc-dev-cmd@v1
4546
- name: Make target ${{ matrix.target }}
46-
run: $env:TARGET='${{ matrix.target }}'; make
47+
run: $env:CXX='cl.exe'; $env:TARGET='${{ matrix.target }}'; make

Makefile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,10 @@
33
SRCDIR := $(abspath $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST))))))
44

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

912
CFLAGS_G = -fno-rtti -fno-exceptions -DNDEBUG -Wall
@@ -52,6 +55,14 @@ ifeq ($(TARGET),)
5255
endif
5356
endif
5457

58+
ifeq ($(TARGET),windows)
59+
ifneq (,$(filter $(CXX),cl cl.exe))
60+
override CFLAGS_windows := $(CFLAGS_windows_base)
61+
LFLAGS += $(LFLAGS_windows_msvc)
62+
endif
63+
64+
endif
65+
5566
ifeq ($(TARGET),gtk)
5667
ifeq ($(GTKFLAGS),)
5768
GTKFLAGS := $(shell pkg-config --cflags --libs gtk+-3.0)

0 commit comments

Comments
 (0)