scons

Linking to boost through SConstruct

梦想的初衷 提交于 2019-12-06 08:27:56
I'm trying to work on a cross-platform project that uses boost for the file/directory operations. I've been using visual studio, but in order to compile on linux, I've decided to switch to SConstruct. I cannot [correctly?] link to the filesystem library however. my SConstruct file is as follow: vLibs = [ 'libboost_system-vc100-mt-1_44.lib', 'libboost_filesystem-vc100-mt-1_44.lib']; # LIBS=vLibs, env = Environment(); env.AppendUnique(CXXFLAGS=Split("/EHsc")); env.Append(CPPPATH = ["C:\\Program Files (x86)\\boost\\boost_1_44"]); env.Append(LIBPATH = ["C:\\Program Files (x86)\\boost\\boost_1_44\

Why does an std::any_cast of a passed std::any inside a dlopen'd function raise an error

纵然是瞬间 提交于 2019-12-06 03:42:35
I am toying around with c++17 and plugins, and I have run into an error that I cannot get around. In the following MWE I can call a local function that takes a std::any , and everything works as expected when I try to read the contents. When I load this exact same function through a plugin (dlopen), it correctly sees the type on the any, but it cannot std::any_cast the contents. Any help would be greatly appreciated in figuring out what is causing this error. Here is my environment, MWE, and resulting error. >> g++ --version g++ (GCC) 7.1.1 20170526 (Red Hat 7.1.1-2) Copyright (C) 2017 Free

Scons: Generating version file only if target has changed

 ̄綄美尐妖づ 提交于 2019-12-05 17:04:39
I have a requirement to generate version.cc file from SCons Script. This file should be generated only if any of the source file for a target has changed. Suppose the SCons script has the following statements #python function which generates version.cc in the same folder where libtest.a is generated. This will always generate a differnt version.cc because the version string contained inside that will have timestamp GenerateVersionCode() #target which uses version.cc libtest = env.Library('test', ['a.cc', 'b.cc', 'version.cc']) First time when I run the above code everything is fine. But when I

How to debug SCons scripts using eclipse and pydev?

佐手、 提交于 2019-12-05 14:39:50
I'm a newbie to SCons and also using pydev. Can someone help me with instructions on how to debug scons scripts using Eclipse and pydev? Is it even possible considering the fact that SCons is a seperate app and not an extension to python? I'm not an Eclipse expert, but since you didn't get any other answer... If you make the SCons source a part of the Eclipse project, and run the whole command from within Eclipse it should work like any Eclipse debugging. SCons is written in Python, there is no reason it shouldn't be debuggable in Eclipse just like anything else. You are right. Since the SCons

How do I set scons system include path

旧时模样 提交于 2019-12-05 12:52:17
问题 Using scons I can easily set my include paths: env.Append( CPPPATH=['foo'] ) This passes the flag -Ifoo to gcc However I'm trying to compile with a lot of warnings enabled. In particular with env.Append( CPPFLAGS=['-Werror', '-Wall', '-Wextra'] ) which dies horribly on certain boost includes ... I can fix this by adding the boost includes to the system include path rather than the include path as gcc treats system includes differently. So what I need to get passed to gcc instead of -Ifoo is

How can I get SCons to replace text in installed text files

安稳与你 提交于 2019-12-05 10:47:58
I'd like to be able to replace a template variable ('$(SOFTWARE_VERSION)') while installing some python scripts from scons. Does scons already have such functionality? If not, what's the best way to hook into the scons install process so I can do this during install? You could use the Substfile method. This takes a input file and produces an output file substituting marked variables. So if you have script.py.in : #!/usr/bin/python print "$SOFTWARE_VERSION" Then you can use the following SConsctruct file to generate an output: env = Environment(tools=['textfile']) script_dict = {'\$SOFTWARE

SCons long command line TEMPFILE with MinGW

守給你的承諾、 提交于 2019-12-05 10:15:58
I'm trying to build a shared library from gcc and gfortran objects using SCons and MinGW on Windows, but during the final link the command line is too long, in excess of 18000 characters. I know I need to use a tempfile (response file?) to pass the command line, but I can't find a way to get SCons to do this directly. I was using CMake for this library and it handled the response file without my interference. SCons appears to be using the CommandGeneratorAction to generate the shared library command line. Is there a way to tell this action to use the response file mechanism? Is there another

What do you do to make compiler lines shorter?

浪尽此生 提交于 2019-12-05 06:11:34
Often when I'm working on a project with others, the amount of library paths and include paths that get sourced by the compiler in the Makefile get more numerous as time goes by. Also the paths can get very long as well. Here's an example: g++ -c -pipe -O2 -Wall -W -DQT_BOOTSTRAPPED -DQT_MOC -DQT_NO_CODECS -DQT_LITE_UNICODE -DQT_NO_LIBRARY -DQT_NO_STL -DQT_NO_COMPRESS -DQT_NO_DATASTREAM -DQT_NO_TEXTSTREAM -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_THREAD -DQT_NO_REGEXP -DQT_NO_QOBJECT -DQT_NO_SYSTEMLOCALE -DQT_NO_GEOM_VARIANT -DQT_NO_USING_NAMESPACE -D_LARGEFILE64_SOURCE -D_LARGEFILE

How do I filter an SCons Glob result?

情到浓时终转凉″ 提交于 2019-12-05 02:57:10
问题 I sometimes want to exclude certain source files from a Glob result in SCons. Usually it's because I want to compile that source file with different options. Something like this: objs = env.Object(Glob('*.cc')) objs += env.Object('SpeciallyTreatedFile.cc', CXXFLAGS='-O0') Of course, that creates a problem for SCons: scons: *** Two environments with different actions were specified for the same target: SpeciallyTreatedFile.o I usually work around this using the following idiom: objs = env

SCons, Boost::ASIO, Windows Precompiled Headers, and Linker Errors

家住魔仙堡 提交于 2019-12-05 02:09:16
问题 I'm investigating using SCons for our build process as we develop C++ for multiple platforms. I'm 99% of the way there in the build configuration, but I'm running into a VERY strange error on Windows having to do with the precompiled header file. Even stranger still is that it only happens on one project. In the SConscript file for this project, I have the following to compile the PCH on windows: if env['PLATFORM'] == 'win32': env['PCH'] = env.PCH('MyPCH-LSCommon.pch', 'Common/src/MyPCH.h')[0