Overrides

30 views
Skip to first unread message

Mihai Sebea

unread,
Sep 5, 2018, 5:31:49 PM9/5/18
to Premake Development
Hi

I'm trying to figure out how premake.override is supposed to work 

I got the latest version from git ..compiled it and I added the following code in premake5.lua file 

print(premake.vstudio.vc2010)
premake.override(premake.vstudio.vc2010, "project", function(base, prj)
premake.w('<!-- Generated by Premake ' .. _PREMAKE_VERSION .. ' -->')
base(prj)
end)

and it sems vc2010 is not defined yet 

the output that i get is 

nil
Error: [string "src/base/_foundation.lua"]:136: attempt to index a nil value (local 'scope')

which makes sense since the scope that I'm overriding is nil

What am I doing wrong ?

Cheers 
Mihai 

starkos

unread,
Sep 5, 2018, 5:34:38 PM9/5/18
to Premake Development
The actions don't get pulled in until they are actually used. If you want to override stuff in the action module, you have to require it first. Off the top of my head, I think it is just `require('vstudio')`.

–st.

Mihai Sebea

unread,
Sep 6, 2018, 3:30:17 AM9/6/18
to Premake Development
Thanks a LOT for the quick reply ! 
It worked ! 

I have updated the documentation to reflect this ! 


let me know if the explanation is clear enough :)

Cheers
Mihai.
Reply all
Reply to author
Forward
0 new messages