build-process

How do I put all required JAR files in a library folder inside the final JAR file with Maven?

↘锁芯ラ 提交于 2019-11-26 15:47:37
I am using Maven in my standalone application, and I want to package all the dependencies in my JAR file inside a library folder, as mentioned in one of the answers here: How can I create an executable JAR with dependencies using Maven? I want my final JAR file to have a library folder that contains the dependencies as JAR files, not like what the maven-shade-plugin that puts the dependencies in the form of folders like the Maven hierarchy in the .m2 folder. Well, actually the current configuration does what I want, but I am having a problem with loading the JAR files when running the

Can I compile all .cpp files in src/ to .o's in obj/, then link to binary in ./?

旧时模样 提交于 2019-11-26 15:38:20
My project directory looks like this: /project Makefile main /src main.cpp foo.cpp foo.h bar.cpp bar.h /obj main.o foo.o bar.o What I would like my makefile to do would be to compile all .cpp files in the /src folder to .o files in the /obj folder, then link all the .o files in /obj into the output binary in the top-level folder /project . I have next to no experience with Makefiles, and am not really sure what to search for to accomplish this. Also, is this a "good" way to do this, or is there a more standard approach to what I'm trying to do? Makefile part of the question This is pretty easy

The benefits / disadvantages of unity builds? [duplicate]

烂漫一生 提交于 2019-11-26 15:24:49
This question already has an answer here: #include all .cpp files into a single compilation unit? 5 answers Since starting at a new company I've noticed that they use unity cpp files for the majority of our solution, and I was wondering if anyone is able to give me a definitive reason as to why and how these speed up the build process? I would've thought that editing one cpp file in the unity files will force recompilation of all of them. akent Very similar question and good answers here: #include all .cpp files into a single compilation unit? The summary seems to be that less I/O overhead is

ld linker question: the --whole-archive option

 ̄綄美尐妖づ 提交于 2019-11-26 15:14:32
The only real use of the --whole-archive linker option that I have seen is in creating shared libraries from static ones. Recently I came across Makefile(s) which always use this option when linking with in house static libraries. This of course causes the executables to unnecessarily pull in unreferenced object code. My reaction to this was that this is plain wrong, am I missing something here ? The second question I have has to do with something I read regarding the whole-archive option but couldn't quite parse. Something to the effect that --whole-archive option should be used while linking

Using CMake to generate Visual Studio C++ project files

你。 提交于 2019-11-26 15:12:26
问题 I am working on an open source C++ project, for code that compiles on Linux and Windows. I use CMake to build the code on Linux. For ease of development setup and political reasons, I must stick to Visual Studio project files/editor on Windows (I can't switch to Code::Blocks, for example). I see instructions to generate Visual Studio files using CMake, as here. Have you used CMake to generate Visual Studio files before? How has been your experience? Suppose I want to add a new file to my

What is your experience with non-recursive make? [closed]

徘徊边缘 提交于 2019-11-26 14:53:13
A few years ago, I read the Recursive Make Considered Harmful paper and implemented the idea in my own build process. Recently, I read another article with ideas about how to implement non-recursive make . So I have a few data points that non-recursive make works for at least a few projects. But I'm curious about the experiences of others. Have you tried non-recursive make ? Did it make things better or worse? Was it worth the time? Ville Laurikari We use a non-recursive GNU Make system in the company I work for. It's based on Miller's paper and especially the "Implementing non-recursive make"

VisualStudio: How to save the obj folder somewhere else

China☆狼群 提交于 2019-11-26 12:57:49
问题 Does anyone know how to tell VS(2008) where to save the obj folder when building the solution? We have it save the bin folder to another path in order to keep the source file folders small (ie. emailable), but can\'t find any way to tell it to do the same with obj... 回答1: Use the BaseIntermediateOutputPath property in the project file ( .csproj , .vbproj , etc.), as explained at http://msdn.microsoft.com/en-us/library/bb629394.aspx. You'll have to manually edit the XML document using a text

Can a program depend on a library during compilation but not runtime?

依然范特西╮ 提交于 2019-11-26 12:51:09
问题 I understand the difference between runtime and compile-time and how to differentiate between the two, but I just don\'t see the need to make a distinction between compile-time and runtime dependencies . What I\'m choking on is this: how can a program not depend on something at runtime that it depended on during compilation? If my Java app uses log4j, then it needs the log4j.jar file in order to compile (my code integrating with and invoking member methods from inside log4j) as well as

What Can I Do To Reduce My Executable's Size (Delphi)?

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-26 12:44:38
问题 I release a single executable (.EXE) for a desktop program using Delphi 2009. I have no external DLLs or resources that I need for the program to run. I use two components: LMD Innovative\'s ELPack and Sergey Tkachenko\'s TRichView that are compiled into my executable. When I build my production version, using the \"Release\" build configuration, the executable file produced is 13,533 KB. Prior to using Delphi 2009, I was using Delphi 4. The executable it produced was only 2,671 KB while

How to run Visual Studio post-build events for debug build only

孤者浪人 提交于 2019-11-26 12:34:38
How can I limit my post-build events to running only for one type of build? I'm using the events to copy DLLs to a local IIS virtual directory but I don't want this happening on the build server in release mode. Joseph Daigle Pre- and Post-Build Events run as a batch script. You can do a conditional statement on $(ConfigurationName) . For instance if $(ConfigurationName) == Debug xcopy something somewhere FYI, you do not need to use goto. the shell IF command can be used with round brackets: if $(ConfigurationName) == Debug ( copy "$(TargetDir)myapp.dll" "c:\delivery\bin" /y copy "$(TargetDir