Merge remote-tracking branch 'origin/master' into struct-member-align
This commit is contained in:
commit
80e2bb02e6
@ -234,3 +234,29 @@ cmd2</StartupCommands>
|
|||||||
</Completion>
|
</Completion>
|
||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
-- Setup/Teardown
|
||||||
|
---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
function suite.OnProjectCfg_UnsignedCharOn()
|
||||||
|
unsignedchar "On"
|
||||||
|
prepare()
|
||||||
|
codelite.project.compiler(cfg)
|
||||||
|
test.capture [[
|
||||||
|
<Compiler Options="-funsigned-char" C_Options="-funsigned-char" Assembler="" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" UseDifferentPCHFlags="no" PCHFlags="">
|
||||||
|
</Compiler>
|
||||||
|
]]
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
function suite.OnProjectCfg_UnsignedCharOff()
|
||||||
|
unsignedchar "Off"
|
||||||
|
prepare()
|
||||||
|
codelite.project.compiler(cfg)
|
||||||
|
test.capture [[
|
||||||
|
<Compiler Options="-fno-unsigned-char" C_Options="-fno-unsigned-char" Assembler="" Required="yes" PreCompiledHeader="" PCHInCommandLine="no" UseDifferentPCHFlags="no" PCHFlags="">
|
||||||
|
</Compiler>
|
||||||
|
]]
|
||||||
|
end
|
||||||
|
@ -116,6 +116,17 @@
|
|||||||
tokens = true,
|
tokens = true,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
p.api.register {
|
||||||
|
name = "debuggerflavor",
|
||||||
|
scope = "config",
|
||||||
|
kind = "string",
|
||||||
|
allowed = {
|
||||||
|
"Local",
|
||||||
|
"Remote",
|
||||||
|
"WebBrowser",
|
||||||
|
"WebService"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Decide when the full module should be loaded.
|
-- Decide when the full module should be loaded.
|
||||||
|
@ -1239,6 +1239,35 @@
|
|||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Check UnsignedChar.
|
||||||
|
--
|
||||||
|
|
||||||
|
function suite.unsignedChar_On()
|
||||||
|
unsignedchar "On"
|
||||||
|
prepare()
|
||||||
|
test.capture [[
|
||||||
|
<ClCompile>
|
||||||
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
<AdditionalOptions>/J %(AdditionalOptions)</AdditionalOptions>
|
||||||
|
</ClCompile>
|
||||||
|
]]
|
||||||
|
end
|
||||||
|
|
||||||
|
function suite.unsignedChar_Off()
|
||||||
|
unsignedchar "Off"
|
||||||
|
prepare()
|
||||||
|
test.capture [[
|
||||||
|
<ClCompile>
|
||||||
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
|
</ClCompile>
|
||||||
|
]]
|
||||||
|
end
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Check StructMemberAlignment
|
-- Check StructMemberAlignment
|
||||||
--
|
--
|
||||||
|
@ -101,3 +101,22 @@ foo=bar</LocalDebuggerEnvironment>
|
|||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Test Debugger Flavor
|
||||||
|
--
|
||||||
|
|
||||||
|
function suite.debuggerFlavor_OnWindowsLocal()
|
||||||
|
debuggerflavor "Local"
|
||||||
|
prepare()
|
||||||
|
test.capture [[
|
||||||
|
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
|
||||||
|
]]
|
||||||
|
end
|
||||||
|
|
||||||
|
function suite.debuggerFlavor_OnWindowsRemote()
|
||||||
|
debuggerflavor "Remote"
|
||||||
|
prepare()
|
||||||
|
test.capture [[
|
||||||
|
<DebuggerFlavor>WindowsRemoteDebugger</DebuggerFlavor>
|
||||||
|
]]
|
||||||
|
end
|
||||||
|
@ -1370,6 +1370,12 @@
|
|||||||
table.insert(opts, "/std:c++latest")
|
table.insert(opts, "/std:c++latest")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
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])
|
||||||
|
end
|
||||||
|
|
||||||
if #opts > 0 then
|
if #opts > 0 then
|
||||||
opts = table.concat(opts, " ")
|
opts = table.concat(opts, " ")
|
||||||
m.element("AdditionalOptions", condition, '%s %%(AdditionalOptions)', opts)
|
m.element("AdditionalOptions", condition, '%s %%(AdditionalOptions)', opts)
|
||||||
|
@ -79,7 +79,17 @@
|
|||||||
|
|
||||||
|
|
||||||
function m.debuggerFlavor(cfg)
|
function m.debuggerFlavor(cfg)
|
||||||
if cfg.debugdir or cfg.debugcommand then
|
local map = {
|
||||||
|
Local = "WindowsLocalDebugger",
|
||||||
|
Remote = "WindowsRemoteDebugger",
|
||||||
|
WebBrowser = "WebBrowserDebugger",
|
||||||
|
WebService = "WebServiceDebugger"
|
||||||
|
}
|
||||||
|
|
||||||
|
local value = map[cfg.debuggerflavor]
|
||||||
|
if value then
|
||||||
|
p.w('<DebuggerFlavor>%s</DebuggerFlavor>', value)
|
||||||
|
elseif cfg.debugdir or cfg.debugcommand then
|
||||||
p.w('<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>')
|
p.w('<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>')
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -2486,6 +2486,58 @@
|
|||||||
]]
|
]]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function suite.XCBuildConfigurationProject_OnUnsignedCharOn()
|
||||||
|
workspace("MyWorkspace")
|
||||||
|
unsignedchar "On"
|
||||||
|
prepare()
|
||||||
|
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
|
||||||
|
test.capture [[
|
||||||
|
[MyProject:Debug(2)] /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
|
||||||
|
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
|
||||||
|
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
|
||||||
|
GCC_CHAR_IS_UNSIGNED_CHAR = YES;
|
||||||
|
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_OnUnsignedCharOff()
|
||||||
|
workspace("MyWorkspace")
|
||||||
|
unsignedchar "Off"
|
||||||
|
prepare()
|
||||||
|
xcode.XCBuildConfiguration_Project(tr, tr.configs[1])
|
||||||
|
test.capture [[
|
||||||
|
[MyProject:Debug(2)] /* Debug */ = {
|
||||||
|
isa = XCBuildConfiguration;
|
||||||
|
buildSettings = {
|
||||||
|
ARCHS = "$(NATIVE_ARCH_ACTUAL)";
|
||||||
|
CONFIGURATION_BUILD_DIR = "$(SYMROOT)";
|
||||||
|
CONFIGURATION_TEMP_DIR = "$(OBJROOT)";
|
||||||
|
GCC_CHAR_IS_UNSIGNED_CHAR = NO;
|
||||||
|
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
|
||||||
|
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
-- XCBuildConfigurationList tests
|
-- XCBuildConfigurationList tests
|
||||||
---------------------------------------------------------------------------
|
---------------------------------------------------------------------------
|
||||||
|
@ -1100,6 +1100,10 @@
|
|||||||
|
|
||||||
settings["GCC_SYMBOLS_PRIVATE_EXTERN"] = 'NO'
|
settings["GCC_SYMBOLS_PRIVATE_EXTERN"] = 'NO'
|
||||||
|
|
||||||
|
if cfg.unsignedchar ~= nil then
|
||||||
|
settings['GCC_CHAR_IS_UNSIGNED_CHAR'] = iif(cfg.unsignedchar, "YES", "NO")
|
||||||
|
end
|
||||||
|
|
||||||
if cfg.flags.FatalWarnings then
|
if cfg.flags.FatalWarnings then
|
||||||
settings['GCC_TREAT_WARNINGS_AS_ERRORS'] = 'YES'
|
settings['GCC_TREAT_WARNINGS_AS_ERRORS'] = 'YES'
|
||||||
end
|
end
|
||||||
|
@ -1336,6 +1336,12 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
api.register {
|
||||||
|
name = "unsignedchar",
|
||||||
|
scope = "config",
|
||||||
|
kind = "boolean",
|
||||||
|
}
|
||||||
|
|
||||||
p.api.register {
|
p.api.register {
|
||||||
name = "structmemberalign",
|
name = "structmemberalign",
|
||||||
scope = "config",
|
scope = "config",
|
||||||
|
@ -61,7 +61,8 @@
|
|||||||
vectorextensions = gcc.shared.vectorextensions,
|
vectorextensions = gcc.shared.vectorextensions,
|
||||||
isaextensions = gcc.shared.isaextensions,
|
isaextensions = gcc.shared.isaextensions,
|
||||||
warnings = gcc.shared.warnings,
|
warnings = gcc.shared.warnings,
|
||||||
symbols = gcc.shared.symbols
|
symbols = gcc.shared.symbols,
|
||||||
|
unsignedchar = gcc.shared.unsignedchar
|
||||||
}
|
}
|
||||||
|
|
||||||
clang.cflags = table.merge(gcc.cflags, {
|
clang.cflags = table.merge(gcc.cflags, {
|
||||||
|
@ -96,6 +96,10 @@
|
|||||||
},
|
},
|
||||||
symbols = {
|
symbols = {
|
||||||
On = "-g"
|
On = "-g"
|
||||||
|
},
|
||||||
|
unsignedchar = {
|
||||||
|
On = "-funsigned-char",
|
||||||
|
Off = "-fno-unsigned-char"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -99,7 +99,11 @@
|
|||||||
},
|
},
|
||||||
symbols = {
|
symbols = {
|
||||||
On = "/Z7"
|
On = "/Z7"
|
||||||
|
},
|
||||||
|
unsignedchar = {
|
||||||
|
On = "/J",
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
msc.cflags = {
|
msc.cflags = {
|
||||||
|
@ -788,3 +788,23 @@
|
|||||||
test.contains({ "-std=gnu++17" }, gcc.getcxxflags(cfg))
|
test.contains({ "-std=gnu++17" }, gcc.getcxxflags(cfg))
|
||||||
test.contains({ }, gcc.getcflags(cfg))
|
test.contains({ }, gcc.getcflags(cfg))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Test unsigned-char flags.
|
||||||
|
--
|
||||||
|
|
||||||
|
function suite.sharedflags_onUnsignedChar()
|
||||||
|
unsignedchar "On"
|
||||||
|
|
||||||
|
prepare()
|
||||||
|
test.contains({ "-funsigned-char" }, gcc.getcxxflags(cfg))
|
||||||
|
test.contains({ "-funsigned-char" }, gcc.getcflags(cfg))
|
||||||
|
end
|
||||||
|
|
||||||
|
function suite.sharedflags_onNoUnsignedChar()
|
||||||
|
unsignedchar "Off"
|
||||||
|
|
||||||
|
prepare()
|
||||||
|
test.contains({ "-fno-unsigned-char" }, gcc.getcxxflags(cfg))
|
||||||
|
test.contains({ "-fno-unsigned-char" }, gcc.getcflags(cfg))
|
||||||
|
end
|
||||||
|
@ -160,6 +160,25 @@
|
|||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
--
|
||||||
|
-- Check the translation of unsignedchar.
|
||||||
|
--
|
||||||
|
|
||||||
|
function suite.sharedflags_onUnsignedCharOn()
|
||||||
|
unsignedchar "On"
|
||||||
|
prepare()
|
||||||
|
test.contains({ "/J" }, msc.getcflags(cfg))
|
||||||
|
test.contains({ "/J" }, msc.getcxxflags(cfg))
|
||||||
|
end
|
||||||
|
|
||||||
|
function suite.sharedflags_onUnsignedCharOff()
|
||||||
|
unsignedchar "Off"
|
||||||
|
prepare()
|
||||||
|
test.excludes({ "/J" }, msc.getcflags(cfg))
|
||||||
|
test.excludes({ "/J" }, msc.getcxxflags(cfg))
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- Check handling of debugging support.
|
-- Check handling of debugging support.
|
||||||
--
|
--
|
||||||
|
Reference in New Issue
Block a user