Merge branch 'master' into vs-warnings
This commit is contained in:
commit
454a54961b
@ -39,6 +39,12 @@ SRC = src/host/*.c \
|
||||
$(LUA_DIR)/lzio.c \
|
||||
|
||||
HOST_PLATFORM= none
|
||||
|
||||
.PHONY: default none clean nix-clean windows-clean \
|
||||
mingw-clean mingw macosx macosx-clean osx-clean osx \
|
||||
linux-clean linux bsd-clean bsd solaris-clean solaris \
|
||||
haiku-clean haiku windows-base windows windows-msbuild
|
||||
|
||||
default: $(HOST_PLATFORM)
|
||||
|
||||
none:
|
||||
@ -50,75 +56,92 @@ none:
|
||||
@echo " make -f Bootstrap.mak HOST_PLATFORM"
|
||||
@echo "where HOST_PLATFORM is one of these:"
|
||||
@echo " osx linux bsd"
|
||||
@echo ""
|
||||
@echo "To clean the source tree, run the same command by adding a '-clean' suffix to the target name."
|
||||
@echo "Example"
|
||||
@echo " make -f Bootstrap.mak HOST_PLATFORM-clean"
|
||||
|
||||
mingw: $(SRC)
|
||||
clean:
|
||||
@echo "Please run the same command used for building by adding a '-clean' suffix to the target name."
|
||||
@echo " nmake -f Bootstrap.mak windows-clean"
|
||||
@echo "or"
|
||||
@echo " CC=mingw32-gcc mingw32-make -f Bootstrap.mak mingw-clean CONFIG=x64"
|
||||
@echo "or"
|
||||
@echo " make -f Bootstrap.mak HOST_PLATFORM-clean"
|
||||
@echo "where HOST_PLATFORM is one of these:"
|
||||
@echo " osx linux bsd"
|
||||
|
||||
nix-clean:
|
||||
$(SILENT) rm -rf ./bin
|
||||
$(SILENT) rm -rf ./build
|
||||
$(SILENT) rm -rf ./obj
|
||||
|
||||
windows-clean:
|
||||
$(SILENT) if exist .\bin rmdir /s /q .\bin
|
||||
$(SILENT) if exist .\build rmdir /s /q .\build
|
||||
$(SILENT) if exist .\obj rmdir /s /q .\obj
|
||||
|
||||
mingw-clean: windows-clean
|
||||
|
||||
mingw: mingw-clean
|
||||
if not exist build\bootstrap (mkdir build\bootstrap)
|
||||
$(CC) -o build/bootstrap/premake_bootstrap -DPREMAKE_NO_BUILTIN_SCRIPTS -I"$(LUA_DIR)" -I"$(LUASHIM_DIR)" $? -lole32 -lversion
|
||||
$(CC) -o build/bootstrap/premake_bootstrap -DPREMAKE_NO_BUILTIN_SCRIPTS -I"$(LUA_DIR)" -I"$(LUASHIM_DIR)" $(SRC) -lole32 -lversion
|
||||
./build/bootstrap/premake_bootstrap embed
|
||||
./build/bootstrap/premake_bootstrap --os=windows --to=build/bootstrap --cc=mingw gmake2
|
||||
$(MAKE) -C build/bootstrap config=$(CONFIG)_$(PLATFORM)
|
||||
|
||||
macosx: osx
|
||||
|
||||
osx: $(SRC)
|
||||
$(SILENT) rm -rf ./bin
|
||||
$(SILENT) rm -rf ./build
|
||||
$(SILENT) rm -rf ./obj
|
||||
macosx-clean: osx-clean
|
||||
|
||||
osx-clean: nix-clean
|
||||
|
||||
osx: osx-clean
|
||||
mkdir -p build/bootstrap
|
||||
$(CC) -o build/bootstrap/premake_bootstrap -DPREMAKE_NO_BUILTIN_SCRIPTS -DLUA_USE_MACOSX -I"$(LUA_DIR)" -I"$(LUASHIM_DIR)" -framework CoreServices -framework Foundation -framework Security -lreadline $?
|
||||
$(CC) -o build/bootstrap/premake_bootstrap -DPREMAKE_NO_BUILTIN_SCRIPTS -DLUA_USE_MACOSX -I"$(LUA_DIR)" -I"$(LUASHIM_DIR)" -framework CoreServices -framework Foundation -framework Security -lreadline $(SRC)
|
||||
./build/bootstrap/premake_bootstrap embed
|
||||
./build/bootstrap/premake_bootstrap --to=build/bootstrap gmake2
|
||||
$(MAKE) -C build/bootstrap -j`getconf _NPROCESSORS_ONLN` config=$(CONFIG)
|
||||
|
||||
linux: $(SRC)
|
||||
$(SILENT) rm -rf ./bin
|
||||
$(SILENT) rm -rf ./build
|
||||
$(SILENT) rm -rf ./obj
|
||||
linux-clean: nix-clean
|
||||
|
||||
linux: linux-clean
|
||||
mkdir -p build/bootstrap
|
||||
$(CC) -o build/bootstrap/premake_bootstrap -DPREMAKE_NO_BUILTIN_SCRIPTS -DLUA_USE_POSIX -DLUA_USE_DLOPEN -I"$(LUA_DIR)" -I"$(LUASHIM_DIR)" $? -lm -ldl -lrt
|
||||
$(CC) -o build/bootstrap/premake_bootstrap -DPREMAKE_NO_BUILTIN_SCRIPTS -DLUA_USE_POSIX -DLUA_USE_DLOPEN -I"$(LUA_DIR)" -I"$(LUASHIM_DIR)" $(SRC) -lm -ldl -lrt
|
||||
./build/bootstrap/premake_bootstrap embed
|
||||
./build/bootstrap/premake_bootstrap --to=build/bootstrap gmake2
|
||||
$(MAKE) -C build/bootstrap -j`getconf _NPROCESSORS_ONLN` config=$(CONFIG)
|
||||
|
||||
bsd: $(SRC)
|
||||
$(SILENT) rm -rf ./bin
|
||||
$(SILENT) rm -rf ./build
|
||||
$(SILENT) rm -rf ./obj
|
||||
bsd-clean: nix-clean
|
||||
|
||||
bsd: bsd-clean
|
||||
mkdir -p build/bootstrap
|
||||
$(CC) -o build/bootstrap/premake_bootstrap -DPREMAKE_NO_BUILTIN_SCRIPTS -DLUA_USE_POSIX -DLUA_USE_DLOPEN -I"$(LUA_DIR)" -I"$(LUASHIM_DIR)" $? -lm
|
||||
$(CC) -o build/bootstrap/premake_bootstrap -DPREMAKE_NO_BUILTIN_SCRIPTS -DLUA_USE_POSIX -DLUA_USE_DLOPEN -I"$(LUA_DIR)" -I"$(LUASHIM_DIR)" $(SRC) -lm
|
||||
./build/bootstrap/premake_bootstrap embed
|
||||
./build/bootstrap/premake_bootstrap --to=build/bootstrap gmake2
|
||||
$(MAKE) -C build/bootstrap -j`getconf NPROCESSORS_ONLN` config=$(CONFIG)
|
||||
|
||||
solaris: $(SRC)
|
||||
$(SILENT) rm -rf ./bin
|
||||
$(SILENT) rm -rf ./build
|
||||
$(SILENT) rm -rf ./obj
|
||||
solaris-clean: nix-clean
|
||||
|
||||
solaris: solaris-clean
|
||||
mkdir -p build/bootstrap
|
||||
$(CC) -o build/bootstrap/premake_bootstrap -DPREMAKE_NO_BUILTIN_SCRIPTS -DLUA_USE_POSIX -DLUA_USE_DLOPEN -I"$(LUA_DIR)" -I"$(LUASHIM_DIR)" $? -lm
|
||||
$(CC) -o build/bootstrap/premake_bootstrap -DPREMAKE_NO_BUILTIN_SCRIPTS -DLUA_USE_POSIX -DLUA_USE_DLOPEN -I"$(LUA_DIR)" -I"$(LUASHIM_DIR)" $(SRC) -lm
|
||||
./build/bootstrap/premake_bootstrap embed
|
||||
./build/bootstrap/premake_bootstrap --to=build/bootstrap gmake2
|
||||
$(MAKE) -C build/bootstrap -j`getconf NPROCESSORS_ONLN` config=$(CONFIG)
|
||||
|
||||
haiku: $(SRC)
|
||||
$(SILENT) rm -rf ./bin
|
||||
$(SILENT) rm -rf ./build
|
||||
$(SILENT) rm -rf ./obj
|
||||
haiku-clean: nix-clean
|
||||
|
||||
haiku: haiku-clean
|
||||
mkdir -p build/bootstrap
|
||||
$(CC) -o build/bootstrap/premake_bootstrap -DPREMAKE_NO_BUILTIN_SCRIPTS -DLUA_USE_POSIX -DLUA_USE_DLOPEN -D_BSD_SOURCE -I"$(LUA_DIR)" -I"$(LUASHIM_DIR)" $? -lbsd
|
||||
$(CC) -o build/bootstrap/premake_bootstrap -DPREMAKE_NO_BUILTIN_SCRIPTS -DLUA_USE_POSIX -DLUA_USE_DLOPEN -D_BSD_SOURCE -I"$(LUA_DIR)" -I"$(LUASHIM_DIR)" $(SRC) -lbsd
|
||||
./build/bootstrap/premake_bootstrap embed
|
||||
./build/bootstrap/premake_bootstrap --to=build/bootstrap gmake2
|
||||
$(MAKE) -C build/bootstrap -j`getconf _NPROCESSORS_ONLN` config=$(CONFIG)
|
||||
|
||||
windows-base: $(SRC)
|
||||
$(SILENT) if exist .\bin rmdir /s /q .\bin
|
||||
$(SILENT) if exist .\build rmdir /s /q .\build
|
||||
$(SILENT) if exist .\obj rmdir /s /q .\obj
|
||||
windows-base: windows-clean
|
||||
if not exist build\bootstrap (mkdir build\bootstrap)
|
||||
cl /Fo.\build\bootstrap\ /Fe.\build\bootstrap\premake_bootstrap.exe /DPREMAKE_NO_BUILTIN_SCRIPTS /I"$(LUA_DIR)" /I"$(LUASHIM_DIR)" user32.lib ole32.lib advapi32.lib $**
|
||||
cl /Fo.\build\bootstrap\ /Fe.\build\bootstrap\premake_bootstrap.exe /DPREMAKE_NO_BUILTIN_SCRIPTS /I"$(LUA_DIR)" /I"$(LUASHIM_DIR)" user32.lib ole32.lib advapi32.lib $(SRC)
|
||||
.\build\bootstrap\premake_bootstrap.exe embed
|
||||
.\build\bootstrap\premake_bootstrap --to=build/bootstrap $(MSDEV)
|
||||
|
||||
|
@ -464,6 +464,8 @@
|
||||
["C++14"] = "c++14",
|
||||
["C++1z"] = "c++17",
|
||||
["C++17"] = "c++17",
|
||||
["C++2a"] = "c++20",
|
||||
["C++20"] = "c++20",
|
||||
["gnu++98"] = "c++98",
|
||||
["gnu++0x"] = "c++11",
|
||||
["gnu++11"] = "c++11",
|
||||
@ -471,6 +473,8 @@
|
||||
["gnu++14"] = "c++14",
|
||||
["gnu++1z"] = "c++17",
|
||||
["gnu++17"] = "c++17",
|
||||
["gnu++2a"] = "c++20",
|
||||
["gnu++20"] = "c++20",
|
||||
}
|
||||
if cppMap[cfg.cppdialect] ~= nil then
|
||||
table.insert(opts, "-extern-std=" .. cppMap[cfg.cppdialect])
|
||||
|
@ -263,6 +263,8 @@
|
||||
["C++14"] = "-extern-std=c++14",
|
||||
["C++1z"] = "-extern-std=c++17",
|
||||
["C++17"] = "-extern-std=c++17",
|
||||
["C++2a"] = "-extern-std=c++20",
|
||||
["C++20"] = "-extern-std=c++20",
|
||||
["gnu++98"] = "-extern-std=c++98",
|
||||
["gnu++0x"] = "-extern-std=c++11",
|
||||
["gnu++11"] = "-extern-std=c++11",
|
||||
@ -270,6 +272,8 @@
|
||||
["gnu++14"] = "-extern-std=c++14",
|
||||
["gnu++1z"] = "-extern-std=c++17",
|
||||
["gnu++17"] = "-extern-std=c++17",
|
||||
["gnu++2a"] = "-extern-std=c++20",
|
||||
["gnu++20"] = "-extern-std=c++20",
|
||||
},
|
||||
deprecatedfeatures = {
|
||||
Allow = "-d",
|
||||
|
@ -76,6 +76,8 @@
|
||||
["C++14"] = "-extern-std=c++14",
|
||||
["C++1z"] = "-extern-std=c++17",
|
||||
["C++17"] = "-extern-std=c++17",
|
||||
["C++2a"] = "-extern-std=c++20",
|
||||
["C++20"] = "-extern-std=c++20",
|
||||
["gnu++98"] = "-extern-std=c++98",
|
||||
["gnu++0x"] = "-extern-std=c++11",
|
||||
["gnu++11"] = "-extern-std=c++11",
|
||||
@ -83,6 +85,8 @@
|
||||
["gnu++14"] = "-extern-std=c++14",
|
||||
["gnu++1z"] = "-extern-std=c++17",
|
||||
["gnu++17"] = "-extern-std=c++17",
|
||||
["gnu++2a"] = "-extern-std=c++20",
|
||||
["gnu++20"] = "-extern-std=c++20",
|
||||
},
|
||||
deprecatedfeatures = {
|
||||
Allow = "-d",
|
||||
|
@ -96,4 +96,7 @@ return {
|
||||
|
||||
-- Visual Studio 2013+ C/C++ Shared Items projects
|
||||
"vc2013/test_vcxitems.lua",
|
||||
|
||||
-- Visual Studio 2019+ C/C++ Clang Projects
|
||||
"vc2019/test_toolset_settings.lua"
|
||||
}
|
||||
|
@ -1182,7 +1182,7 @@
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalOptions>/std:c++latest %(AdditionalOptions)</AdditionalOptions>
|
||||
<AdditionalOptions>/std:c++17 %(AdditionalOptions)</AdditionalOptions>
|
||||
</ClCompile>
|
||||
]]
|
||||
end
|
||||
@ -1217,6 +1217,21 @@
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.onLanguage_Cpp20_VS2019()
|
||||
p.action.set("vs2019")
|
||||
|
||||
cppdialect 'C++20'
|
||||
prepare()
|
||||
test.capture [[
|
||||
<ClCompile>
|
||||
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||
</ClCompile>
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.onLanguage_CppLatest_VS2010()
|
||||
cppdialect 'C++latest'
|
||||
prepare()
|
||||
|
59
modules/vstudio/tests/vc2019/test_toolset_settings.lua
Normal file
59
modules/vstudio/tests/vc2019/test_toolset_settings.lua
Normal file
@ -0,0 +1,59 @@
|
||||
--
|
||||
-- tests/actions/vstudio/vc2010/test_compile_settings.lua
|
||||
-- Validate compiler settings in Visual Studio 2019 C/C++ projects.
|
||||
-- Copyright (c) 2011-2020 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
local p = premake
|
||||
local suite = test.declare("vstudio_vs2019_compile_settings")
|
||||
local vc2010 = p.vstudio.vc2010
|
||||
local project = p.project
|
||||
|
||||
--
|
||||
-- Setup
|
||||
--
|
||||
|
||||
local wks, prj
|
||||
|
||||
function suite.setup()
|
||||
p.action.set("vs2019")
|
||||
wks, prj = test.createWorkspace()
|
||||
end
|
||||
|
||||
local function prepare(platform)
|
||||
local cfg = test.getconfig(prj, "Debug", platform)
|
||||
vc2010.configurationProperties(cfg)
|
||||
end
|
||||
|
||||
---
|
||||
-- Check the default project settings
|
||||
---
|
||||
|
||||
function suite.defaultSettings()
|
||||
prepare()
|
||||
test.capture [[
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
]]
|
||||
end
|
||||
|
||||
---
|
||||
-- Check the project settings with the clang toolset
|
||||
---
|
||||
|
||||
function suite.toolsetClang()
|
||||
toolset "clang"
|
||||
prepare()
|
||||
test.capture [[
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
<PlatformToolset>ClangCL</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
]]
|
||||
end
|
@ -1466,6 +1466,8 @@
|
||||
m.element("LanguageStandard", nil, 'stdcpp14')
|
||||
elseif (cfg.cppdialect == "C++17") then
|
||||
m.element("LanguageStandard", nil, 'stdcpp17')
|
||||
elseif (cfg.cppdialect == "C++20") then
|
||||
m.element("LanguageStandard", nil, 'stdcpplatest')
|
||||
elseif (cfg.cppdialect == "C++latest") then
|
||||
m.element("LanguageStandard", nil, 'stdcpplatest')
|
||||
end
|
||||
@ -1493,6 +1495,8 @@
|
||||
if (cfg.cppdialect == "C++14") then
|
||||
table.insert(opts, "/std:c++14")
|
||||
elseif (cfg.cppdialect == "C++17") then
|
||||
table.insert(opts, "/std:c++17")
|
||||
elseif (cfg.cppdialect == "C++20") then
|
||||
table.insert(opts, "/std:c++latest")
|
||||
elseif (cfg.cppdialect == "C++latest") then
|
||||
table.insert(opts, "/std:c++latest")
|
||||
@ -1502,6 +1506,9 @@
|
||||
if cfg.toolset and cfg.toolset:startswith("msc") then
|
||||
local value = iif(cfg.unsignedchar, "On", "Off")
|
||||
table.insert(opts, p.tools.msc.shared.unsignedchar[value])
|
||||
elseif _ACTION >= "vs2019" and cfg.toolset and cfg.toolset == "clang" then
|
||||
local value = iif(cfg.unsignedchar, "On", "Off")
|
||||
table.insert(opts, p.tools.msc.shared.unsignedchar[value])
|
||||
end
|
||||
|
||||
if #opts > 0 then
|
||||
@ -2327,10 +2334,16 @@
|
||||
|
||||
function m.platformToolset(cfg)
|
||||
local tool, version = p.config.toolset(cfg)
|
||||
|
||||
if not version and _ACTION >= "vs2019" and cfg.toolset == "clang" then
|
||||
version = "ClangCL"
|
||||
end
|
||||
|
||||
if not version then
|
||||
local value = p.action.current().toolset
|
||||
tool, version = p.tools.canonical(value)
|
||||
end
|
||||
|
||||
if version then
|
||||
if cfg.kind == p.NONE or cfg.kind == p.MAKEFILE then
|
||||
if p.config.hasFile(cfg, path.iscppfile) or _ACTION >= "vs2015" then
|
||||
|
@ -28,7 +28,7 @@
|
||||
valid_kinds = { "ConsoleApp", "WindowedApp", "StaticLib", "SharedLib", "Makefile", "None", "Utility", "SharedItems" },
|
||||
valid_languages = { "C", "C++", "C#", "F#" },
|
||||
valid_tools = {
|
||||
cc = { "msc" },
|
||||
cc = { "msc", "clang" },
|
||||
dotnet = { "msnet" },
|
||||
},
|
||||
|
||||
|
@ -3255,6 +3255,32 @@
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.XCBuildConfigurationProject_OnCpp20()
|
||||
workspace("MyWorkspace")
|
||||
cppdialect("C++20")
|
||||
prepare()
|
||||
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
|
||||
test.capture [[
|
||||
A14350AC4595EE5E57CE36EC /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "c++2a";
|
||||
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
|
||||
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
OBJROOT = obj/Debug;
|
||||
ONLY_ACTIVE_ARCH = NO;
|
||||
SYMROOT = bin/Debug;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.XCBuildConfigurationProject_OnCppGnu98()
|
||||
workspace("MyWorkspace")
|
||||
cppdialect("gnu++98")
|
||||
@ -3359,6 +3385,32 @@
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.XCBuildConfigurationProject_OnCppGnu20()
|
||||
workspace("MyWorkspace")
|
||||
cppdialect("gnu++20")
|
||||
prepare()
|
||||
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
|
||||
test.capture [[
|
||||
A14350AC4595EE5E57CE36EC /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
|
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++2a";
|
||||
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
|
||||
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
OBJROOT = obj/Debug;
|
||||
ONLY_ACTIVE_ARCH = NO;
|
||||
SYMROOT = bin/Debug;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
]]
|
||||
end
|
||||
|
||||
function suite.XCBuildConfigurationProject_OnUnsignedCharOn()
|
||||
workspace("MyWorkspace")
|
||||
unsignedchar "On"
|
||||
|
@ -1271,10 +1271,12 @@
|
||||
["C++11"] = "c++11",
|
||||
["C++14"] = "c++14",
|
||||
["C++17"] = "c++1z",
|
||||
["C++20"] = "c++2a",
|
||||
["gnu++98"] = "gnu++98",
|
||||
["gnu++11"] = "gnu++0x", -- Xcode project GUI uses gnu++0x, but gnu++11 also works
|
||||
["gnu++14"] = "gnu++14",
|
||||
["gnu++17"] = "gnu++1z"
|
||||
["gnu++17"] = "gnu++1z",
|
||||
["gnu++20"] = "gnu++2a",
|
||||
}
|
||||
|
||||
function xcode.XCBuildConfiguration_CppLanguageStandard(settings, cfg)
|
||||
|
@ -30,6 +30,8 @@
|
||||
|
||||
* On each platform, run `premake5 package <release branch name> binary`
|
||||
|
||||
* Submit Windows binary to [Microsoft malware analysis](https://www.microsoft.com/en-us/wdsi/filesubmission/)
|
||||
|
||||
* Merge working branch to release and tag; push with tags
|
||||
|
||||
* Create new release on GitHub from `CHANGES.txt`; upload files
|
||||
|
@ -768,6 +768,8 @@
|
||||
"C++14",
|
||||
"C++1z",
|
||||
"C++17",
|
||||
"C++2a",
|
||||
"C++20",
|
||||
"gnu++98",
|
||||
"gnu++0x",
|
||||
"gnu++11",
|
||||
@ -775,6 +777,8 @@
|
||||
"gnu++14",
|
||||
"gnu++1z",
|
||||
"gnu++17",
|
||||
"gnu++2a",
|
||||
"gnu++20",
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -75,7 +75,7 @@
|
||||
local cflags = config.mapFlags(cfg, clang.cflags)
|
||||
|
||||
local flags = table.join(shared, cflags)
|
||||
flags = table.join(flags, clang.getwarnings(cfg))
|
||||
flags = table.join(flags, clang.getwarnings(cfg), clang.getsystemversionflags(cfg))
|
||||
|
||||
return flags
|
||||
end
|
||||
@ -84,6 +84,23 @@
|
||||
return gcc.getwarnings(cfg)
|
||||
end
|
||||
|
||||
--
|
||||
-- Returns C/C++ system version related build flags
|
||||
--
|
||||
|
||||
function clang.getsystemversionflags(cfg)
|
||||
local flags = {}
|
||||
|
||||
if cfg.system == p.MACOSX or cfg.system == p.IOS then
|
||||
local minVersion = p.project.systemversion(cfg)
|
||||
if minVersion ~= nil then
|
||||
local name = iif(cfg.system == p.MACOSX, "macosx", "iphoneos")
|
||||
table.insert (flags, "-m" .. name .. "-version-min=" .. p.project.systemversion(cfg))
|
||||
end
|
||||
end
|
||||
|
||||
return flags
|
||||
end
|
||||
|
||||
--
|
||||
-- Build a list of C++ compiler flags corresponding to the settings
|
||||
@ -103,7 +120,7 @@
|
||||
local shared = config.mapFlags(cfg, clang.shared)
|
||||
local cxxflags = config.mapFlags(cfg, clang.cxxflags)
|
||||
local flags = table.join(shared, cxxflags)
|
||||
flags = table.join(flags, clang.getwarnings(cfg))
|
||||
flags = table.join(flags, clang.getwarnings(cfg), clang.getsystemversionflags(cfg))
|
||||
return flags
|
||||
end
|
||||
|
||||
|
@ -144,7 +144,7 @@
|
||||
function gcc.getcflags(cfg)
|
||||
local shared_flags = config.mapFlags(cfg, gcc.shared)
|
||||
local cflags = config.mapFlags(cfg, gcc.cflags)
|
||||
local flags = table.join(shared_flags, cflags)
|
||||
local flags = table.join(shared_flags, cflags, gcc.getsystemversionflags(cfg))
|
||||
flags = table.join(flags, gcc.getwarnings(cfg))
|
||||
return flags
|
||||
end
|
||||
@ -163,6 +163,23 @@
|
||||
return result
|
||||
end
|
||||
|
||||
--
|
||||
-- Returns C/C++ system version build flags
|
||||
--
|
||||
|
||||
function gcc.getsystemversionflags(cfg)
|
||||
local flags = {}
|
||||
|
||||
if cfg.system == p.MACOSX then
|
||||
local minVersion = p.project.systemversion(cfg)
|
||||
if minVersion ~= nil then
|
||||
table.insert (flags, "-mmacosx-version-min=" .. minVersion)
|
||||
end
|
||||
end
|
||||
|
||||
return flags
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Returns list of C++ compiler flags for a configuration.
|
||||
@ -183,6 +200,8 @@
|
||||
["C++14"] = "-std=c++14",
|
||||
["C++1z"] = "-std=c++1z",
|
||||
["C++17"] = "-std=c++17",
|
||||
["C++2a"] = "-std=c++2a",
|
||||
["C++20"] = "-std=c++20",
|
||||
["gnu++98"] = "-std=gnu++98",
|
||||
["gnu++0x"] = "-std=gnu++0x",
|
||||
["gnu++11"] = "-std=gnu++11",
|
||||
@ -190,6 +209,8 @@
|
||||
["gnu++14"] = "-std=gnu++14",
|
||||
["gnu++1z"] = "-std=gnu++1z",
|
||||
["gnu++17"] = "-std=gnu++17",
|
||||
["gnu++2a"] = "-std=gnu++2a",
|
||||
["gnu++20"] = "-std=gnu++20",
|
||||
},
|
||||
rtti = {
|
||||
Off = "-fno-rtti"
|
||||
@ -209,7 +230,7 @@
|
||||
local shared_flags = config.mapFlags(cfg, gcc.shared)
|
||||
local cxxflags = config.mapFlags(cfg, gcc.cxxflags)
|
||||
local flags = table.join(shared_flags, cxxflags)
|
||||
flags = table.join(flags, gcc.getwarnings(cfg))
|
||||
flags = table.join(flags, gcc.getwarnings(cfg), gcc.getsystemversionflags(cfg))
|
||||
return flags
|
||||
end
|
||||
|
||||
|
@ -61,5 +61,6 @@ return {
|
||||
-- -- Toolset tests
|
||||
"tools/test_dotnet.lua",
|
||||
"tools/test_gcc.lua",
|
||||
"tools/test_clang.lua",
|
||||
"tools/test_msc.lua",
|
||||
}
|
||||
|
71
tests/tools/test_clang.lua
Normal file
71
tests/tools/test_clang.lua
Normal file
@ -0,0 +1,71 @@
|
||||
--
|
||||
-- tests/test_clang.lua
|
||||
-- Automated test suite for the GCC toolset interface.
|
||||
-- Copyright (c) 2009-2013 Jason Perkins and the Premake project
|
||||
--
|
||||
|
||||
local p = premake
|
||||
local suite = test.declare("tools_clang")
|
||||
|
||||
local clang = p.tools.clang
|
||||
local project = p.project
|
||||
|
||||
|
||||
--
|
||||
-- Setup/teardown
|
||||
--
|
||||
|
||||
local wks, prj, cfg
|
||||
|
||||
function suite.setup()
|
||||
wks, prj = test.createWorkspace()
|
||||
system "Linux"
|
||||
end
|
||||
|
||||
local function prepare()
|
||||
cfg = test.getconfig(prj, "Debug")
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Check Mac OS X deployment target flags
|
||||
--
|
||||
|
||||
function suite.cflags_macosx_systemversion()
|
||||
system "MacOSX"
|
||||
systemversion "10.9"
|
||||
prepare()
|
||||
test.contains({ "-mmacosx-version-min=10.9" }, clang.getcflags(cfg))
|
||||
end
|
||||
|
||||
function suite.cxxflags_macosx_systemversion()
|
||||
system "MacOSX"
|
||||
systemversion "10.9"
|
||||
prepare()
|
||||
test.contains({ "-mmacosx-version-min=10.9" }, clang.getcxxflags(cfg))
|
||||
end
|
||||
|
||||
function suite.cxxflags_macosx_systemversion_unspecified()
|
||||
system "MacOSX"
|
||||
prepare()
|
||||
test.excludes({ "-mmacosx-version-min=10.9" }, clang.getcxxflags(cfg))
|
||||
end
|
||||
|
||||
--
|
||||
-- Check iOS deployment target flags
|
||||
--
|
||||
|
||||
function suite.cflags_ios_systemversion()
|
||||
system "iOS"
|
||||
systemversion "12.1"
|
||||
prepare()
|
||||
test.contains({ "-miphoneos-version-min=12.1" }, clang.getcflags(cfg))
|
||||
end
|
||||
|
||||
function suite.cxxflags_ios_systemversion()
|
||||
system "iOS"
|
||||
systemversion "5.0"
|
||||
prepare()
|
||||
test.contains({ "-miphoneos-version-min=5.0" }, clang.getcxxflags(cfg))
|
||||
end
|
||||
|
@ -382,6 +382,30 @@
|
||||
test.contains({ "-dynamiclib" }, gcc.getldflags(cfg))
|
||||
end
|
||||
|
||||
--
|
||||
-- Check Mac OS X deployment target flags
|
||||
--
|
||||
|
||||
function suite.cflags_macosx_systemversion()
|
||||
system "MacOSX"
|
||||
systemversion "10.9"
|
||||
prepare()
|
||||
test.contains({ "-mmacosx-version-min=10.9" }, gcc.getcflags(cfg))
|
||||
end
|
||||
|
||||
function suite.cxxflags_macosx_systemversion()
|
||||
system "MacOSX"
|
||||
systemversion "10.9:10.15"
|
||||
prepare()
|
||||
test.contains({ "-mmacosx-version-min=10.9" }, gcc.getcxxflags(cfg))
|
||||
end
|
||||
|
||||
function suite.cxxflags_macosx_systemversion_unspecified()
|
||||
system "MacOSX"
|
||||
prepare()
|
||||
test.excludes({ "-mmacosx-version-min=10.9" }, gcc.getcxxflags(cfg))
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Check Windows variants on LDFLAGS.
|
||||
@ -786,6 +810,20 @@
|
||||
test.contains({ }, gcc.getcflags(cfg))
|
||||
end
|
||||
|
||||
function suite.cxxflags_onCpp2a()
|
||||
cppdialect "C++2a"
|
||||
prepare()
|
||||
test.contains({ "-std=c++2a" }, gcc.getcxxflags(cfg))
|
||||
test.contains({ }, gcc.getcflags(cfg))
|
||||
end
|
||||
|
||||
function suite.cxxflags_onCpp20()
|
||||
cppdialect "C++20"
|
||||
prepare()
|
||||
test.contains({ "-std=c++20" }, gcc.getcxxflags(cfg))
|
||||
test.contains({ }, gcc.getcflags(cfg))
|
||||
end
|
||||
|
||||
function suite.cxxflags_onCppGnu98()
|
||||
cppdialect "gnu++98"
|
||||
prepare()
|
||||
@ -814,6 +852,20 @@
|
||||
test.contains({ }, gcc.getcflags(cfg))
|
||||
end
|
||||
|
||||
function suite.cxxflags_onCppGnu2a()
|
||||
cppdialect "gnu++2a"
|
||||
prepare()
|
||||
test.contains({ "-std=gnu++2a" }, gcc.getcxxflags(cfg))
|
||||
test.contains({ }, gcc.getcflags(cfg))
|
||||
end
|
||||
|
||||
function suite.cxxflags_onCppGnu20()
|
||||
cppdialect "gnu++20"
|
||||
prepare()
|
||||
test.contains({ "-std=gnu++20" }, gcc.getcxxflags(cfg))
|
||||
test.contains({ }, gcc.getcflags(cfg))
|
||||
end
|
||||
|
||||
--
|
||||
-- Test unsigned-char flags.
|
||||
--
|
||||
|
Loading…
Reference in New Issue
Block a user