Added pic (position independent code) api, used all over the place.
This commit is contained in:
parent
e7a05b69a0
commit
48db64e9a9
@ -644,6 +644,16 @@
|
||||
tokens = true,
|
||||
}
|
||||
|
||||
api.register {
|
||||
name = "pic",
|
||||
scope = "config",
|
||||
kind = "string",
|
||||
allowed = {
|
||||
"Off",
|
||||
"On",
|
||||
}
|
||||
}
|
||||
|
||||
api.register {
|
||||
name = "platforms",
|
||||
scope = "project",
|
||||
@ -1148,4 +1158,7 @@
|
||||
targetextension ".dll"
|
||||
implibextension ".dll"
|
||||
|
||||
filter { "kind:SharedLib", "system:not Windows" }
|
||||
pic "On"
|
||||
|
||||
filter {}
|
||||
|
@ -48,11 +48,6 @@
|
||||
Fast = "-ffast-math",
|
||||
Strict = "-ffloat-store",
|
||||
},
|
||||
kind = {
|
||||
SharedLib = function(cfg)
|
||||
if cfg.system ~= premake.WINDOWS then return "-fPIC" end
|
||||
end,
|
||||
},
|
||||
strictaliasing = {
|
||||
Off = "-fno-strict-aliasing",
|
||||
Level1 = { "-fstrict-aliasing", "-Wstrict-aliasing=1" },
|
||||
@ -67,6 +62,9 @@
|
||||
Size = "-Os",
|
||||
Speed = "-O3",
|
||||
},
|
||||
pic = {
|
||||
On = "-fPIC",
|
||||
},
|
||||
vectorextensions = {
|
||||
AVX = "-mavx",
|
||||
AVX2 = "-mavx2",
|
||||
|
Loading…
Reference in New Issue
Block a user