Added pic (position independent code) api, used all over the place.

This commit is contained in:
Manu Evans 2015-04-01 01:44:14 +10:00
parent e7a05b69a0
commit 48db64e9a9
2 changed files with 16 additions and 5 deletions

View File

@ -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 {}

View File

@ -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",