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-2048
Commits
bc05dc6e
Commit
bc05dc6e
authored
Dec 29, 2018
by
Libretro-Admin
Browse files
Add MSVC2017 target
parent
8aa7dfdc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Makefile.libretro
View file @
bc05dc6e
...
...
@@ -419,6 +419,94 @@ PSS_STYLE :=2
LDFLAGS
+=
-DLL
CFLAGS
+=
-D_CRT_SECURE_NO_DEPRECATE
# Windows MSVC 2017 all architectures
else
ifneq
(,$(findstring windows_msvc2017,$(platform)))
PlatformSuffix
=
$(
subst
windows_msvc2017_,,
$(platform)
)
ifneq
(,$(findstring desktop,$(PlatformSuffix)))
WinPartition
=
desktop
MSVC2017CompileFlags
=
-DWINAPI_FAMILY
=
WINAPI_FAMILY_DESKTOP_APP
-FS
LDFLAGS
+=
-MANIFEST
-LTCG
:incremental
-NXCOMPAT
-DYNAMICBASE
-DEBUG
-OPT
:REF
-INCREMENTAL
:NO
-SUBSYSTEM
:WINDOWS
-MANIFESTUAC
:
"level='asInvoker' uiAccess='false'"
-OPT
:ICF
-ERRORREPORT
:PROMPT
-NOLOGO
-TLBID
:1
LIBS
+=
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
else
ifneq
(,$(findstring uwp,$(PlatformSuffix)))
WinPartition
=
uwp
MSVC2017CompileFlags
=
-DWINAPI_FAMILY
=
WINAPI_FAMILY_APP
-DWINDLL
-D_UNICODE
-DUNICODE
-DWRL_NO_DEFAULT_LIB
-FS
LDFLAGS
+=
-APPCONTAINER
-NXCOMPAT
-DYNAMICBASE
-MANIFEST
:NO
-LTCG
-OPT
:REF
-SUBSYSTEM
:CONSOLE
-MANIFESTUAC
:NO
-OPT
:ICF
-ERRORREPORT
:PROMPT
-NOLOGO
-TLBID
:1
-DEBUG
:FULL
-WINMD
:NO
LIBS
+=
WindowsApp.lib
endif
CFLAGS
+=
$(MSVC2017CompileFlags)
CXXFLAGS
+=
$(MSVC2017CompileFlags)
TargetArchMoniker
=
$(
subst
$(WinPartition)
_,,
$(PlatformSuffix)
)
CC
=
cl.exe
CXX
=
cl.exe
LD
=
link.exe
HAS_GCC
:=
0
reg_query
=
$(
call
filter_out2,
$(
subst
$2
,,
$(
shell
reg query
"
$2
"
-v
"
$1
"
2>nul
)))
fix_path
=
$(
subst
$(SPACE)
,
\
,
$(
subst
\,
/,
$1
))
ProgramFiles86w
:=
$(
shell
cmd /c
"echo %PROGRAMFILES(x86
)
%"
)
ProgramFiles86
:=
$(
shell
cygpath
"
$(ProgramFiles86w)
"
)
WindowsSdkDir
?=
$(
call
reg_query,InstallationFolder,HKEY_LOCAL_MACHINE
\S
OFTWARE
\W
ow6432Node
\M
icrosoft
\M
icrosoft SDKs
\W
indows
\v
10.0
)
WindowsSdkDir
?=
$(
call
reg_query,InstallationFolder,HKEY_CURRENT_USER
\S
OFTWARE
\W
ow6432Node
\M
icrosoft
\M
icrosoft SDKs
\W
indows
\v
10.0
)
WindowsSdkDir
?=
$(
call
reg_query,InstallationFolder,HKEY_LOCAL_MACHINE
\S
OFTWARE
\M
icrosoft
\M
icrosoft SDKs
\W
indows
\v
10.0
)
WindowsSdkDir
?=
$(
call
reg_query,InstallationFolder,HKEY_CURRENT_USER
\S
OFTWARE
\M
icrosoft
\M
icrosoft SDKs
\W
indows
\v
10.0
)
WindowsSdkDir
:=
$(WindowsSdkDir)
WindowsSDKVersion
?=
$(
firstword
$(
foreach
folder,
$(
subst
$(
subst
\,
/,
$(WindowsSdkDir)
Include/
)
,,
$(
wildcard
$(
call
fix_path,
$(WindowsSdkDir)
Include
\*
)))
,
$(
if
$(
wildcard
$(
call
fix_path,
$(WindowsSdkDir)
Include/
$(folder)
/um/Windows.h
))
,
$(folder)
,
)))
$(BACKSLASH)
WindowsSDKVersion
:=
$(WindowsSDKVersion)
VsInstallBuildTools
=
$(ProgramFiles86)
/Microsoft Visual Studio/2017/BuildTools
VsInstallEnterprise
=
$(ProgramFiles86)
/Microsoft Visual Studio/2017/Enterprise
VsInstallProfessional
=
$(ProgramFiles86)
/Microsoft Visual Studio/2017/Professional
VsInstallCommunity
=
$(ProgramFiles86)
/Microsoft Visual Studio/2017/Community
VsInstallRoot
?=
$(
shell
if
[
-d
"
$(VsInstallBuildTools)
"
]
;
then
echo
"
$(VsInstallBuildTools)
"
;
fi
)
ifeq
($(VsInstallRoot), )
VsInstallRoot
=
$(
shell
if
[
-d
"
$(VsInstallEnterprise)
"
]
;
then
echo
"
$(VsInstallEnterprise)
"
;
fi
)
endif
ifeq
($(VsInstallRoot), )
VsInstallRoot
=
$(
shell
if
[
-d
"
$(VsInstallProfessional)
"
]
;
then
echo
"
$(VsInstallProfessional)
"
;
fi
)
endif
ifeq
($(VsInstallRoot), )
VsInstallRoot
=
$(
shell
if
[
-d
"
$(VsInstallCommunity)
"
]
;
then
echo
"
$(VsInstallCommunity)
"
;
fi
)
endif
VsInstallRoot
:=
$(VsInstallRoot)
VcCompilerToolsVer
:=
$(
shell
cat
"
$(VsInstallRoot)
/VC/Auxiliary/Build/Microsoft.VCToolsVersion.default.txt"
|
grep
-o
'[0-9\.]*'
)
VcCompilerToolsDir
:=
$(VsInstallRoot)
/VC/Tools/MSVC/
$(VcCompilerToolsVer)
WindowsSDKSharedIncludeDir
:=
$(
shell
cygpath
-w
"
$(WindowsSdkDir)
\I
nclude
\$
(WindowsSDKVersion
)
\s
hared"
)
WindowsSDKUCRTIncludeDir
:=
$(
shell
cygpath
-w
"
$(WindowsSdkDir)
\I
nclude
\$
(WindowsSDKVersion
)
\u
crt"
)
WindowsSDKUMIncludeDir
:=
$(
shell
cygpath
-w
"
$(WindowsSdkDir)
\I
nclude
\$
(WindowsSDKVersion
)
\u
m"
)
WindowsSDKUCRTLibDir
:=
$(
shell
cygpath
-w
"
$(WindowsSdkDir)
\L
ib
\$
(WindowsSDKVersion
)
\u
crt
\$
(TargetArchMoniker
)
"
)
WindowsSDKUMLibDir
:=
$(
shell
cygpath
-w
"
$(WindowsSdkDir)
\L
ib
\$
(WindowsSDKVersion
)
\u
m
\$
(TargetArchMoniker
)
"
)
# For some reason the HostX86 compiler doesn't like compiling for x64
# ("no such file" opening a shared library), and vice-versa.
# Work around it for now by using the strictly x86 compiler for x86, and x64 for x64.
# NOTE: What about ARM?
ifneq
(,$(findstring x64,$(TargetArchMoniker)))
VCCompilerToolsBinDir
:=
$(VcCompilerToolsDir)
\b
in
\H
ostX64
else
VCCompilerToolsBinDir
:=
$(VcCompilerToolsDir)
\b
in
\H
ostX86
endif
PATH
:=
$(
shell
IFS
=
$$
'\n'
;
cygpath
"
$(VCCompilerToolsBinDir)
/
$(TargetArchMoniker)
"
)
:
$(PATH)
PATH
:=
$(PATH)
:
$(
shell
IFS
=
$$
'\n'
;
cygpath
"
$(VsInstallRoot)
/Common7/IDE"
)
INCLUDE
:=
$(
shell
IFS
=
$$
'\n'
;
cygpath
-w
"
$(VcCompilerToolsDir)
/include"
)
LIB
:=
$(
shell
IFS
=
$$
'\n'
;
cygpath
-w
"
$(VcCompilerToolsDir)
/lib/
$(TargetArchMoniker)
"
)
export
INCLUDE
:=
$(INCLUDE)
;
$(WindowsSDKSharedIncludeDir)
;
$(WindowsSDKUCRTIncludeDir)
;
$(WindowsSDKUMIncludeDir)
export
LIB
:=
$(LIB)
;
$(WindowsSDKUCRTLibDir)
;
$(WindowsSDKUMLibDir)
TARGET
:=
$(TARGET_NAME)
_libretro.dll
PSS_STYLE
:=
2
LDFLAGS
+=
-DLL
else
EXT
?=
dll
TARGET
:=
$(TARGET_NAME)
_libretro.
$(EXT)
...
...
@@ -505,7 +593,6 @@ else
all
:
$(TARGET)
$(TARGET)
:
$(OBJECTS)
@
echo
"** BUILDING
$(TARGET)
FOR PLATFORM
$(platform)
**"
ifeq
($(STATIC_LINKING), 1)
ifneq
(,$(findstring msvc,$(platform)))
$(LD)
$(LINKOUT)$@
$(OBJECTS)
...
...
@@ -515,7 +602,6 @@ endif
else
$(LD)
$(fpic)
$(SHARED)
$(INCLUDES)
$(LFLAGS)
$(LINKOUT)$@
$(OBJECTS)
$(LDFLAGS)
$(LIBS)
endif
@
echo
"** BUILD SUCCESSFUL! GG NO RE **"
%.o
:
%.c
$(CC)
$(CFLAGS)
-c
$(OBJOUT)$@
$<
...
...
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