Comments (11)
We might need a little more information here. Can you provide a small sample project that reproduces the problem?
from premake-core.
@dgregorycryptic linkoptions
should definitely be passed through to the librarian, you can specify additional link options under Librarian -> Command Line -> Additional Options (In VS2013, assuming it's the same location for VS2012). So I would say this is working as intended, additionally, based off the options in Librarian -> General, specifying /NODEFAULTLIB:libc.lib
is also valid. Also, I noticed that it's not possible to use the ignoredefaultlibraries
API, so I'll submit a fix for that and any other APIs that are available in the librarian. :)
@starkos while hunting this down, I've come across some weirdness. In vs2010_vcxproj.lua, there's two functions m.link and m.lib, these appear like they should actually be merged together, as a static lib doesn't seem to use the output of m.link and only a static lib has output from m.lib. I'll start working on a PR for this, unless there's a reason these shouldn't be merged?
from premake-core.
It is not the case that every linker command line option is proper to send the the librarian tool (at least, in Visual Studio). So merging the two together seems wrong.
Additional Options that you enter under Librarian -> Command Line -> Additional Options are only passed to the librarian tool, not the linker.
I chose an option that happened to be shared between the two. Perhaps that is confusing the issue.
How about /OPT:REF or /OPT:ICF? Those need to be able to be sent to just the linker, never the librarian. At the moment, the only way to make that happen is to filter the setting of linkoptions.
from premake-core.
there's two functions
m.link
andm.lib
, these appear like they should actually be merged together
m.lib
is for static libraries, and corresponds to the <Lib>
XML element. m.link
is for everything, and corresponds to the <Link>
element.
from premake-core.
Sorry guys, I re-read what I posted and in my attempt to not post a big wall of text, I ended up removing some important information. Firstly, I used VS2013 and one of the contrib projects for testing, so there's a chance that what I've found is different for earlier versions of Visual Studio.
Once everything was generated, I checked what the vcxproj contained, in regards to m.lib
and m.link
. This is what I found for Debug|Win32:
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
Upon opening the project properties in VS and navigating to Librarian->General, neither of these options were set. Setting one of them and saving the project, results in the following output to the vcxproj:
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
<Lib>
<SubSystem>Windows</SubSystem>
</Lib>
(GenerateDebugInformation isn't in the Librarian in VS2013, this seems like an invalid output?)
This is what makes me believe we should merge those two functions together, and just change the parent element tag output (<Link>
vs <Lib>
). Both of the element functions m.elements.link and m.elements.lib contain a specific check for static libs, and both are populated with outputs (different outputs, except for the additional options which exists for both).
The only thing I'm unsure on is what other versions of VS do in terms of these elements. Is there a version of VS that uses both for a static library, or is this something that can be simplified? Either way, there's API's, such as ignoredefaultlibraries
(m.ignoreDefaultLibraries
), that should be added to the static library outputs as they're valid options.
from premake-core.
@starkos have you had a chance to read this wall of text? I'm happy to put together a PR as an example of what I mean by merging the functions together, if that helps?
from premake-core.
This is what makes me believe we should merge those two functions together, and just change the parent element tag output ( vs ).
I guess I'm not sure what you are going to merge, as both functions are basically just shells around a call array. I would guess (don't have the right VM here to look) that I created two functions to make it easier to override static/shared output for specific cases. I would bet that somewhere I am suppressing <Lib>
entirely for a target platform.
This is clearly a separate issue from the bugs though; it sounds like you've identified a couple of those that should get fixed.
from premake-core.
Reopening this one, see discussion on PR #440. I'll revisit it with a narrower fix.
from premake-core.
I'm revisiting this now, and could still use some additional information. Can you post a short sample project that demonstrates the problem? (In particular, I need to know what kind of projects you are trying to generate.)
Also, for the specific case you mentioned, does ignoredefaultlibraries { "libc" }
work?
from premake-core.
I have not checked the newer ignoredefaultlibraries command.
When I submitted this originally, it was the case that linkoptions was being passed not only to the linker, but also the librarian.
That on the surface feels wrong. Like I said above on 9/15/2015, not every linker option is valid to send to the librarian.
from premake-core.
Then perhaps we need a new API. I would like to have some real examples in hand before I try to implement any kind of solution.
If you feel this is no longer a problem for you, feel free to close it out. Thanks!
from premake-core.
Related Issues (20)
- XCode does not show linked Libraries HOT 8
- Object File Collision Detection Part II: Visual Studio C++ modules HOT 1
- Premake 6
- [VS] Source Build Help HOT 4
- Error while building Premake 5 on CentOS 7 HOT 6
- xcode4 bug with generated file with same name, but different path
- How to handle conflicting API (in external modules)? HOT 1
- Issue trying to fix x86 Linux build HOT 1
- configmap for externalproject does not map correctly HOT 1
- The Makefile generated by `premake5 gmake2` calls `sh.exe` HOT 9
- Api in _preload.lua inaccessible HOT 6
- It would be nice to have better error identification. HOT 3
- Make failing Command Tokens fail the build HOT 1
- Visual Studio "Previous IPDB not found, fall back to full compilation." HOT 3
- Premake system toolset selection issue HOT 5
- Configuration filters don't work correctly for postbuildcommands in C# projects HOT 1
- Linking ".a" archive file is unsupported. HOT 2
- startproject ignored if workspace is set to the same name as another project within the workspace HOT 2
- Deprecation language in docs is not clear. HOT 1
- Is CodeCoverage Flags working for gmake2 g++ HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from premake-core.