MSVC builds for the first time - still a lot of patches required

Some suspicious compiler warnings remain.
This commit is contained in:
Matthias Köfferlein 2018-08-28 23:19:58 +02:00
parent 155208c9c9
commit 860014e3ae
42 changed files with 183 additions and 143 deletions

View File

@ -35,7 +35,8 @@ TEST(1)
opt.add_options (cmd);
char *argv[] = { "x",
const char *argv[] = {
"x",
"-os=1.25",
"-od=0.125",
"--drop-empty-cells",
@ -64,7 +65,7 @@ TEST(1)
"--write-std-properties=2"
};
cmd.parse (sizeof (argv) / sizeof (argv[0]), argv);
cmd.parse (sizeof (argv) / sizeof (argv[0]), const_cast<char **> (argv));
db::Layout layout;

View File

@ -38,7 +38,7 @@ namespace db
* T is supposed a transformation type such as "db::DCplxTrans".
*/
template <class T>
struct DB_PUBLIC TransformationConverter
struct DB_PUBLIC_TEMPLATE TransformationConverter
{
std::string to_string (const T &t) const
{
@ -77,7 +77,7 @@ struct DB_PUBLIC LayoutLayerConverter
* P is supposed to be a point type (i.e. db::DPoint).
*/
template <class P>
struct DB_PUBLIC PointConverter
struct DB_PUBLIC_TEMPLATE PointConverter
{
std::string to_string (const P &p) const
{

View File

@ -20,22 +20,11 @@
*/
#ifndef HDR_dbHash
#define HDR_dbHash
#if defined(__GNUC__)
# include <ext/hash_map>
# include <ext/hash_set>
namespace std_ext = __gnu_cxx;
# define DB_HASH_NAMESPACE __gnu_cxx
#else
# define _SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS
# include <hash_map>
# include <hash_set>
namespace std_ext = std;
# define DB_HASH_NAMESPACE std
#endif
#include <unordered_map>
#include <unordered_set>
#include "dbPoint.h"
#include "dbVector.h"
@ -59,9 +48,9 @@ namespace std_ext = std;
* It also provides namespace abstraction for the std_ext namespace
*/
namespace DB_HASH_NAMESPACE
namespace std
{
#if defined(_WIN64)
#if defined(_WIN64) && !defined(_MSC_VER)
/**
* @brief Specialization missing for size_t on WIN64
*/
@ -75,7 +64,7 @@ namespace DB_HASH_NAMESPACE
};
#endif
#if defined(_WIN64) || defined(__APPLE__)
#if (defined(_WIN64) && !defined(_MSC_VER)) || defined(__APPLE__)
/**
* @brief Specialization missing for long long on WIN64
*/
@ -381,4 +370,3 @@ namespace DB_HASH_NAMESPACE
}
#endif

View File

@ -63,7 +63,7 @@ private:
};
template <class C>
class DB_PUBLIC hershey_edge_iterator
class DB_PUBLIC_TEMPLATE hershey_edge_iterator
: private basic_hershey_edge_iterator
{
public:
@ -124,7 +124,7 @@ private:
*/
template <class C>
struct DB_PUBLIC hershey
struct DB_PUBLIC_TEMPLATE hershey
{
typedef C coord_type;
typedef db::coord_traits<C> coord_traits;

View File

@ -267,6 +267,12 @@ RecursiveShapeIterator::RecursiveShapeIterator (const layout_type &layout, const
init_region (box_type::world ());
}
RecursiveShapeIterator::~RecursiveShapeIterator ()
{
// .. nothing yet ..
}
void
RecursiveShapeIterator::init ()
{

View File

@ -238,6 +238,11 @@ public:
*/
RecursiveShapeIterator (const layout_type &layout, const cell_type &cell, const std::set<unsigned int> &layers);
/**
* @brief Destructor
*/
~RecursiveShapeIterator ();
/**
* @brief Specify the maximum hierarchy depth to look into
*

View File

@ -98,7 +98,7 @@ struct box_defs
static size_t hash_value (const C *box)
{
return std_ext::hfunc (*box);
return std::hfunc (*box);
}
static gsi::Methods methods ()

View File

@ -345,7 +345,7 @@ struct cell_inst_array_defs
static size_t hash_value (const C *i)
{
return std_ext::hfunc (*i);
return std::hfunc (*i);
}
static bool less (const C *i, const C &other)

View File

@ -134,7 +134,7 @@ struct edge_defs
static size_t hash_value (const C *e)
{
return std_ext::hfunc (*e);
return std::hfunc (*e);
}
static gsi::Methods methods ()

View File

@ -61,7 +61,7 @@ struct edge_pair_defs
static size_t hash_value (const C *ep)
{
return std_ext::hfunc (*ep);
return std::hfunc (*ep);
}
static gsi::Methods methods ()

View File

@ -115,7 +115,7 @@ db::LayerProperties li_from_string (const char *s)
static
size_t hash_value (const db::LayerProperties *l)
{
return std_ext::hfunc (*l);
return std::hfunc (*l);
}
// since there already exists a "LayerProperties" object, we call this one "LayerInfo"

View File

@ -110,7 +110,7 @@ struct path_defs
static size_t hash_value (const C *e)
{
return std_ext::hfunc (*e);
return std::hfunc (*e);
}
static gsi::Methods methods ()

View File

@ -77,7 +77,7 @@ struct point_defs
static size_t hash_value (const C *pt)
{
return std_ext::hfunc (*pt);
return std::hfunc (*pt);
}
static gsi::Methods methods ()

View File

@ -207,7 +207,7 @@ struct simple_polygon_defs
static size_t hash_value (const C *p)
{
return std_ext::hfunc (*p);
return std::hfunc (*p);
}
static bool touches_box (const C *p, const db::box<coord_type> &box)
@ -1055,7 +1055,7 @@ struct polygon_defs
static size_t hash_value (const C *p)
{
return std_ext::hfunc (*p);
return std::hfunc (*p);
}
static bool touches_box (const C *p, const db::box<coord_type> &box)

View File

@ -145,7 +145,7 @@ struct text_defs
static size_t hash_value (const C *box)
{
return std_ext::hfunc (*box);
return std::hfunc (*box);
}
static gsi::Methods methods ()

View File

@ -138,7 +138,7 @@ struct trans_defs
static size_t hash_value (const C *t)
{
return std_ext::hfunc (*t);
return std::hfunc (*t);
}
static gsi::Methods methods ()
@ -636,7 +636,7 @@ struct cplx_trans_defs
static size_t hash_value (const C *t)
{
return std_ext::hfunc (*t);
return std::hfunc (*t);
}
static gsi::Methods methods ()

View File

@ -97,7 +97,7 @@ struct vector_defs
static size_t hash_value (const C *v)
{
return std_ext::hfunc (*v);
return std::hfunc (*v);
}
static db::point<coord_type> add_with_point (const C *v, const db::point<coord_type> &p)

View File

@ -297,7 +297,9 @@ ApplicationBase::parse_cmd (int &argc, char **argv)
int v = 0;
tl::from_string (args [++i], v);
v = std::max (0, v);
if (v < 0) {
v = 0;
}
tl::verbosity (v);
} else if (a == "-l" && (i + 1) < argc) {
@ -374,13 +376,13 @@ ApplicationBase::parse_cmd (int &argc, char **argv)
int r = 0;
tl::from_string (args [++i], r);
m_gtf_replay_rate = std::max (0, r);
m_gtf_replay_rate = r > 0 ? r : 0;
} else if (a == "-gb" && (i + 1) < argc) {
int s = 0;
tl::from_string (args [++i], s);
m_gtf_replay_stop = std::max (0, s);
m_gtf_replay_stop = s > 0 ? s : 0;
} else if (a == "-c" && (i + 1) < argc) {

View File

@ -36,10 +36,3 @@ HelpProvider::HelpProvider ()
}
}
namespace tl
{
// registration point for help providers
template<>
tl::Registrar<lay::HelpProvider> *Registrar<lay::HelpProvider>::instance = 0;
}

View File

@ -216,7 +216,7 @@ Salt::validate ()
for (std::map<std::string, SaltGrain *>::const_iterator g = m_grains_by_name.begin (); g != m_grains_by_name.end (); ++g) {
int index = topological_index [g->first];
for (std::vector<SaltGrain::Dependency>::const_iterator d = g->second->dependencies ().begin (); d != g->second->dependencies ().end (); ++d) {
for (std::vector<SaltGrainDependency>::const_iterator d = g->second->dependencies ().begin (); d != g->second->dependencies ().end (); ++d) {
std::map<std::string, int>::iterator ti = topological_index.find (d->name);
if (ti != topological_index.end () && ti->second < index + 1) {
ti->second = index + 1;

View File

@ -206,7 +206,7 @@ SaltDownloadManager::compute_list (const lay::Salt &salt, const lay::Salt &salt_
Descriptor p = m_registry [i];
for (std::vector<SaltGrain::Dependency>::const_iterator d = p.grain.dependencies ().begin (); d != p.grain.dependencies ().end (); ++d) {
for (std::vector<SaltGrainDependency>::const_iterator d = p.grain.dependencies ().begin (); d != p.grain.dependencies ().end (); ++d) {
std::map<std::string, size_t>::iterator r = reg_by_name.find (d->name);
if (r != reg_by_name.end ()) {

View File

@ -397,9 +397,9 @@ SaltGrain::xml_elements ()
tl::make_member (&SaltGrain::icon, &SaltGrain::set_icon, "icon", ImageConverter ()) +
tl::make_member (&SaltGrain::screenshot, &SaltGrain::set_screenshot, "screenshot", ImageConverter ()) +
tl::make_element (&SaltGrain::begin_dependencies, &SaltGrain::end_dependencies, &SaltGrain::add_dependency, "depends",
tl::make_member (&SaltGrain::Dependency::name, "name") +
tl::make_member (&SaltGrain::Dependency::url, "url") +
tl::make_member (&SaltGrain::Dependency::version, "version")
tl::make_member (&SaltGrainDependency::name, "name") +
tl::make_member (&SaltGrainDependency::url, "url") +
tl::make_member (&SaltGrainDependency::version, "version")
)
);
}

View File

@ -34,6 +34,26 @@
namespace lay
{
/**
* @brief A descriptor for one dependency
* A dependency can be specified either through a name (see name property)
* or a download URL. If download URL are specified, they have precedence
* over names.
* The version is the minimum required version. If empty, any version is
* allowed to resolve this dependency.
*/
struct SaltGrainDependency
{
std::string name;
std::string url;
std::string version;
bool operator== (const SaltGrainDependency &other) const
{
return name == other.name && url == other.url && version == other.version;
}
};
/**
* @brief This class represents on grain of salt
* "One grain of salt" is one package.
@ -42,31 +62,16 @@ class LAY_PUBLIC SaltGrain
: public tl::Object
{
public:
/**
* @brief A descriptor for one dependency
* A dependency can be specified either through a name (see name property)
* or a download URL. If download URL are specified, they have precedence
* over names.
* The version is the minimum required version. If empty, any version is
* allowed to resolve this dependency.
*/
struct Dependency
{
std::string name;
std::string url;
std::string version;
bool operator== (const Dependency &other) const
{
return name == other.name && url == other.url && version == other.version;
}
};
/**
* @brief Constructor
*/
SaltGrain ();
/**
* @brief Destructor
*/
virtual ~SaltGrain () { }
/**
* @brief Equality
*/
@ -347,7 +352,7 @@ public:
* Grains this grain depends on are installed automatically when the grain
* is installed.
*/
const std::vector<Dependency> &dependencies () const
const std::vector<SaltGrainDependency> &dependencies () const
{
return m_dependencies;
}
@ -355,7 +360,7 @@ public:
/**
* @brief Gets the dependencies of the grain (non-const)
*/
std::vector<Dependency> &dependencies ()
std::vector<SaltGrainDependency> &dependencies ()
{
return m_dependencies;
}
@ -363,7 +368,7 @@ public:
/**
* @brief Dependency iterator (begin)
*/
std::vector<Dependency>::const_iterator begin_dependencies () const
std::vector<SaltGrainDependency>::const_iterator begin_dependencies () const
{
return m_dependencies.begin ();
}
@ -371,7 +376,7 @@ public:
/**
* @brief Dependency iterator (end)
*/
std::vector<Dependency>::const_iterator end_dependencies () const
std::vector<SaltGrainDependency>::const_iterator end_dependencies () const
{
return m_dependencies.end ();
}
@ -379,7 +384,7 @@ public:
/**
* @brief Adds a dependency
*/
void add_dependency (const Dependency &dep)
void add_dependency (const SaltGrainDependency &dep)
{
m_dependencies.push_back (dep);
}
@ -482,7 +487,7 @@ private:
bool m_hidden;
QDateTime m_authored_time, m_installed_time;
QImage m_icon, m_screenshot;
std::vector<Dependency> m_dependencies;
std::vector<SaltGrainDependency> m_dependencies;
};
}

View File

@ -283,7 +283,7 @@ SaltGrainDetailsTextWidget::details_text ()
}
if (! g->dependencies ().empty ()) {
stream << "<p><b>" << QObject::tr ("Depends on: ") << "</b><br/>";
for (std::vector<lay::SaltGrain::Dependency>::const_iterator d = g->dependencies ().begin (); d != g->dependencies ().end (); ++d) {
for (std::vector<lay::SaltGrainDependency>::const_iterator d = g->dependencies ().begin (); d != g->dependencies ().end (); ++d) {
stream << "&nbsp;&nbsp;&nbsp;&nbsp;" << tl::to_qstring (tl::escaped_to_html (d->name)) << " ";
stream << tl::to_qstring (tl::escaped_to_html (d->version));
if (! d->url.empty ()) {

View File

@ -169,7 +169,7 @@ SaltGrainPropertiesDialog::update_controls ()
license->setText (tl::to_qstring (m_grain.license ()));
dependencies->clear ();
for (std::vector<SaltGrain::Dependency>::const_iterator d = m_grain.dependencies ().begin (); d != m_grain.dependencies ().end (); ++d) {
for (std::vector<SaltGrainDependency>::const_iterator d = m_grain.dependencies ().begin (); d != m_grain.dependencies ().end (); ++d) {
QTreeWidgetItem *item = new QTreeWidgetItem (dependencies);
item->setFlags (item->flags () | Qt::ItemIsEditable);
@ -240,7 +240,7 @@ SaltGrainPropertiesDialog::update_data ()
QString url = item->data (2, Qt::UserRole).toString ().simplified ();
if (! name.isEmpty ()) {
lay::SaltGrain::Dependency dep = lay::SaltGrain::Dependency ();
lay::SaltGrainDependency dep = lay::SaltGrainDependency ();
dep.name = tl::to_string (name);
dep.version = tl::to_string (version);
dep.url = tl::to_string (url);
@ -482,7 +482,7 @@ private:
}
}
for (std::vector<SaltGrain::Dependency>::const_iterator d = current->dependencies ().begin (); d != current->dependencies ().end (); ++d) {
for (std::vector<SaltGrainDependency>::const_iterator d = current->dependencies ().begin (); d != current->dependencies ().end (); ++d) {
check_circular_follow (grain_for_name (d->name), path);
}
@ -552,7 +552,7 @@ SaltGrainPropertiesDialog::accept ()
dependencies_alert->clear ();
DependencyGraph dep (mp_salt);
std::set <std::string> dep_seen;
for (std::vector<SaltGrain::Dependency>::const_iterator d = m_grain.dependencies ().begin (); d != m_grain.dependencies ().end (); ++d) {
for (std::vector<SaltGrainDependency>::const_iterator d = m_grain.dependencies ().begin (); d != m_grain.dependencies ().end (); ++d) {
if (! SaltGrain::valid_name (d->name)) {
dependencies_alert->error () << tr ("'%1' is not a valid package name").arg (tl::to_qstring (d->name)) << tl::endl

View File

@ -127,7 +127,7 @@ TEST (1)
EXPECT_EQ (QDateTime::fromMSecsSinceEpoch (0).msecsTo (g.installed_time ()), 2000000000);
#endif
g.add_dependency (lay::SaltGrain::Dependency ());
g.add_dependency (lay::SaltGrainDependency ());
g.dependencies ().back ().name = "depname";
g.dependencies ().back ().url = "depurl";
g.dependencies ().back ().version = "0.0";
@ -156,7 +156,7 @@ TEST (1)
EXPECT_EQ (int (gg.dependencies ().size ()), 1);
EXPECT_EQ (g == gg, true);
gg.add_dependency (lay::SaltGrain::Dependency ());
gg.add_dependency (lay::SaltGrainDependency ());
EXPECT_EQ (g == gg, false);
gg.set_path (tl::to_string (QFileInfo (tl::to_qstring (tmp)).absolutePath ()));
gg.save ();
@ -379,7 +379,7 @@ TEST (5)
lay::SaltGrain g1;
g1.set_name ("g1");
lay::SaltGrain::Dependency dep;
lay::SaltGrainDependency dep;
dep.name = "g2";
g1.dependencies ().push_back (dep);
dep.name = "g3";

View File

@ -34,8 +34,10 @@
#include <limits>
#if defined(HAVE_QTBINDINGS)
# include "gsiQtGuiExternals.h"
# include "gsiQtWidgetsExternals.h"
FORCE_LINK_GSI_QTGUI
FORCE_LINK_GSI_QTWIDGETS // for Qt5

View File

@ -343,7 +343,7 @@ Compressor<Obj>::flush (db::OASISWriter *writer)
tmp_rep_vector repetitions;
std::vector<std::pair<db::Vector, db::Repetition> > rep_vector;
for (typename std_ext::hash_map <Obj, disp_vector>::iterator n = m_normalized.begin (); n != m_normalized.end (); ++n) {
for (typename std::unordered_map <Obj, disp_vector>::iterator n = m_normalized.begin (); n != m_normalized.end (); ++n) {
rep_vector.clear ();
@ -358,7 +358,7 @@ Compressor<Obj>::flush (db::OASISWriter *writer)
disp_vector::iterator d;
tmp_rep_vector::iterator rw;
std_ext::hash_set<db::Coord> xcoords, ycoords;
std::unordered_set<db::Coord> xcoords, ycoords;
if (m_level > 1) {
for (d = n->second.begin (); d != n->second.end (); ++d) {
xcoords.insert (d->x ());

View File

@ -90,7 +90,7 @@ public:
private:
typedef std::vector<db::Vector> disp_vector;
std_ext::hash_map <Obj, disp_vector> m_normalized;
std::unordered_map <Obj, disp_vector> m_normalized;
unsigned int m_level;
};

View File

@ -27,7 +27,7 @@
namespace db
{
extern const std::string net_tracer_component_name;
extern std::string net_tracer_component_name;
}
namespace gsi

View File

@ -49,7 +49,7 @@
namespace db
{
extern std::string net_tracer_component_name;
DB_PLUGIN_PUBLIC std::string net_tracer_component_name;
}
namespace lay

View File

@ -32,7 +32,7 @@
namespace db
{
extern std::string net_tracer_component_name;
DB_PLUGIN_PUBLIC std::string net_tracer_component_name;
}
namespace lay

View File

@ -20,7 +20,6 @@
*/
#include <Python.h>
#include <frameobject.h> // Python - for traceback

View File

@ -15,9 +15,9 @@ SOURCES = \
pyaObject.cc \
pyaRefs.cc \
pyaUtils.cc \
pyaModule.cc \
pyaSignalHandler.cc \
pyaStatusChangedListener.cc
pyaModule.cc \
pyaSignalHandler.cc \
pyaStatusChangedListener.cc
HEADERS += \
pya.h \
@ -29,16 +29,22 @@ HEADERS += \
pyaObject.h \
pyaRefs.h \
pyaUtils.h \
pyaModule.h \
pyaSignalHandler.h \
pyaStatusChangedListener.h
pyaModule.h \
pyaSignalHandler.h \
pyaStatusChangedListener.h
INCLUDEPATH += $$PYTHONINCLUDE $$TL_INC $$GSI_INC
DEPENDPATH += $$PYTHONINCLUDE $$TL_INC $$GSI_INC
LIBS += $$PYTHONLIBFILE -L$$DESTDIR -lklayout_tl -lklayout_gsi
INCLUDEPATH += "$$PYTHONINCLUDE" $$TL_INC $$GSI_INC
DEPENDPATH += "$$PYTHONINCLUDE" $$TL_INC $$GSI_INC
LIBS += "$$PYTHONLIBFILE" -L$$DESTDIR -lklayout_tl -lklayout_gsi
# Python is somewhat sloppy and relies on the compiler initializing fields
# of strucs to 0:
QMAKE_CXXFLAGS_WARN_ON += \
-Wno-missing-field-initializers
!msvc {
# Python is somewhat sloppy and relies on the compiler initializing fields
# of strucs to 0:
QMAKE_CXXFLAGS_WARN_ON += \
-Wno-missing-field-initializers
}
msvc {
# pyconfig.h tries to tell us which library to link, but we know better ..
QMAKE_LINK_FLAGS += /NODEFAULTLIB:python*
}

View File

@ -47,7 +47,7 @@ namespace gsi
class ClassBase;
class ArgType;
const ClassBase *class_by_typeinfo_no_assert (const std::type_info &ti);
GSI_PUBLIC const ClassBase *class_by_typeinfo_no_assert (const std::type_info &ti);
}
namespace pya

View File

@ -28,6 +28,7 @@
#include "pyaRefs.h"
#include "pyaCommon.h"
#include "pyaSignalHandler.h"
#include "tlAssert.h"
@ -45,7 +46,6 @@ namespace pya
{
class PYAObjectBase;
class SignalHandler;
class Callee;
class StatusChangedListener;

View File

@ -56,9 +56,9 @@ equals(HAVE_QT, "0") {
# - GSI (generic scripting interface)
# - TL (basic toolkit)
# - PYA (Python binding for GSI)
INCLUDEPATH += $$PYTHONINCLUDE $$INC/tl/tl $$INC/pya/pya
DEPENDPATH += $$PYTHONINCLUDE $$INC/tl/tl $$INC/pya/pya
LIBS += $$PYTHONLIBFILE -L$$LIBDIR -lklayout_tl -lklayout_pya -lklayout_gsi
INCLUDEPATH += "$$PYTHONINCLUDE" $$INC/tl/tl $$INC/pya/pya $$INC/gsi/gsi
DEPENDPATH += "$$PYTHONINCLUDE" $$INC/tl/tl $$INC/pya/pya $$INC/gsi/gsi
LIBS += "$$PYTHONLIBFILE" -L$$LIBDIR -lklayout_tl -lklayout_pya -lklayout_gsi
# Also include DB as this is our sample
INCLUDEPATH += $$INC/db/db
@ -70,29 +70,32 @@ LIBS += -L$$LIBDIR -lklayout_db
QMAKE_RPATHDIR += $$RPATH
}
# Some standard compiler warnings on
QMAKE_CXXFLAGS_WARN_ON += \
-pedantic \
-Woverloaded-virtual \
-Wsign-promo \
-Wsynth \
-Wno-deprecated \
-Wno-long-long \
-Wno-strict-aliasing \
-Wno-deprecated-declarations \
-Wno-reserved-user-defined-literal \
!msvc {
# Python is somewhat sloppy and relies on the compiler initializing fields
# of strucs to 0:
QMAKE_CXXFLAGS_WARN_ON += \
-Wno-missing-field-initializers
# Some standard compiler warnings on
QMAKE_CXXFLAGS_WARN_ON += \
-pedantic \
-Woverloaded-virtual \
-Wsign-promo \
-Wsynth \
-Wno-deprecated \
-Wno-long-long \
-Wno-strict-aliasing \
-Wno-deprecated-declarations \
-Wno-reserved-user-defined-literal \
# Python is somewhat sloppy and relies on the compiler initializing fields
# of strucs to 0:
QMAKE_CXXFLAGS_WARN_ON += \
-Wno-missing-field-initializers
}
win32 {
# to avoid the major version being appended to the dll name - in this case -lxyz won't link it again
# because the library is called xyx0.dll.
CONFIG += skip_target_version_ext
# make the proper library name for Python
QMAKE_POST_LINK += $(COPY) $(DESTDIR_TARGET) $$DESTDIR/$${TARGET}$${PYTHONEXTSUFFIX}
QMAKE_POST_LINK += $(COPY) $(DESTDIR_TARGET) $$shell_path($$DESTDIR/$${TARGET}$${PYTHONEXTSUFFIX})
} else {
# Make the target library without the "lib" prefix on Linux
QMAKE_POST_LINK += $(COPY) $(DESTDIR)$(TARGET) $$DESTDIR/$${TARGET}$${PYTHONEXTSUFFIX}

View File

@ -7,20 +7,26 @@ TEMPLATE = lib
include($$PWD/../klayout.pri)
INCLUDEPATH += $$PYTHONINCLUDE $$TL_INC $$GSI_INC $$PYA_INC
DEPENDPATH += $$PYTHONINCLUDE $$TL_INC $$GSI_INC $$PYA_INC
LIBS += $$PYTHONLIBFILE -L$$LIBDIR -lklayout_tl -lklayout_gsi -lklayout_pya
INCLUDEPATH += "$$PYTHONINCLUDE" $$TL_INC $$GSI_INC $$PYA_INC
DEPENDPATH += "$$PYTHONINCLUDE" $$TL_INC $$GSI_INC $$PYA_INC
LIBS += "$$PYTHONLIBFILE" -L$$LIBDIR -lklayout_tl -lklayout_gsi -lklayout_pya
# Python is somewhat sloppy and relies on the compiler initializing fields
# of strucs to 0:
QMAKE_CXXFLAGS_WARN_ON += \
-Wno-missing-field-initializers
!msvc {
# Python is somewhat sloppy and relies on the compiler initializing fields
# of strucs to 0:
QMAKE_CXXFLAGS_WARN_ON += \
-Wno-missing-field-initializers
}
# Only on Windows, DESTDIR_TARGET is usable. On this platform, a blank happens to appear between
# $(DESTDIR) and $(TARGET)
win32 {
QMAKE_POST_LINK += $(MKDIR) $$DESTDIR_PYMOD && $(COPY) $(DESTDIR_TARGET) $$DESTDIR_PYMOD/$${TARGET}$${PYTHONEXTSUFFIX}
msvc {
QMAKE_POST_LINK += (if not exist $$shell_path($$DESTDIR_PYMOD) mkdir $$shell_path($$DESTDIR_PYMOD)) && $(COPY) $(DESTDIR_TARGET) $$shell_path($$DESTDIR_PYMOD/$${TARGET}$${PYTHONEXTSUFFIX})
} else {
QMAKE_POST_LINK += $(MKDIR) $$shell_path($$DESTDIR_PYMOD) && $(COPY) $(DESTDIR_TARGET) $$shell_path($$DESTDIR_PYMOD/$${TARGET}$${PYTHONEXTSUFFIX})
}
# to avoid the major version being appended to the dll name - in this case -lxyz won't link it again
# because the library is called xyx0.dll.

View File

@ -9,10 +9,23 @@ include($$PWD/../../lib_ut.pri)
SOURCES = \
pymod_tests.cc
DEFINES += \
PYTHON=$$PYTHON \
PYTHONPATH=$$DESTDIR_UT/pymod
msvc {
# "\\\\" is actually *one* backslash for replacement string and *two* backslashes in the
# substitution string in qmake ... so we replace \ by \\ here:
PYTHON_ESCAPED = $$replace(PYTHON, "\\\\", "\\\\")
PYTHONPATH = $$shell_path($$DESTDIR_UT/pymod)
PYTHONPATH_ESCAPED = $$replace(PYTHONPATH, "\\\\", "\\\\")
QMAKE_CXXFLAGS += \
"-DPYTHON=\"$$PYTHON_ESCAPED\"" \
"-DPYTHONPATH=\"$$PYTHONPATH_ESCAPED\""
} else {
DEFINES += \
PYTHON=$$PYTHON_ESCAPED \
PYTHONPATH=$$PYTHONPATH_ESCAPED
}
INCLUDEPATH += $$DB_INC $$TL_INC $$GSI_INC
DEPENDPATH += $$DB_INC $$TL_INC $$GSI_INC

View File

@ -23,7 +23,7 @@ HEADERS += \
rbaCommon.h
# NOTE: ../common needs to be before RUBYINCLUDE since there is a config.h too.
INCLUDEPATH += ../common $$RUBYINCLUDE $$RUBYINCLUDE2 $$TL_INC $$GSI_INC
DEPENDPATH += ../common $$RUBYINCLUDE $$RUBYINCLUDE2 $$TL_INC $$GSI_INC
LIBS += $$RUBYLIBFILE -L$$DESTDIR -lklayout_tl -lklayout_gsi
INCLUDEPATH += ../common "$$RUBYINCLUDE" "$$RUBYINCLUDE2" $$TL_INC $$GSI_INC
DEPENDPATH += ../common "$$RUBYINCLUDE" "$$RUBYINCLUDE2" $$TL_INC $$GSI_INC
LIBS += "$$RUBYLIBFILE" -L$$DESTDIR -lklayout_tl -lklayout_gsi

View File

@ -23,7 +23,9 @@
#include "utTestConsole.h"
#include "tlUnitTest.h"
#include <unistd.h>
#if !defined(_MSC_VER)
# include <unistd.h>
#endif
#if !defined(_WIN32)
# include <sys/ioctl.h>
@ -195,7 +197,11 @@ TestConsole::TestConsole (FILE *file)
{
ms_instance = this;
#if defined(_MSC_VER)
m_file_is_tty = false;
#else
m_file_is_tty = isatty (fileno (file));
#endif
#if !defined(_WIN32)
if (m_file_is_tty) {
@ -221,7 +227,8 @@ TestConsole::~TestConsole ()
int
TestConsole::columns ()
{
return std::max (m_columns - tl::indent (), 0);
int c = m_columns - tl::indent ();
return c > 0 ? c : 0;
}
void

View File

@ -2,7 +2,7 @@
INCLUDEPATH += $$RBA_INC $$PYA_INC $$TL_INC $$GSI_INC $$DB_INC $$RDB_INC $$LYM_INC $$LAYBASIC_INC $$LAY_INC $$ANT_INC $$IMG_INC $$EDT_INC $$LIB_INC $$VERSION_INC
DEPENDPATH += $$RBA_INC $$PYA_INC $$TL_INC $$GSI_INC $$DB_INC $$RDB_INC $$LYM_INC $$LAYBASIC_INC $$LAY_INC $$ANT_INC $$IMG_INC $$EDT_INC $$LIB_INC $$VERSION_INC
LIBS += $$PYTHONLIBFILE $$RUBYLIBFILE -L$$DESTDIR -lklayout_tl -lklayout_gsi -lklayout_db -lklayout_rdb -lklayout_lib
LIBS += "$$PYTHONLIBFILE" "$$RUBYLIBFILE" -L$$DESTDIR -lklayout_tl -lklayout_gsi -lklayout_db -lklayout_rdb -lklayout_lib
!equals(HAVE_QT, "0") {
@ -42,3 +42,7 @@ equals(HAVE_PYTHON, "1") {
LIBS += -lklayout_drc
}
}
msvc {
LIBS += user32.lib
}