Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Miscelanneous cleanups #2283

Merged
merged 7 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/android/android.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if not p.modules.android then
p.modules.android = {}

if _ACTION < "vs2015" then
configuration { "Android" }
filter { "configurations:Android" }
system "android"
toolset "gcc"
end
Expand Down
6 changes: 3 additions & 3 deletions modules/d/tests/test_gmake.lua
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ $(TARGET): $(OBJECTS) $(LDDEPS)
end

function suite.make_targetRules_mixedCompilation()
configuration { "Release" }
filter { "configurations:Release" }
compilationmodel "File"
prepare()
m.make.targetRules(prj)
Expand Down Expand Up @@ -111,7 +111,7 @@ $(OBJDIR)/blah.o: blah.d

function suite.make_fileRules_mixedCompilation()
files { "blah.d" }
configuration { "Release" }
filter { "configurations:Release" }
compilationmodel "File"
prepare()
m.make.dFileRules(prj)
Expand Down Expand Up @@ -148,7 +148,7 @@ OBJECTS := \

function suite.make_objects_mixedCompilation()
files { "blah.d" }
configuration { "Release" }
filter { "configurations:Release" }
compilationmodel "File"
files { "blah2.d" }
prepare()
Expand Down
22 changes: 11 additions & 11 deletions modules/gmake/tests/cpp/test_flags.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
local function prepare(calls)
local cfg = test.getconfig(prj, "Debug")
local toolset = p.tools.gcc
p.callarray(make, calls, cfg, toolset)
p.callArray(calls, cfg, toolset)
end


Expand All @@ -33,7 +33,7 @@

function suite.includeDirs()
includedirs { "src/include", "../include" }
prepare { "includes" }
prepare { make.includes }
test.capture [[
INCLUDES += -Isrc/include -I../include
]]
Expand All @@ -45,7 +45,7 @@
--
function suite.symbols_on()
symbols "on"
prepare { "cFlags", "cxxFlags" }
prepare { make.cFlags, make.cxxFlags }
test.capture [[
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g
Expand All @@ -57,7 +57,7 @@
--
function suite.symbols_default()
symbols "default"
prepare { "cFlags", "cxxFlags" }
prepare { make.cFlags, make.cxxFlags }
test.capture [[
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS)
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS)
Expand All @@ -69,7 +69,7 @@
--
function suite.symbols_fastlink()
symbols "FastLink"
prepare { "cFlags", "cxxFlags" }
prepare { make.cFlags, make.cxxFlags }
test.capture [[
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g
Expand All @@ -78,7 +78,7 @@

function suite.symbols_full()
symbols "full"
prepare { "cFlags", "cxxFlags" }
prepare { make.cFlags, make.cxxFlags }
test.capture [[
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g
Expand All @@ -90,7 +90,7 @@
--
function suite.symbols_off()
symbols "off"
prepare { "cFlags", "cxxFlags" }
prepare { make.cFlags, make.cxxFlags }
test.capture [[
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS)
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS)
Expand All @@ -103,7 +103,7 @@
function suite.symbols_on_default()
symbols "on"
debugformat "Default"
prepare { "cFlags", "cxxFlags" }
prepare { make.cFlags, make.cxxFlags }
test.capture [[
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g
Expand All @@ -113,7 +113,7 @@
function suite.symbols_on_dwarf()
symbols "on"
debugformat "Dwarf"
prepare { "cFlags", "cxxFlags" }
prepare { make.cFlags, make.cxxFlags }
test.capture [[
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -gdwarf
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -gdwarf
Expand All @@ -123,7 +123,7 @@
function suite.symbols_on_split_dwarf()
symbols "on"
debugformat "SplitDwarf"
prepare { "cFlags", "cxxFlags" }
prepare { make.cFlags, make.cxxFlags }
test.capture [[
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -gsplit-dwarf
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -gsplit-dwarf
Expand All @@ -136,7 +136,7 @@
function suite.symbols_off_dwarf()
symbols "off"
debugformat "Dwarf"
prepare { "cFlags", "cxxFlags" }
prepare { make.cFlags, make.cxxFlags }
test.capture [[
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS)
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS)
Expand Down
30 changes: 15 additions & 15 deletions modules/gmake/tests/cpp/test_make_linking.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
local function prepare(calls)
local cfg = test.getconfig(prj, "Debug")
local toolset = p.tools.gcc
p.callarray(make, calls, cfg, toolset)
p.callArray(calls, cfg, toolset)
end


Expand All @@ -34,7 +34,7 @@

function suite.links_onCppSharedLib()
kind "SharedLib"
prepare { "ldFlags", "linkCmd" }
prepare { make.ldFlags, make.linkCmd }
test.capture [[
ALL_LDFLAGS += $(LDFLAGS) -shared -Wl,-soname=libMyProject.so -s
LINKCMD = $(CXX) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS)
Expand All @@ -44,7 +44,7 @@
function suite.links_onMacOSXCppSharedLib()
_TARGET_OS = "macosx"
kind "SharedLib"
prepare { "ldFlags", "linkCmd" }
prepare { make.ldFlags, make.linkCmd }
test.capture [[
ALL_LDFLAGS += $(LDFLAGS) -dynamiclib -Wl,-install_name,@rpath/libMyProject.dylib -Wl,-x
LINKCMD = $(CXX) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS)
Expand All @@ -58,7 +58,7 @@
function suite.links_onCSharedLib()
language "C"
kind "SharedLib"
prepare { "ldFlags", "linkCmd" }
prepare { make.ldFlags, make.linkCmd }
test.capture [[
ALL_LDFLAGS += $(LDFLAGS) -shared -Wl,-soname=libMyProject.so -s
LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS)
Expand All @@ -72,7 +72,7 @@

function suite.links_onStaticLib()
kind "StaticLib"
prepare { "ldFlags", "linkCmd" }
prepare { make.ldFlags, make.linkCmd }
test.capture [[
ALL_LDFLAGS += $(LDFLAGS) -s
LINKCMD = $(AR) -rcs "$@" $(OBJECTS)
Expand All @@ -88,7 +88,7 @@

function suite.links_onUtility()
kind "Utility"
prepare { "linkCmd" }
prepare { make.linkCmd }
test.capture [[
LINKCMD =
]]
Expand All @@ -102,7 +102,7 @@
function suite.links_onMacUniversalStaticLib()
architecture "universal"
kind "StaticLib"
prepare { "ldFlags", "linkCmd" }
prepare { make.ldFlags, make.linkCmd }
test.capture [[
ALL_LDFLAGS += $(LDFLAGS) -s
LINKCMD = libtool -o "$@" $(OBJECTS)
Expand All @@ -121,7 +121,7 @@
kind "StaticLib"
location "build"

prepare { "ldFlags", "libs", "ldDeps" }
prepare { make.ldFlags, make.libs, make.ldDeps }
test.capture [[
ALL_LDFLAGS += $(LDFLAGS) -s
LIBS += build/bin/Debug/libMyProject2.a
Expand All @@ -141,7 +141,7 @@
kind "SharedLib"
location "build"

prepare { "ldFlags", "libs", "ldDeps" }
prepare { make.ldFlags, make.libs, make.ldDeps }
test.capture [[
ALL_LDFLAGS += $(LDFLAGS) -Wl,-rpath,'$$ORIGIN/../../build/bin/Debug' -s
LIBS += build/bin/Debug/libMyProject2.so
Expand All @@ -161,7 +161,7 @@
kind "SharedLib"
location "build"

prepare { "ldFlags", "libs", "ldDeps" }
prepare { make.ldFlags, make.libs, make.ldDeps }
test.capture [[
ALL_LDFLAGS += $(LDFLAGS) -Lbuild/bin/Debug -Wl,-rpath,'$$ORIGIN/../../build/bin/Debug' -s
LIBS += -lMyProject2
Expand All @@ -178,7 +178,7 @@
kind "SharedLib"
location "build"

prepare { "ldFlags", "libs", "ldDeps" }
prepare { make.ldFlags, make.libs, make.ldDeps }
test.capture [[
ALL_LDFLAGS += $(LDFLAGS) -Lbuild/bin/Debug -Wl,-rpath,'@loader_path/../../build/bin/Debug' -Wl,-x
LIBS += -lMyProject2
Expand All @@ -202,7 +202,7 @@
kind "StaticLib"
location "build"

prepare { "ldFlags", "libs", "ldDeps" }
prepare { make.ldFlags, make.libs, make.ldDeps }
test.capture [[
ALL_LDFLAGS += $(LDFLAGS) -s
LIBS += build/bin/Debug/libMyProject2.a build/bin/Debug/libMyProject3.a
Expand All @@ -227,7 +227,7 @@
kind "StaticLib"
location "build"

prepare { "ldFlags", "libs", "ldDeps" }
prepare { make.ldFlags, make.libs, make.ldDeps }
test.capture [[
ALL_LDFLAGS += $(LDFLAGS) -s
LIBS += -Wl,--start-group build/bin/Debug/libMyProject2.a build/bin/Debug/libMyProject3.a -Wl,--end-group
Expand All @@ -244,7 +244,7 @@
function suite.onExternalLibraryWithPath()
location "MyProject"
links { "libs/SomeLib" }
prepare { "ldFlags", "libs" }
prepare { make.ldFlags, make.libs }
test.capture [[
ALL_LDFLAGS += $(LDFLAGS) -L../libs -s
LIBS += -lSomeLib
Expand All @@ -263,7 +263,7 @@
function suite.onExternalLibraryWithPathAndVersion()
location "MyProject"
links { "libs/SomeLib-1.1" }
prepare { "libs", }
prepare { make.libs }
test.capture [[
LIBS += -lSomeLib-1.1
]]
Expand Down
23 changes: 12 additions & 11 deletions modules/gmake2/tests/test_gmake2_flags.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

local p = premake
local gmake2 = p.modules.gmake2
local cpp = gmake2.cpp

local project = p.project

Expand All @@ -25,7 +26,7 @@
local function prepare(calls)
local cfg = test.getconfig(prj, "Debug")
local toolset = p.tools.gcc
p.callarray(gmake2.cpp, calls, cfg, toolset)
p.callArray(calls, cfg, toolset)
end


Expand All @@ -35,7 +36,7 @@

function suite.includeDirs()
includedirs { "src/include", "../include" }
prepare { "includes" }
prepare { cpp.includes }
test.capture [[
INCLUDES += -Isrc/include -I../include
]]
Expand All @@ -46,7 +47,7 @@ INCLUDES += -Isrc/include -I../include
--
function suite.symbols_on()
symbols "on"
prepare { "cFlags", "cxxFlags" }
prepare { cpp.cFlags, cpp.cxxFlags }
test.capture [[
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g
Expand All @@ -58,7 +59,7 @@ ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g
--
function suite.symbols_default()
symbols "default"
prepare { "cFlags", "cxxFlags" }
prepare { cpp.cFlags, cpp.cxxFlags }
test.capture [[
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS)
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS)
Expand All @@ -70,7 +71,7 @@ ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS)
--
function suite.symbols_off()
symbols "off"
prepare { "cFlags", "cxxFlags" }
prepare { cpp.cFlags, cpp.cxxFlags }
test.capture [[
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS)
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS)
Expand All @@ -82,7 +83,7 @@ ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS)
--
function suite.symbols_fastlink()
symbols "FastLink"
prepare { "cFlags", "cxxFlags" }
prepare { cpp.cFlags, cpp.cxxFlags }
test.capture [[
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g
Expand All @@ -91,7 +92,7 @@ ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g

function suite.symbols_full()
symbols "full"
prepare { "cFlags", "cxxFlags" }
prepare { cpp.cFlags, cpp.cxxFlags }
test.capture [[
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g
Expand All @@ -104,7 +105,7 @@ ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g
function suite.symbols_on_default()
symbols "on"
debugformat "Default"
prepare { "cFlags", "cxxFlags" }
prepare { cpp.cFlags, cpp.cxxFlags }
test.capture [[
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g
Expand All @@ -114,7 +115,7 @@ ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -g
function suite.symbols_on_dwarf()
symbols "on"
debugformat "Dwarf"
prepare { "cFlags", "cxxFlags" }
prepare { cpp.cFlags, cpp.cxxFlags }
test.capture [[
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -gdwarf
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -gdwarf
Expand All @@ -124,7 +125,7 @@ ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -gdwarf
function suite.symbols_on_split_dwarf()
symbols "on"
debugformat "SplitDwarf"
prepare { "cFlags", "cxxFlags" }
prepare { cpp.cFlags, cpp.cxxFlags }
test.capture [[
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -gsplit-dwarf
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -gsplit-dwarf
Expand All @@ -137,7 +138,7 @@ ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS) -gsplit-dwarf
function suite.symbols_off_dwarf()
symbols "off"
debugformat "Dwarf"
prepare { "cFlags", "cxxFlags" }
prepare { cpp.cFlags, cpp.cxxFlags }
test.capture [[
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS)
ALL_CXXFLAGS += $(CXXFLAGS) $(ALL_CPPFLAGS)
Expand Down
Loading