premake / premake-core Goto Github PK
View Code? Open in Web Editor NEWPremake
Home Page: https://premake.github.io/
License: BSD 3-Clause "New" or "Revised" License
Premake
Home Page: https://premake.github.io/
License: BSD 3-Clause "New" or "Revised" License
While building premake on linux with make -f Bootstrap.mak linux
, I get this error:
./build/bootstrap/premake_bootstrap embed
Error: /home/ipopov/devel/premake-core/src/base/globals.lua:77: module 'xcode' not found:
no field package.preload['xcode']
no file './xcode.lua'
no file '/usr/local/share/lua/5.1/xcode.lua'
no file '/usr/local/share/lua/5.1/xcode/init.lua'
no file '/usr/local/lib/lua/5.1/xcode.lua'
no file '/usr/local/lib/lua/5.1/xcode/init.lua'
no file './xcode.so'
no file '/usr/local/lib/lua/5.1/xcode.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
stack traceback:
[C]: in function 'base'
/home/ipopov/devel/premake-core/src/base/globals.lua:77: in function </home/ipopov/devel/premake-core/src/base/globals.lua:76>
(tail call): ?
...home/ipopov/devel/premake-core/src/_premake_main.lua:116: in function '?'
...e/ipopov/devel/premake-core/src/base/_foundation.lua:71: in function 'callArray'
...home/ipopov/devel/premake-core/src/_premake_main.lua:359: in function <...home/ipopov/devel/premake-core/src/_premake_main.lua:358>
Bootstrap.mak:61: recipe for target 'linux' failed
make: *** [linux] Error 1
I don't need any xcode support.
I am using Ubuntu 15.04 on a 64-bit laptop.
PS:
It appeared that for some reason git submodules were not updated properly. Everything is OK now. Yhe issue cen be closed.
%{cfg.buildtarget.abspath} returns a relative path instead of an absolute path.
My usage :
filter "options:not static"
kind "SharedLib"
postbuildcommands ("{COPY} %{cfg.buildtarget.abspath} "..os.getcwd().."/../")
I'm on windows, building for vs2013
I've been thinking about this one for a while, and wonder if we can add a "catagory" field to the newoption API, so that we can distinguish between "vanilla premake", "blizzard " and "buildfile" specific options...
right now, everything gets clumped together in the --help output under "OPTIONS", but I would like to have that display "OPTION", with a list of stuff, then "OPTIONS - Blizzard", with a bunch of our own stuff, and then "OPTIONS - SC2_Game", or something like that...
any suggestions? objections? ideas?
$ ./premake5
Error: [string "src/_premake_main.lua"]:45: module 'xcode' not found:
no field package.preload['xcode']
no file './xcode.lua'
no file '/usr/local/share/lua/5.1/xcode.lua'
no file '/usr/local/share/lua/5.1/xcode/init.lua'
no file '/usr/local/lib/lua/5.1/xcode.lua'
no file '/usr/local/lib/lua/5.1/xcode/init.lua'
no file './xcode.so'
no file '/usr/local/lib/lua/5.1/xcode.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
if (lua_gettop(L) == 1) {
sep = "\\";
}
Shouldn't that be dependent on the OS that path.translate is called on?
If I build a standard premake5.lua with "premake5 vs2012", and have a "dependson" directive in one of the projects, an old-style solution dependency is still emitted. The project references you have set up inside of .vcxproj files is sufficient.
The specific code that is generating this is the "premake.vstudio.sln2005.projects" function. The code it calls (sln2005.projectdependencies) needs to be skipped for vs2012 (and possibly vs2010).
I couldn't find any docs on the "runtime" function. Had to get TurkeyMan to help.
This issue is a reminder to add this to the docs.
The current method of specifying custom build commands (the buildcommands, buildinputs, and buildoutputs APIs) don't allow multiple rule sets, with their own inputs and outputs to be specified. The values all get lumped together during project baking and the intended associations get lost.
Probably need to bring back the previous buildrule { ... } syntax.
GitHub have nice release hosting (see under release tag), so no more need to store binary releases on sourceforge.
I have a solution contain a project, the source directory like
engine
--include
--src
i want to generate vs project like
engine
--core
----.h,.cpp
--math
----.h,.cpp
so how can i create the virtual folder such as core,math and find files?
Is this intentional, because it seems like a bug?
For instance, I'm passing:
linkoptions "/NODEFAULTLIB:libc.lib"
Why these Tokens
target.abspath
target.basename
target.bundlename
target.bundlepath
target.directory
target.extension
target.name
target.prefix
target.relpath
target.suffix
not use in postbuildcommands
.
I will copy target and it's map file and pdb file to other path, pack those send to FTP server.
it is base on target name and path, but these tokens are not invalid in postbuildcommands.
i use $(TargetPath)
$(TargetDir)
VS support. others, use name directly. that is not good.
i think it is valuable in postbuildcommands
when generating vs2013 solution using premake4, an exception raised and give the following error message:
Building configurations...
Running action 'vs2013'...
[string "newaction..."]:14: attempt to index global 'vstudio' (a nil value)
There doesn't appear to be a way to set the "Ignore Specific Default Libraries" field in a Visual Studio project. (Located in Project Properties -> Linker -> Input)
The workaround is to use:
linkoptions { '/NODEFAULTLIB:"libraryname"' }
Hello,
I've just created 3 project calling "premake5 vs2013"
in the solution I have 2 project which works perfectly fine and one which have the platform toolset option set to visual 2010 (not installed on my machine).
Has anyone seen this issue? Is there a work around?
I didn't believe it at first, but xcopy seems to be the worst copy utility ever made.
By default, premake5 adds the "/E" argument which sould mean "recursive, including empty folders".
The problem is when you try to copy a file, it will also copy the hierarchy of the folder this file is in (only folders, no files).
The "/S" (which should mean recursive except empty folders) is also flawed, but it is much more random. Sometimes it copies 1 or 2 folders sometimes it doesn't...
I can't think of any reason it does that, but it does (tested on win7).
To try it just xcopy /E or /S a file which have sibling folders into an empty folder.
It seems the "/E" option should never be used when copying a single file... I blame xcopy on that one.
I have no idea how this can be fixed, robocopy just denies the copy of a single file if /E or /S is used.
I am using Premake5 Alpha3. DebugCommand and DebugDir are not working properly for me. The command and directory are set in the project settings but using relative paths and VS complaints about this. When I convert everything to absolute path in the project settings of VS everything works. I think the paths need to be extended to absolute for this to work.
Thanks!
-Dirk
http://stackoverflow.com/questions/30699971/how-to-prevent-absolute-paths-in-dynamic-linker
Unfortunately, this is blocking my project. Since I'm not explicitly specifying explicit paths, this is probably a bug.
What's the go with emitting this EntryPointSymbol
field into VS projects.
LIBCMT.lib(crt0.obj) : error LNK2019: unresolved external symbol main referenced in function __tmainCRTStartup
I've been having link troubles with this for years, but I always just go into my project and fix it.
I finally bothered to dig into premake and work out why it's emitting it. I see that unless the WinMain
flag is defined, it is written.
Do we think this is right?
Surely if kind is WindowedApp, and os is windows, then this should be the default?
It never occurred to me that I would have to set WinMain flag in addition to WindowedApp, and I've just quietly put up with this for years... even though the solution was super obvious.
Opinions?
If premake fails to parse an "required" extension for some reason, for example :
if True then print("b") else print("c") else -- here we wrote else instead of end
Then no error reported, but "required" fails with "module not found".
This behavior makes hard to develop extensions.
PS. not sure if it's premake or lua default behavior.
Premake5 add Custom Rules and rules, it's great.
but i have exist file. how to add into my project?
for example ragel.props
whish you add. Thx.
Hi,
What about supporting Ninja on Linux?
Thanks!
If the premake script defines an install
action, it would be nice to emit an install
rule to makefiles which just executes premake5 install
... only trouble is, knowing the path/command to execute premake.
Ideas?
Possible to capture the binary being run for the gmake
action and use the same command?
Today I met one question, some C99 code in msvc must compile by C++ compile.
but msvc default /TC or /TP choice by ext. so i add this code to force build by C++.
filter 'action:vs*'
buildoptions '/TP'
I generate gmake file, also choice as cc by ext.
I think premake maybe add a forcelanguage
.
in my memory, premake4 a prev verstion, language
is force choice.
I'm trying to do something quite simple, basically copy some headers as part of a post build command. It looks like this:
local headers = path.getabsolute(path.join(LLVMRootDir, "lib/"))
postbuildcommands { copy .. " " .. headers .. " " .. "%{cfg.targetdir}" }
And I get this in the Makefile after generation:
cp -rf /vagrant/CppSharp/deps/llvm/lib ../lib/Debug_x32
For some other reason (trying to workaround something else) I was trying to make the second path absolute, so I tried using %{path.getabsolute(cfg.targetdir)}
but the path remained relative.
I checked the source and it seems the detokening process tries hard to keep paths relative. What is the reason for this?
When creating a vs2015 solution, some of my projects (but not all) did not have
<PlatformToolset>v140</PlatformToolset>
I then tried to explicitly set the platform toolset using
toolset("v140")
That caused the following error:
invalid value 'v140' for toolset
I write a TotalCommander Plugins wlx_csv, use it's environment path COMMANDER_PATH
, you can see my Premake5.lua.
targetdir '$(COMMANDER_PATH)/Plugins/wlx/csv'
my COMMANDER_PATH value is D:\tools\TC8\totalcmd
But, I use premake5 gmake
and make the project and show this
==== Building wlx_csv (debug) ====
Running prebuild commands
on
ragel -T1 ../csv/csv.rl
csv.c
Linking wlx_csv
d:/prog/tdm-gcc-32/bin/../lib/gcc/mingw32/4.8.1/../../../../mingw32/bin/ld.exe: cannot open output file D:toolsTC8totalcmd/Plugins/wlx/csv/wlx_csv.wlx: No such file or directory
collect2.exe: error: ld returned 1 exit status
make[1]: *** [D:\tools\TC8\totalcmd/Plugins/wlx/csv/wlx_csv.wlx] Error 1
make: *** [wlx_csv] Error 2
the backslash isn't double backslash, so make COMMANDER_PATH invalid.
I wrote a Makefile and use $@
for -o
param. this COMMANDER_PATH is available.
I see the Premake generated Makefile
TARGETDIR = $(COMMANDER_PATH)/Plugins/wlx/csv
TARGET = $(TARGETDIR)/wlx_csv.wlx
...
LINKCMD = $(CC) -o $(TARGET) $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS)
Maybe use TARGETDIR directly make that error.
I modify
LINKCMD = $(CC) -o "$@" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS)
or modify $(TARGET), it is pass again
LINKCMD = $(CC) -o $(subst \,/,$(TARGET)) $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS)
But I think, is it -o
problem?
LINKCMD = $(CC) -o "$(TARGET)" $(OBJECTS) $(RESOURCES) $(ALL_LDFLAGS) $(LIBS)
yeah~ it is pass again!
So, I wish can solve the bug.
Thx.
if I make a project that does not have the targetdir set.
solution 'SC2'
configurations { 'Release', 'Debug' }
platforms { 'x86', 'x86_64' }
project 'Test'
kind 'StaticLib'
files { '**.cpp' }
I get this in my visual studio project:
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>.\</OutDir>
<IntDir>obj\x86\Release\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>.\</OutDir>
<IntDir>obj\x86_64\Release\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<OutDir>.\</OutDir>
<IntDir>obj\x86\Debug\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>.\</OutDir>
<IntDir>obj\x86_64\Debug\</IntDir>
</PropertyGroup>
the "IntDir" properties correctly contain both platform and configuration...
but the "OutDir" are all '.', making each build overwrite each other.
it would probably be better to make the default behave the same as "IntDir", or not set the property at all and make it use the visual studio default.
With premake5.lua contents like this:
solution "Foo"
location "FooDir"
configurations {"Debug", "Release"}
platforms {"Win32", "x64"}
filter "platforms:Win32"
architecture "x86"
filter "platforms:x64"
architecture "x64"
project "BarLib"
location "libs/BarLib"
kind "StaticLib"
language "C++"
files {"AutoGen/*AutoGen*.c", "*.c"}
And after running premake5 vs2012, I get the following output snippet in BarLib.vcxproj:
...
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug Win32|Win32">
<Configuration>Debug Win32</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug Win32|x64">
<Configuration>Debug Win32</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release Win32|Win32">
<Configuration>Release Win32</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release Win32|x64">
<Configuration>Release Win32</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
...
And Foo.sln contains the following snippet:
...
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{919BEEA8-7D3D-197F-66F8-2CD35239A0CF}.Debug|Win32.ActiveCfg = Debug Win32|Win32
{919BEEA8-7D3D-197F-66F8-2CD35239A0CF}.Debug|Win32.Build.0 = Debug Win32|Win32
{919BEEA8-7D3D-197F-66F8-2CD35239A0CF}.Debug|x64.ActiveCfg = Debug|x64
{919BEEA8-7D3D-197F-66F8-2CD35239A0CF}.Debug|x64.Build.0 = Debug|x64
{919BEEA8-7D3D-197F-66F8-2CD35239A0CF}.Release|Win32.ActiveCfg = Release Win32|Win32
{919BEEA8-7D3D-197F-66F8-2CD35239A0CF}.Release|Win32.Build.0 = Release Win32|Win32
{919BEEA8-7D3D-197F-66F8-2CD35239A0CF}.Release|x64.ActiveCfg = Release|x64
{919BEEA8-7D3D-197F-66F8-2CD35239A0CF}.Release|x64.Build.0 = Release|x64
EndGlobalSection
...
Note what's wrong: a configuration that has the platform concatenated onto it, and then the platform again concatenated.
Debug Win32|Win32
Debug Win32|x64
Release Win32|Win32
Release Win32|x64
Am I doing something wrong, or is this a bug?
Hi,
It would be awesome to have QtCreator support right?
Cheers,
Alex
In premake 4 I was doing something like the following:
for i, platform in ipairs(solution().platforms) do
configuration {platform}
targetdir ("build/" .. platform .. "/" .. project().name)
end
Now in premake 5, I get the following error when trying to call project():
Error: no project in scope
project().name still works everywhere else. It only seems to be a problem when I am iterating over the list of platforms or configurations from the solution object. I have also replaced my configuration call with filter.
Also, is there a better or more preferred way, in premake 5, to iterate over platforms and configurations?
As discussed a number of times.
The clean action in the C# make backend is not implemented.
Clean:
vagrant@vagrant-ubuntu-trusty-64:/vagrant/CppSharp$ config=release_x64 make -C build/gmake/ clean
make: Entering directory `/vagrant/CppSharp/build/gmake'
make[1]: Nothing to be done for `clean'.
Cleaning Basic.Native
make[1]: Nothing to be done for `clean'.
make[1]: Nothing to be done for `clean'.
make[1]: Nothing to be done for `clean'.
make: Leaving directory `/vagrant/CppSharp/build/gmake'
After clean:
vagrant@vagrant-ubuntu-trusty-64:/vagrant/CppSharp$ ls -lh build/gmake/lib/Release_x64/*.dll
-rwxrwxrwx 1 vagrant vagrant 98K Jul 10 22:12 build/gmake/lib/Release_x64/Basic.CSharp.dll
-rwxrwxrwx 1 vagrant vagrant 16K Jul 10 22:12 build/gmake/lib/Release_x64/Basic.Tests.CSharp.dll
Checking the Premake source in make_csharp.lua
reveals why:
function make.csCleanRules(prj, toolset)
--[[
-- porting from 4.x
_p('clean:')
_p('\t@echo Cleaning %s', prj.name)
_p('ifeq (posix,$(SHELLTYPE))')
_p('\t$(SILENT) rm -f $(TARGETDIR)/%s.* $(COPYFILES)', target.basename)
_p('\t$(SILENT) rm -rf $(OBJDIR)')
_p('else')
_p('\t$(SILENT) if exist $(subst /,\\\\,$(TARGETDIR)/%s) del $(subst /,\\\\,$(TARGETDIR)/%s.*)', target.name, target.basename)
for target, source in pairs(cfgpairs[anycfg]) do
_p('\t$(SILENT) if exist $(subst /,\\\\,%s) del $(subst /,\\\\,%s)', target, target)
end
for target, source in pairs(copypairs) do
_p('\t$(SILENT) if exist $(subst /,\\\\,%s) del $(subst /,\\\\,%s)', target, target)
end
_p('\t$(SILENT) if exist $(subst /,\\\\,$(OBJDIR)) rmdir /s /q $(subst /,\\\\,$(OBJDIR))')
_p('endif')
_p('')
--]]
end
I am trying to migrate from Premake4 to 5, but I've hit an issue
We have a large workspace/solution that includes multiple projects in separate directories. With structure as such:
../sln/premake4.lua
../sln/src
../projA/projA_premake.lua
../projA/src/..
../projB/projB_premake.lua
../projB/src/..
sln/premake4.lua contains the Solution definition and any solution wide config options, then calls the files for all the project using dofile, like this:
solution "test"
location "src"
configurations "debug"
platforms "linux"
dofile "../projA/projA_premake.lua"
dofile "../projB/projB_premake.lua"
With premake4 the workspace file is correctly generated in sln/src, but with premake5 it is generated in the projB directory. I've had a quick look at the code and I've noticed that the generate function calls path.getabsolute() which uses the current working directory. I'm guessing that either the dofile or something else is changing the working directory, but so far haven't been able to work out where to change it to the correct directory for the location as set in the solution directive.
If you define (for instance) this at the project level
flags { "Symbols" }
But then define this with a filter on specific source files
flags { "Optimize" }
optimize "Speed"
It is possible to see this error when you build in visual studio.
cl : Command line error D8016: '/ZI' and '/O2' command-line options are incompatible
The bug seems to be the fact that the function m.clCompileFiles does not call m.debugInformationFormat() at the file level if necessary (if optimization is switched on for specific files).
prerequisites
mkdir testfiles
touch testfiles/{x64,win32}{bla,foo}
touch testfiles/{foo,baa}
premake5.lua:
solution "myTestSln"
location "testfiles/sln"
platforms { "x64", "win32" }
configurations { "debug", "release" }
project "myTestPrj1"
kind "Utility"
files "testfiles/%{cfg.platform}*"
Problem
No files are in the project.
Cause
The files
function calls later in progress the store
function (api.lua:765).
This function find a "*" and call os.matchfiles
, which didn't find something. This is okay, because at this time we cannot detoken all tokens but we have to do this in such a case.
store = function(field, current, value, processor)
print(value)
if value:find("*") then
print("glob detected")
value = os.matchfiles(value)
for i, file in ipairs(value) do
value[i] = path.getabsolute(value[i])
end
else
print("no glob detected")
value = path.getabsolute(value)
end
return value
end,
Fix
a) detokenize in the function above (in my opinion not a good idea)
b) make os.matchfiles later in the oven. But I have no clue if a complete fileliste is important before the oven runs.
I will do the fix if someone can answer me which solution is the best.
Tried to run tests, this is the output from the latest premake version:
Running action 'test'...
xcode_project.XCBuildConfigurationTarget_OnInfoPlist: ...emakeFork/modules/xcode/tests/test_xcode_project.lua:1010: (8) expected:
INFOPLIST_FILE = "../../MyProject-Info.plist";
...but was:
INFOPLIST_FILE = "D:/MyProject-Info.plist";
stack traceback:
...emakeFork/modules/xcode/tests/test_xcode_project.lua:1010: in function <...emakeFork/modules/xcode/tests/test_xcode_project.lua:992>
vstudio_vs2010_rule_vars.onPathVar: ...Fork/tests/actions/vstudio/vc2010/test_rule_vars.lua:108: (2) expected:
<MyVar>..\..\path\to\file</MyVar>
...but was:
<MyVar>D:\path\to\file</MyVar>
stack traceback:
...Fork/tests/actions/vstudio/vc2010/test_rule_vars.lua:108: in function <...Fork/tests/actions/vstudio/vc2010/test_rule_vars.lua:100>
running time : 2.562
1149 tests passed, 2 failed
Do you run them on Travis-CI?
I'm trying to figure out where the bug is here, but if I generate a solution and projects with this setup:
Solution MySolution
configurations { "Debug", "Release" }
platforms {"Win32", "x64", "Durango" }
project MyProject
....
(And yes, I have overriden some functions in premake to allow the Durango platform)
It outputs them in the XML in this order:
Debug|Durango
Debug|Win32
Debug|x64
Release|Durango
Release|Win32
Release|x64
However, when I load the projects into Visual Studio 2012, Visual studio helpfully reorders the configurations to be in the following order:
Debug|Win32
Debug|x64
Debug|Durango
Release|Win32
Release|x64
Release|Durango
This wouldn't be a big deal except you have to deal with the reload of the projects.
Is there a sort function or something that is making premake not pay attention to the order of platforms as I specify them?
In the last official build, premake5.exe is correctly shipped with xcode4 action from the embedded module but it's not the case for the unix executable. We need to rebuild the unix version with premake5.exe to get the action. Thanks !
prerequisites
premake5.lua
local qt_bin_path = "C:/dev/mx/v1/dep/qt/qt_33_x64_bin"
solution "myTestSln"
location "testfiles/sln"
platforms "x64"
configurations "release"
project "myTestPrj1"
kind "Utility"
files (qt_bin_path.."/bin/QtDeclarative_sofistik33_x64_4.dll")
filter "files:**/*.dll"
buildmessage ([[%{file.name} (copy)]])
buildcommands [[xcopy /y "%{file.path:gsub("/","\\")}" "bla"]]
buildoutputs ("bla")
filter "*"
Problem
The resulting path can be an absolute and all "" in the path are replaced by "/". There is - afaik - no possibility to change the slashes and not all Windows tools - like xcopy - can handle paths with "/".
Cause
If premake is detecting absolute paths in non path variables, they are replaced by relative paths. This is not possible all the time (not sure but here can be a bug, too). It's never possible on Windows system where files are placed over different Partitions (C:; D:).
detoken.lua:66
local isAbs = path.isabsolute(result)
if isAbs and not field.paths and basedir then
result = path.getrelative(basedir, result)
end
The path.getrelative function calls path.normalize which replaces all the "" to "/". This is not the system specification but required for further processing in premake.
path_normalize.c:30
if (ch == '\\') {
ch = '/';
}
possible Solution
Allow avoiding path fixing.
detoken.lua:66
local isAbs = path.isabsolute(result)
if type(result) == "string" and result:find("!$") then
result = result:match("(.-)!$"):gsub("/","\\")
elseif isAbs and not field.paths and basedir then
result = path.getrelative(basedir, result)
end
premake5.lua (part replacement)
buildcommands [[xcopy /y "%{file.path.."!"}" "bla"]]
Or is there a way I didn't see?
Having custom buildoptions (and linkoptions) often require some *-config tools to be run for creating proper flags. I think this is supposed to be done with os.outputof(). However the final newline character gets carried over in the final Makefile. For example:
buildoptions { os.outputof("pkg-config --cflags jansson"), os.outputof("wx-config --cppflags") }
will result in an unwanted newline in the Makefile:
ALL_CFLAGS += $(CFLAGS) $(ALL_CPPFLAGS) -g -I/usr/local/Cellar/jansson/2.7/include
-I/usr/local/Cellar/wxmac/3.0.2/lib/wx/include/osx_cocoa-unicode-3.0 -I/usr/local/Cellar/wxmac/3.0.2/include/wx-3.0 -D_FILE_OFFSET_BITS=64 -DwxDEBUG_LEVEL=0 -DWXUSINGDLL -D__WXMAC__ -D__WXOSX__ -D__WXOSX_COCOA__
causing gmake to fail with *** missing separator. Stop.
As discussed on the forum, 'workspace' seems a more natural term for more users.
It would be good to switch this over at some point.
I'm using Premake5 (stable and nightly) for gmake on mac 10.9.5 (clang 5.1).
Basing my premake file off the 'first scriI noticed that with a super simple c++ hello world file, I was able to run the make file for debug, but not for release. In release I would get a linker error:
ld: internal error: atom not found in symbolIndex(__ZNSt3__1lsINS_11char_traitsIcEEEERNS_13basic_ostreamIcT_EES6_PKc) for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
The only difference between the debug and release configuration in my premake5.lua file is that debug has flags { "Symbols" }
while release does not. It seems that when this flag is left off for a given configuration, it has -Wl,-x
appended to the ALL_LDFLAGS
variable in the resulting make file.
-Wl,-x
is what is causing this linker error. It seems to be a known issue for clang on mac 10.9, but has yet to be fixed. In the meantime, I would like to know if there is a way for me to prevent premake from adding this flag.
For reference, here are my premake5.lua file and the resulting project makefile, after running premake5 gmake
.
How can I prevent -Wl,-x
from being added to the ALL_LDFLAGS
makefile variable? I don't think always adding the Symbols
flag is an acceptable workaround, since I may not want to use the -g
compiler flag in a release build.
_EDIT_: I'm not sure, but this issue on the old forums seems to be similar: http://industriousone.com/topic/how-remove-flags-ldflags, although the end of the thread seems to indicate that the issue was fixed in revision 23d8ffcc9144.
In these lines: https://github.com/premake/premake-core/blob/master/src/base/premake.lua#L172-L196
premake.filename
's comment has third param?
are you copy the premake.generate
's comment? or add some codes in future?
Hello,
I'm not sure this could be an improvement as it might already be possible although i don't know how to do it.
Put simply, on premake 4, I wanted to favor clang if it was present on the platform, rather than gcc, and here is the script I used :
if os.execute("clang -v") == 0 then
premake.gcc.cc = 'clang'
premake.gcc.cxx = 'clang++'
elseif ...
Now on premake5 the premake.gcc value doesn't exist anymore, I tried setting premake.cc and premake.cxx instead of premake.gcc.cc and premake.gcc.cxx but it doesn't work.
Is it possible to do this the proper way ? If not, that would be a very interesting new feature to add.
includedirs { "src" }
in premake config file will generate ..\src;%(AdditionalIncludeDirectories)
for Additional Include Directories in visual studio 2013. But ..\src
seems only relative to the current code source file, not relative to $(ProjectDir)
. Should premake add $(ProjectDir)
before ..\src
?
Hello,
I run into this issue, well describe here
https://bitbucket.org/premake/premake-dev/issue/260/group-produces-incorrect-results-in-visual
I don't know if you want me to stop duplicating issues from bitbucket?
I'm running premake5 alpha 3
I'm using premake 5.0-alpha3 to create a VS2010 project where I need to link to an .obj file.
I'm unable to use the "links" command as premake adds the ".lib" suffix, eg:
links { "something.obj" }
will add "something.obj.lib" to the project dependencies.
Is it possible to make the links function check for .obj and not add the lib suffix?
(The workaround for the moment is to use "linkoptions" to link with the obj)
I am trying to produce a .vcxproj for VS2012 that supports both Win32 and x64 targets, and produces Windows XP compatible executables for the Win32 version. The only way this is possible is to mix both v110 and v110_xp platform toolsets in this .vcxproj.
I am looking to see if it's possible to expand the acceptable list of platform toolsets to include v110_xp.
MSDN link describing v110_xp
It seems like an action is bound to only provide one platform toolset for any code generation 'session', so I'm not sure the architecture of premake even would allow this as it is.
Any thoughts about this?
I am attempting to make 2 solution files in my project. One that contains all projects, and a second that contains a subset of the same projects.
Your wiki page on the subject indicates this is possible, but I'm not seeing a way through with the API as it is.
a) I can't specify the same project name without re-specifying all the details I already did further up in the same script.
b) The externalproject command requires a bunch of details. For instance, the uuid. And, the location. Both of which are internally known already (or only).
There ought to be a way to refer to the existing project declaration. Do you have plans for a "projectref" command?
The upshot of what i'm asking for is to generate a second solution with references to already generated project files.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.