123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431 |
- -- premake gets a tiny bit confused if the same project appears in multiple
- -- solutions in a single run. premake adds a bogus $projectname path to the
- -- intermediate objects directory in that case. work-around using multiple
- -- invocations of premake and a custom option to distinguish them.
- MPT_PREMAKE_VERSION = ""
- MPT_PREMAKE_VERSION = "5.0"
- newoption {
- trigger = "group",
- value = "PROJECTS",
- description = "OpenMPT project group",
- allowed = {
- { "libopenmpt-all", "libopenmpt-all" },
- { "libopenmpt_test", "libopenmpt_test" },
- { "libopenmpt", "libopenmpt" },
- { "libopenmpt-small", "libopenmpt-small" },
- { "in_openmpt", "in_openmpt" },
- { "xmp-openmpt", "xmp-openmpt" },
- { "openmpt123", "openmpt123" },
- { "PluginBridge", "PluginBridge" },
- { "OpenMPT", "OpenMPT" },
- { "all-externals", "all-externals" }
- }
- }
- newoption {
- trigger = "winxp",
- description = "Generate XP targetting projects",
- }
- newoption {
- trigger = "win7",
- description = "Generate Windows 7 Desktop targetting projects",
- }
- newoption {
- trigger = "win81",
- description = "Generate Windows 8.1 Desktop targetting projects",
- }
- newoption {
- trigger = "win10",
- description = "Generate Windows 10 Desktop targetting projects",
- }
- newoption {
- trigger = "uwp",
- description = "Generate Windows UWP targetting projects",
- }
- newoption {
- trigger = "clang",
- description = "ClangCL projects",
- }
- mpt_projectpathname = _ACTION
- mpt_bindirsuffix = ""
- mpt_bindirsuffix32 = ""
- mpt_bindirsuffix64 = ""
- if _OPTIONS["uwp"] then
- allplatforms = { "x86", "x86_64", "arm", "arm64" }
- trkplatforms = { "x86", "x86_64", "arm", "arm64" }
- mpt_projectpathname = mpt_projectpathname .. "uwp"
- mpt_bindirsuffix = mpt_bindirsuffix .. "uwp"
- mpt_bindirsuffix32 = mpt_bindirsuffix32 .. "uwp"
- mpt_bindirsuffix64 = mpt_bindirsuffix64 .. "uwp"
- elseif _OPTIONS["win10"] then
- allplatforms = { "x86", "x86_64", "arm", "arm64" }
- trkplatforms = { "x86", "x86_64", "arm", "arm64" }
- mpt_projectpathname = mpt_projectpathname .. "win10"
- mpt_bindirsuffix = mpt_bindirsuffix .. "win10"
- mpt_bindirsuffix32 = mpt_bindirsuffix32 .. "win10"
- mpt_bindirsuffix64 = mpt_bindirsuffix64 .. "win10"
- elseif _OPTIONS["win81"] then
- allplatforms = { "x86", "x86_64" }
- trkplatforms = { "x86", "x86_64" }
- mpt_projectpathname = mpt_projectpathname .. "win81"
- mpt_bindirsuffix = mpt_bindirsuffix .. "win81"
- mpt_bindirsuffix32 = mpt_bindirsuffix32 .. "win81"
- mpt_bindirsuffix64 = mpt_bindirsuffix64 .. "win81"
- elseif _OPTIONS["win7"] then
- allplatforms = { "x86", "x86_64" }
- trkplatforms = { "x86", "x86_64" }
- mpt_projectpathname = mpt_projectpathname .. "win7"
- mpt_bindirsuffix = mpt_bindirsuffix .. "win7"
- mpt_bindirsuffix32 = mpt_bindirsuffix32 .. "win7"
- mpt_bindirsuffix64 = mpt_bindirsuffix64 .. "win7"
- elseif _OPTIONS["winxp"] then
- allplatforms = { "x86", "x86_64" }
- trkplatforms = { "x86", "x86_64" }
- mpt_projectpathname = mpt_projectpathname .. "winxp"
- mpt_bindirsuffix = mpt_bindirsuffix .. "winxp"
- mpt_bindirsuffix32 = mpt_bindirsuffix32 .. "winxp"
- mpt_bindirsuffix64 = mpt_bindirsuffix64 .. "winxp"
- end
- if _OPTIONS["clang"] then
- mpt_projectpathname = mpt_projectpathname .. "clang"
- mpt_bindirsuffix = mpt_bindirsuffix .. "clang"
- mpt_bindirsuffix32 = mpt_bindirsuffix32 .. "clang"
- mpt_bindirsuffix64 = mpt_bindirsuffix64 .. "clang"
- end
- if _OPTIONS["group"] == "libopenmpt_test" then
- solution "libopenmpt_test"
- startproject "libopenmpt_test"
- location ( "../../build/" .. mpt_projectpathname )
- configurations { "Debug", "Release", "Checked", "DebugShared", "ReleaseShared", "CheckedShared" }
- platforms ( allplatforms )
- dofile "../../build/premake/premake-defaults-solution.lua"
- dofile "../../build/premake/mpt-libopenmpt_test.lua"
- dofile "../../build/premake/ext-mpg123.lua"
- dofile "../../build/premake/ext-ogg.lua"
- dofile "../../build/premake/ext-vorbis.lua"
- dofile "../../build/premake/ext-zlib.lua"
- end
- if _OPTIONS["group"] == "in_openmpt" then
- solution "in_openmpt"
- startproject "in_openmpt"
- location ( "../../build/" .. mpt_projectpathname )
- configurations { "Debug", "Release", "Checked" }
- platforms { "x86" }
- dofile "../../build/premake/premake-defaults-solution.lua"
- dofile "../../build/premake/mpt-in_openmpt.lua"
- dofile "../../build/premake/mpt-libopenmpt.lua"
- dofile "../../build/premake/ext-mpg123.lua"
- dofile "../../build/premake/ext-ogg.lua"
- dofile "../../build/premake/ext-vorbis.lua"
- dofile "../../build/premake/ext-zlib.lua"
- end
- if _OPTIONS["group"] == "xmp-openmpt" then
- solution "xmp-openmpt"
- startproject "xmp-openmpt"
- location ( "../../build/" .. mpt_projectpathname )
- configurations { "Debug", "Release", "Checked" }
- platforms { "x86" }
- dofile "../../build/premake/premake-defaults-solution.lua"
- dofile "../../build/premake/mpt-xmp-openmpt.lua"
- dofile "../../build/premake/mpt-libopenmpt.lua"
- dofile "../../build/premake/ext-mpg123.lua"
- dofile "../../build/premake/ext-ogg.lua"
- dofile "../../build/premake/ext-pugixml.lua"
- dofile "../../build/premake/ext-vorbis.lua"
- dofile "../../build/premake/ext-zlib.lua"
- end
- if _OPTIONS["group"] == "libopenmpt-small" then
- solution "libopenmpt-small"
- startproject "libopenmpt-small"
- location ( "../../build/" .. mpt_projectpathname )
- configurations { "Debug", "Release", "Checked", "DebugShared", "ReleaseShared", "CheckedShared" }
- platforms ( allplatforms )
- dofile "../../build/premake/premake-defaults-solution.lua"
- dofile "../../build/premake/mpt-libopenmpt-small.lua"
- dofile "../../build/premake/ext-minimp3.lua"
- dofile "../../build/premake/ext-miniz.lua"
- dofile "../../build/premake/ext-stb_vorbis.lua"
- end
- -- should stay the last libopenmpt solution in order to overwrite the libopenmpt base project with all possible configurations
- if _OPTIONS["group"] == "libopenmpt" then
- solution "libopenmpt"
- startproject "libopenmpt"
- location ( "../../build/" .. mpt_projectpathname )
- configurations { "Debug", "Release", "Checked", "DebugShared", "ReleaseShared", "CheckedShared" }
- platforms ( allplatforms )
- dofile "../../build/premake/premake-defaults-solution.lua"
- dofile "../../build/premake/mpt-libopenmpt.lua"
- if not _OPTIONS["uwp"] then
- dofile "../../build/premake/mpt-libopenmpt_examples.lua"
- end
- dofile "../../build/premake/ext-mpg123.lua"
- dofile "../../build/premake/ext-ogg.lua"
- if not _OPTIONS["uwp"] then
- dofile "../../build/premake/ext-portaudio.lua"
- dofile "../../build/premake/ext-portaudiocpp.lua"
- end
- dofile "../../build/premake/ext-vorbis.lua"
- dofile "../../build/premake/ext-zlib.lua"
- end
- if _OPTIONS["group"] == "openmpt123" then
- solution "openmpt123"
- startproject "openmpt123"
- location ( "../../build/" .. mpt_projectpathname )
- configurations { "Debug", "Release", "Checked", "DebugShared", "ReleaseShared", "CheckedShared" }
- platforms ( allplatforms )
- dofile "../../build/premake/premake-defaults-solution.lua"
- dofile "../../build/premake/mpt-openmpt123.lua"
- dofile "../../build/premake/mpt-libopenmpt.lua"
- dofile "../../build/premake/ext-flac.lua"
- dofile "../../build/premake/ext-mpg123.lua"
- dofile "../../build/premake/ext-ogg.lua"
- dofile "../../build/premake/ext-portaudio.lua"
- dofile "../../build/premake/ext-vorbis.lua"
- dofile "../../build/premake/ext-zlib.lua"
- end
- if _OPTIONS["group"] == "PluginBridge" then
- solution "PluginBridge"
- startproject "PluginBridge"
- location ( "../../build/" .. mpt_projectpathname )
- configurations { "Debug", "Release", "Checked" }
- platforms ( trkplatforms )
- dofile "../../build/premake/premake-defaults-solution.lua"
- dofile "../../build/premake/mpt-PluginBridge.lua"
- end
- if _OPTIONS["group"] == "OpenMPT" then
- charset = "Unicode"
- stringmode = "UTF8"
- solution "OpenMPT-UTF8"
- startproject "OpenMPT-UTF8"
- location ( "../../build/" .. mpt_projectpathname )
- configurations { "Debug", "Release", "Checked", "DebugShared", "ReleaseShared", "CheckedShared" }
- platforms ( trkplatforms )
- dofile "../../build/premake/premake-defaults-solution.lua"
- dofile "../../build/premake/mpt-OpenMPT.lua"
- dofile "../../build/premake/mpt-PluginBridge.lua"
- dofile "../../build/premake/mpt-updatesigntool.lua"
- dofile "../../build/premake/ext-ancient.lua"
- dofile "../../build/premake/ext-flac.lua"
- dofile "../../build/premake/ext-lame.lua"
- dofile "../../build/premake/ext-lhasa.lua"
- dofile "../../build/premake/ext-minizip.lua"
- dofile "../../build/premake/ext-mpg123.lua"
- dofile "../../build/premake/ext-ogg.lua"
- dofile "../../build/premake/ext-opus.lua"
- dofile "../../build/premake/ext-opusenc.lua"
- dofile "../../build/premake/ext-opusfile.lua"
- dofile "../../build/premake/ext-portaudio.lua"
- dofile "../../build/premake/ext-r8brain.lua"
- dofile "../../build/premake/ext-rtaudio.lua"
- dofile "../../build/premake/ext-rtmidi.lua"
- dofile "../../build/premake/ext-smbPitchShift.lua"
- dofile "../../build/premake/ext-soundtouch.lua"
- dofile "../../build/premake/ext-UnRAR.lua"
- dofile "../../build/premake/ext-vorbis.lua"
- dofile "../../build/premake/ext-zlib.lua"
- charset = "MBCS"
- stringmode = "WCHAR"
- solution "OpenMPT-ANSI"
- startproject "OpenMPT-ANSI"
- location ( "../../build/" .. mpt_projectpathname )
- configurations { "Debug", "Release", "Checked", "DebugShared", "ReleaseShared", "CheckedShared" }
- platforms ( trkplatforms )
- dofile "../../build/premake/premake-defaults-solution.lua"
- dofile "../../build/premake/mpt-OpenMPT.lua"
- dofile "../../build/premake/mpt-PluginBridge.lua"
- dofile "../../build/premake/mpt-updatesigntool.lua"
- dofile "../../build/premake/ext-ancient.lua"
- dofile "../../build/premake/ext-flac.lua"
- dofile "../../build/premake/ext-lame.lua"
- dofile "../../build/premake/ext-lhasa.lua"
- dofile "../../build/premake/ext-minizip.lua"
- dofile "../../build/premake/ext-mpg123.lua"
- dofile "../../build/premake/ext-ogg.lua"
- dofile "../../build/premake/ext-opus.lua"
- dofile "../../build/premake/ext-opusenc.lua"
- dofile "../../build/premake/ext-opusfile.lua"
- dofile "../../build/premake/ext-portaudio.lua"
- dofile "../../build/premake/ext-r8brain.lua"
- dofile "../../build/premake/ext-rtaudio.lua"
- dofile "../../build/premake/ext-rtmidi.lua"
- dofile "../../build/premake/ext-smbPitchShift.lua"
- dofile "../../build/premake/ext-soundtouch.lua"
- dofile "../../build/premake/ext-UnRAR.lua"
- dofile "../../build/premake/ext-vorbis.lua"
- dofile "../../build/premake/ext-zlib.lua"
- charset = "Unicode"
- stringmode = "WCHAR"
- solution "OpenMPT"
- startproject "OpenMPT"
- location ( "../../build/" .. mpt_projectpathname )
- configurations { "Debug", "Release", "Checked", "DebugShared", "ReleaseShared", "CheckedShared" }
- platforms ( trkplatforms )
- dofile "../../build/premake/premake-defaults-solution.lua"
- dofile "../../build/premake/mpt-OpenMPT.lua"
- dofile "../../build/premake/mpt-PluginBridge.lua"
- dofile "../../build/premake/mpt-updatesigntool.lua"
- dofile "../../build/premake/ext-ancient.lua"
- dofile "../../build/premake/ext-flac.lua"
- dofile "../../build/premake/ext-lame.lua"
- dofile "../../build/premake/ext-lhasa.lua"
- dofile "../../build/premake/ext-minizip.lua"
- dofile "../../build/premake/ext-mpg123.lua"
- dofile "../../build/premake/ext-ogg.lua"
- dofile "../../build/premake/ext-opus.lua"
- dofile "../../build/premake/ext-opusenc.lua"
- dofile "../../build/premake/ext-opusfile.lua"
- dofile "../../build/premake/ext-portaudio.lua"
- dofile "../../build/premake/ext-r8brain.lua"
- dofile "../../build/premake/ext-rtaudio.lua"
- dofile "../../build/premake/ext-rtmidi.lua"
- dofile "../../build/premake/ext-smbPitchShift.lua"
- dofile "../../build/premake/ext-soundtouch.lua"
- dofile "../../build/premake/ext-UnRAR.lua"
- dofile "../../build/premake/ext-vorbis.lua"
- dofile "../../build/premake/ext-zlib.lua"
- end
- -- overwrite all external projects once again with the full matrix of possible build config combinations
- if _OPTIONS["group"] == "all-externals" then
- solution "all-externals"
- location ( "../../build/" .. mpt_projectpathname .. "/ext" )
- configurations { "Debug", "Release", "Checked", "DebugShared", "ReleaseShared", "CheckedShared" }
- platforms ( allplatforms )
- dofile "../../build/premake/premake-defaults-solution.lua"
- dofile "../../build/premake/ext-ancient.lua"
- dofile "../../build/premake/ext-flac.lua"
- dofile "../../build/premake/ext-lame.lua"
- dofile "../../build/premake/ext-lhasa.lua"
- dofile "../../build/premake/ext-minimp3.lua"
- dofile "../../build/premake/ext-miniz.lua"
- dofile "../../build/premake/ext-minizip.lua"
- dofile "../../build/premake/ext-mpg123.lua"
- dofile "../../build/premake/ext-ogg.lua"
- dofile "../../build/premake/ext-opus.lua"
- dofile "../../build/premake/ext-opusenc.lua"
- dofile "../../build/premake/ext-opusfile.lua"
- dofile "../../build/premake/ext-portaudio.lua"
- dofile "../../build/premake/ext-portaudiocpp.lua"
- dofile "../../build/premake/ext-pugixml.lua"
- dofile "../../build/premake/ext-r8brain.lua"
- dofile "../../build/premake/ext-rtaudio.lua"
- dofile "../../build/premake/ext-rtmidi.lua"
- dofile "../../build/premake/ext-smbPitchShift.lua"
- dofile "../../build/premake/ext-soundtouch.lua"
- dofile "../../build/premake/ext-stb_vorbis.lua"
- dofile "../../build/premake/ext-UnRAR.lua"
- dofile "../../build/premake/ext-vorbis.lua"
- dofile "../../build/premake/ext-zlib.lua"
- end
- if _OPTIONS["uwp"] then
- require('vstudio')
- local function mptGlobalsUWP(prj)
- if _ACTION == 'vs2022' then
- premake.w('<DefaultLanguage>en-US</DefaultLanguage>')
- premake.w('<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>')
- premake.w('<AppContainerApplication>true</AppContainerApplication>')
- premake.w('<ApplicationType>Windows Store</ApplicationType>')
- premake.w('<ApplicationTypeRevision>10.0</ApplicationTypeRevision>')
- premake.w('<WindowsTargetPlatformVersion Condition=" \'$(WindowsTargetPlatformVersion)\' == \'\' ">10.0.22000.0</WindowsTargetPlatformVersion>')
- premake.w('<WindowsTargetPlatformMinVersion>10.0.17134.0</WindowsTargetPlatformMinVersion>')
- elseif _ACTION == 'vs2019' then
- premake.w('<DefaultLanguage>en-US</DefaultLanguage>')
- premake.w('<MinimumVisualStudioVersion>15.0</MinimumVisualStudioVersion>')
- premake.w('<AppContainerApplication>true</AppContainerApplication>')
- premake.w('<ApplicationType>Windows Store</ApplicationType>')
- premake.w('<ApplicationTypeRevision>10.0</ApplicationTypeRevision>')
- premake.w('<WindowsTargetPlatformVersion>10.0.20348.0</WindowsTargetPlatformVersion>')
- premake.w('<WindowsTargetPlatformMinVersion>10.0.10240.0</WindowsTargetPlatformMinVersion>')
- end
- end
- local function mptClCompileUWP(prj)
- premake.w('<CompileAsWinRT>false</CompileAsWinRT>')
- end
-
- local function mptOutputPropertiesUWP(prj)
- premake.w('<IgnoreImportLibrary>false</IgnoreImportLibrary>')
- end
-
- local function mptProjectReferencesUWP(prj)
- premake.w('<ReferenceOutputAssembly>false</ReferenceOutputAssembly>')
- end
- premake.override(premake.vstudio.vc2010.elements, "globals", function(base, prj)
- local calls = base(prj)
- table.insert(calls, mptGlobalsUWP)
- return calls
- end)
- premake.override(premake.vstudio.vc2010.elements, "clCompile", function(base, prj)
- local calls = base(prj)
- table.insert(calls, mptClCompileUWP)
- return calls
- end)
- premake.override(premake.vstudio.vc2010.elements, "outputProperties", function(base, prj)
- local calls = base(prj)
- table.insert(calls, mptOutputPropertiesUWP)
- return calls
- end)
- premake.override(premake.vstudio.vc2010.elements, "projectReferences", function(base, prj)
- local calls = base(prj)
- table.insert(calls, mptProjectReferencesUWP)
- return calls
- end)
- end
|