Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
libretro-minivmac
Commits
954ed805
Commit
954ed805
authored
Jan 26, 2022
by
Vladimir Serbinenko
Browse files
Compile for msvc
parent
f180777c
Changes
2
Hide whitespace changes
Inline
Side-by-side
.gitlab-ci.yml
View file @
954ed805
...
...
@@ -22,6 +22,18 @@ include:
# Windows 32-bit
-
project
:
'
libretro-infrastructure/ci-templates'
file
:
'
/windows-i686-mingw.yml'
# Windows msvc10 64-bit
-
project
:
'
libretro-infrastructure/ci-templates'
file
:
'
/windows-x64-msvc10-msys2.yml'
# Windows msvc10 32-bit
-
project
:
'
libretro-infrastructure/ci-templates'
file
:
'
/windows-i686-msvc10-msys2.yml'
# Windows msvc05 32-bit
-
project
:
'
libretro-infrastructure/ci-templates'
file
:
'
/windows-i686-msvc05-msys2.yml'
# Linux 64-bit
-
project
:
'
libretro-infrastructure/ci-templates'
...
...
@@ -129,6 +141,24 @@ libretro-build-windows-i686:
extends
:
-
.libretro-windows-i686-mingw-make-default
-
.core-defs
# Windows msvc10 64-bit
libretro-build-windows-msvc10-x64
:
extends
:
-
.libretro-windows-x64-msvc10-msys2-make-default
-
.core-defs
# Windows msvc10 32-bit
libretro-build-windows-msvc10-i686
:
extends
:
-
.libretro-windows-i686-msvc10-msys2-make-default
-
.core-defs
# Windows msvc05 32-bit
libretro-build-windows-msvc05-i686
:
extends
:
-
.libretro-windows-i686-msvc05-msys2-make-default
-
.core-defs
# Linux 64-bit
libretro-build-linux-x64
:
...
...
Makefile
View file @
954ed805
...
...
@@ -216,6 +216,91 @@ else ifeq ($(platform), gcw0)
DISABLE_ERROR_LOGGING
:=
1
CFLAGS
+=
-march
=
mips32
-mtune
=
mips32r2
-mhard-float
LIBS
=
-lm
# Windows MSVC 2010 x64
else
ifeq
($(platform), windows_msvc2010_x64)
CC
=
cl.exe
CXX
=
cl.exe
CFLAGS
+=
-wd4711
-wd4514
-wd4820
-DNO_VA_COPY
=
1
CXXFLAGS
+=
-wd4711
-wd4514
-wd4820
-DNO_VA_COPY
=
1
PATH
:=
$(
shell
IFS
=
$$
'\n'
;
cygpath
"
$(VS100COMNTOOLS)
../../VC/bin/amd64"
)
:
$(PATH)
PATH
:=
$(PATH)
:
$(
shell
IFS
=
$$
'\n'
;
cygpath
"
$(VS100COMNTOOLS)
../IDE"
)
LIB
:=
$(
shell
IFS
=
$$
'\n'
;
cygpath
"
$(VS100COMNTOOLS)
../../VC/lib/amd64"
)
INCLUDE
:=
$(
shell
IFS
=
$$
'\n'
;
cygpath
"
$(VS100COMNTOOLS)
../../VC/include"
)
WindowsSdkDir
:=
$(
shell
reg query
"HKLM
\S
OFTWARE
\M
icrosoft
\M
icrosoft SDKs
\W
indows
\v
7.1A"
-v
"InstallationFolder"
|
grep
-io
'[A-Z]:\\.*'
)
WindowsSdkDir
?=
$(
shell
reg query
"HKLM
\S
OFTWARE
\M
icrosoft
\M
icrosoft SDKs
\W
indows
\v
7.0A"
-v
"InstallationFolder"
|
grep
-io
'[A-Z]:\\.*'
)
WindowsSDKIncludeDir
:=
$(
shell
cygpath
-w
"
$(WindowsSdkDir)
\I
nclude"
)
WindowsSDKGlIncludeDir
:=
$(
shell
cygpath
-w
"
$(WindowsSdkDir)
\I
nclude
\g
l"
)
WindowsSDKLibDir
:=
$(
shell
cygpath
-w
"
$(WindowsSdkDir)
\L
ib
\x
64"
)
INCFLAGS_PLATFORM
=
-I
"
$(WindowsSdkDirInc)
"
export
INCLUDE
:=
$(INCLUDE)
;
$(WindowsSDKIncludeDir)
;
$(WindowsSDKGlIncludeDir)
;
$(CORE_DIR)
/libretro-common/include/compat/msvc
export
LIB
:=
$(LIB)
;
$(WindowsSDKLibDir)
TARGET
:=
$(TARGET_NAME)
_libretro.dll
LDFLAGS
+=
-DLL
LIBS
=
# Windows MSVC 2010 x86
else
ifeq
($(platform), windows_msvc2010_x86)
CC
=
cl.exe
CXX
=
cl.exe
CFLAGS
+=
-wd4711
-wd4514
-wd4820
-DNO_VA_COPY
=
1
CXXFLAGS
+=
-wd4711
-wd4514
-wd4820
-DNO_VA_COPY
=
1
PATH
:=
$(
shell
IFS
=
$$
'\n'
;
cygpath
"
$(VS100COMNTOOLS)
../../VC/bin"
)
:
$(PATH)
PATH
:=
$(PATH)
:
$(
shell
IFS
=
$$
'\n'
;
cygpath
"
$(VS100COMNTOOLS)
../IDE"
)
LIB
:=
$(
shell
IFS
=
$$
'\n'
;
cygpath
-w
"
$(VS100COMNTOOLS)
../../VC/lib"
)
INCLUDE
:=
$(
shell
IFS
=
$$
'\n'
;
cygpath
"
$(VS100COMNTOOLS)
../../VC/include"
)
WindowsSdkDir
?=
$(
shell
reg query
"HKLM
\S
OFTWARE
\M
icrosoft
\M
icrosoft SDKs
\W
indows
\v
7.1A"
-v
"InstallationFolder"
|
grep
-io
'[A-Z]:\\.*'
)
WindowsSdkDir
?=
$(
shell
reg query
"HKLM
\S
OFTWARE
\M
icrosoft
\M
icrosoft SDKs
\W
indows
\v
7.0A"
-v
"InstallationFolder"
|
grep
-io
'[A-Z]:\\.*'
)
WindowsSDKIncludeDir
:=
$(
shell
cygpath
-w
"
$(WindowsSdkDir)
\I
nclude"
)
WindowsSDKGlIncludeDir
:=
$(
shell
cygpath
-w
"
$(WindowsSdkDir)
\I
nclude
\g
l"
)
WindowsSDKLibDir
:=
$(
shell
cygpath
-w
"
$(WindowsSdkDir)
\L
ib"
)
INCFLAGS_PLATFORM
=
-I
"
$(WindowsSdkDirInc)
"
export
INCLUDE
:=
$(INCLUDE)
;
$(WindowsSDKIncludeDir)
;
$(WindowsSDKGlIncludeDir)
;
$(CORE_DIR)
/libretro-common/include/compat/msvc
export
LIB
:=
$(LIB)
;
$(WindowsSDKLibDir)
TARGET
:=
$(TARGET_NAME)
_libretro.dll
LDFLAGS
+=
-DLL
LIBS
=
# Windows MSVC 2005 x86
else
ifeq
($(platform), windows_msvc2005_x86)
CC
=
cl.exe
CXX
=
cl.exe
CFLAGS
+=
-wd4711
-wd4514
-wd4820
-DNO_VA_COPY
=
1
CXXFLAGS
+=
-wd4711
-wd4514
-wd4820
-DNO_VA_COPY
=
1
PATH
:=
$(
shell
IFS
=
$$
'\n'
;
cygpath
"
$(VS80COMNTOOLS)
../../VC/bin"
)
:
$(PATH)
PATH
:=
$(PATH)
:
$(
shell
IFS
=
$$
'\n'
;
cygpath
"
$(VS80COMNTOOLS)
../IDE"
)
INCLUDE
:=
$(
shell
IFS
=
$$
'\n'
;
cygpath
"
$(VS80COMNTOOLS)
../../VC/include"
)
LIB
:=
$(
shell
IFS
=
$$
'\n'
;
cygpath
-w
"
$(VS80COMNTOOLS)
../../VC/lib"
)
BIN
:=
$(
shell
IFS
=
$$
'\n'
;
cygpath
"
$(VS80COMNTOOLS)
../../VC/bin"
)
WindowsSdkDir
:=
$(
shell
reg query
"HKLM
\S
OFTWARE
\M
icrosoft
\M
icrosoftSDK
\I
nstalledSDKs
\8
F9E5EF3-A9A5-491B-A889-C58EFFECE8B3"
-v
"Install Dir"
|
grep
-o
'[A-Z]:\\.*'
)
WindowsSDKIncludeDir
:=
$(
shell
cygpath
-w
"
$(WindowsSdkDir)
\I
nclude"
)
WindowsSDKLibDir
:=
$(
shell
cygpath
-w
"
$(WindowsSdkDir)
\L
ib"
)
INCLUDE
:=
$(INCLUDE)
;
$(WindowsSDKIncludeDir)
;
$(WindowsSDKAtlIncludeDir)
;
$(WindowsSDKCrtIncludeDir)
;
$(WindowsSDKGlIncludeDir)
;
$(WindowsSDKMfcIncludeDir)
;
libretro/msvc/msvc-2005
LIB
:=
$(LIB)
;
$(WindowsSDKLibDir)
export
INCLUDE
:=
$(INCLUDE)
;
$(INETSDK)
/Include
;
$(CORE_DIR)
/libretro-common/include/compat/msvc
export
LIB
:=
$(LIB)
;
$(WindowsSdkDir)
;
$(INETSDK)
/Lib
TARGET
:=
$(TARGET_NAME)
_libretro.dll
PSS_STYLE
:=
2
LDFLAGS
+=
-DLL
CFLAGS
+=
-D_CRT_SECURE_NO_DEPRECATE
LIBS
=
else
CC
?=
gcc
...
...
@@ -233,27 +318,36 @@ include Makefile.common
OBJECTS
:=
$(SOURCES_C:.c=.o)
CFLAGS
+=
-DMAC2
=
1
\
-std
=
gnu99
\
-O3
\
-finline-functions
\
-funroll-loops
\
-fsigned-char
\
-Wno-strict-prototypes
\
-ffast-math
\
-fomit-frame-pointer
\
-fno-strength-reduce
\
-fno-builtin
\
-finline-functions
\
-D__LIBRETRO__
-DFRONTEND_SUPPORTS_RGB565
CFLAGS
+=
-DMAC2
=
1
-D__LIBRETRO__
-DFRONTEND_SUPPORTS_RGB565
ifeq
(,$(findstring msvc,$(platform)))
CFLAGS
+=
-std
=
gnu99
\
-O3
\
-finline-functions
\
-funroll-loops
\
-fsigned-char
\
-Wno-strict-prototypes
\
-ffast-math
\
-fomit-frame-pointer
\
-fno-strength-reduce
\
-fno-builtin
\
-finline-functions
endif
LDFLAGS
+=
-lm
OBJOUT
=
-o
ifneq
(,$(findstring msvc,$(platform)))
OBJOUT
=
-Fo
endif
all
:
$(TARGET)
$(TARGET)
:
$(OBJECTS)
ifeq
($(platform), emscripten)
$(LD)
$(fpic)
$(SHARED)
$(LDFLAGS)
-o
$@
$(OBJECTS)
$(LIBS)
else
ifneq
(,$(findstring msvc,$(platform)))
link.exe -out
:
$@ $(OBJECTS) $(LDFLAGS) $(LIBS)
else
ifeq
($(STATIC_LINKING),1)
$(AR)
rcs
$@
$(OBJECTS)
else
...
...
@@ -261,7 +355,7 @@ else
endif
%.o
:
%.c
$(CC)
$(fpic)
$(CFLAGS)
$(INCFLAGS)
-c
-o
$@
$<
$(CC)
$(fpic)
$(CFLAGS)
$(INCFLAGS)
-c
$(OBJOUT)
$@
$<
clean
:
rm
-f
$(OBJECTS)
$(TARGET)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment