build-system

CMake - Accessing configuration parameters of multiple-configuration generators

和自甴很熟 提交于 2019-12-11 02:40:06
问题 I'm using CMake to generate a Visual Studio solution. I want my solution to have multiple configurations - x86 Debug/Release and x86_64 Debug/Release. For each of these configurations, I need to link my project against different versions of my dependencies (i.e. I need the 64-bit, debug build against the 64-bit, debug version of the unit test library). Here is how I want to do it: I'll place the binary versions of dependencies into folders names after the configurations, for example: <project

How do I force a target to be rebuilt if a variable is set?

丶灬走出姿态 提交于 2019-12-10 09:22:50
问题 Assume I have a build-target foo: foo:foo.c $(CC) $(CFLAGS) $(ARGS) -c foo.c -o foo Now, ARGS is something that I pass on the command line: $ make ARGS:=-DX=1 foo So, I need to bypass make's cleverness, because the foo target does not only depend on which files have changed, but also on the value of ARGS . Is there something in make to do this? My hack (see answer) doesn't seem to be the most elegant but it works. Anything better? 回答1: Here is a general solution to your specific problem. You

Build system for an embedded C/C++ project

橙三吉。 提交于 2019-12-09 10:18:16
问题 I am looking for a high-level build system/tool that can help organise my embedded C project into "modules" and "components". Note that these two terms are highly subjective so my definitions are given below. A module is a cohesive collection of c and h files but with only one public h file that is visible to other modules. A component (or a layer) on the other hand is a collection of modules (e.g. Application layer, Library layer, Driver layer, RTOS layer etc.). The build system/tool should

How to show result of python script in a console when running from ST editor?

送分小仙女□ 提交于 2019-12-09 06:05:36
问题 I'm new to Sublime Text so am unfamiliar with its internals so far. From what I could tell the problem could be something related to this. I have a python script var = raw_input("Enter something: ") print "You entered ", var which asks for input, waits for it, then prints it out in windows console prompt. How do I make ST3 upon "building" to show the results in a console window? 回答1: It's really simple just issue a command to start a new cmd.exe . start cmd /K python main.py See here for more

how to modify the install-path without running the configure script/cmake again

∥☆過路亽.° 提交于 2019-12-09 04:13:24
问题 I am working on a project which takes considerable time to build (10-15) minutes. I have recompiled to verify if there is a compilation error. Now I want to change the install directory so that I have a new version of executable with the new changes. Is there a method to just modify the install path so that the 'make install' installs to a new location rather than the old one? 回答1: CMake generated makefiles support the DESTDIR coding convention for makefiles. Thus you can override the default

How to adjust the path that Emacs' compile-goto-error gets from the compilation buffer?

懵懂的女人 提交于 2019-12-08 15:05:09
问题 This question was migrated from Software Engineering Stack Exchange because it can be answered on Stack Overflow. Migrated 7 years ago . I am using Emacs 23 and have the following problem: I run our project's build system from within Emacs like M-x compile -> cd /foo/bar && ./build The build system now does some magic, "cd"s into some subdirectory for the build process and then gcc throws an error: ../src/somesource.cc:50 error: blablabla Now the problem is that Emacs won't find that path,

Overriding SCons Cache Copy Function

元气小坏坏 提交于 2019-12-08 05:26:43
问题 I'm trying to figure out how to override the behaviour when SCons copies artifacts from the cache directory (given by CacheDir) to used hard-links. My current try def link_or_copy_file(class_instance, src, dst): # do hardlinking instead... SCons.Defaults.DefaultEnvironment()._copy_from_cache = link_or_copy_file SCons.Defaults.DefaultEnvironment()._copy2_from_cache = link_or_copy_file env = Environment() env._copy_from_cache = link_or_copy_file env._copy2_from_cache = link_or_copy_file has no

A good strategy for implementing a versioning system

邮差的信 提交于 2019-12-06 02:19:17
问题 I have been struggling with versioning software for a while now. I'm not talking about a naming convention, I'm talking about how to actually apply a version in a build system all the way through to a release. I generally use major.minor.maintenance-[release type] i.e. 1.0.2-rc1 The problem is managing the version number. I've tried many ways (sticking it in a build file, a properties file, a database, etc,etc) but I haven't found anything that really works well. The closest thing I came up

How to create Sublime Text 3 build system which reads shebang

落爺英雄遲暮 提交于 2019-12-04 14:06:14
How can I create a build system in Sublime Text 3 where "cmd" is replaced with a shebang if it exists? More specifically, is there a way to alter the Python build system to use the version of Python specified in the shebang, and use a default if no shebang is present? Sublime build systems have an option named target which specifies a WindowCommand that is to be invoked to perform the build. By default this is the internal exec command. You can create your own command that would examine the file for a shebang and use that interpreter or some default otherwise. For example (caveat: I'm not

Configure Sublime Text build system for Scala?

ぃ、小莉子 提交于 2019-12-04 07:39:47
I'm trying to configure a build system for Scala with SublimeText, but I am having some difficulty. I have tried both of the following: { "shell_cmd": "scala", "working_dir": "${project_path:${folder}}", "selector": "source.scala" } { "cmd": ["/path/to/bin/scala", "$file_name"], "working_dir": "${project_path:${folder}}", "selector": "source.scala", "shell": true } Both of these attempts produce the same failed output - it seems to start up the interactive Scala shell rather than running my script. Any advice? The answer that worked turned out to be very close to the second answer - apparently