/*********************************************************** Copyright 1991-1995 by Stichting Mathematisch Centrum, Amsterdam, The Netherlands. All Rights Reserved Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation, and that the names of Stichting Mathematisch Centrum or CWI not be used in advertising or publicity pertaining to distribution of the software without specific, written prior permission. STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ******************************************************************/ /* Use this file as a template to start implementing a new object type. If your objects will be called foobar, start by copying this file to foobarobject.c, changing all occurrences of xx to foobar and all occurrences of Xx by Foobar. You will probably want to delete all references to 'x_attr' and add your own types of attributes instead. Maybe you want to name your local variables other than 'xp'. If your object type is needed in other files, you'll have to create a file "foobarobject.h"; see intobject.h for an example. */ /* Xx objects */ #include "Python.h" typedef struct { PyObject_HEAD PyObject *x_attr; /* Attributes dictionary */ } xxobject; staticforward PyTypeObject Xxtype; #define is_xxobject(v) ((v)->ob_type == &Xxtype) static xxobject * newxxobject(arg) PyObject *arg; { xxobject *xp; xp = PyObject_NEW(xxobject, &Xxtype); if (xp == NULL) return NULL; xp->x_attr = NULL; return xp; } /* Xx methods */ static void xx_dealloc(xp) xxobject *xp; { Py_XDECREF(xp->x_attr); PyMem_DEL(xp); } static PyObject * xx_demo(self, args) xxobject *self; PyObject *args; { if (!PyArg_NoArgs(args)) return NULL; Py_INCREF(Py_None); return Py_None; } static Py_MethodDef xx_methods[] = { {"demo", (PyCFunction)xx_demo}, {NULL, NULL} /* sentinel */ }; static PyObject * xx_getattr(xp, name) xxobject *xp; char *name; { if (xp->x_attr != NULL) { PyObject *v = PyDict_GetItemString(xp->x_attr, name); if (v != NULL) { Py_INCREF(v); return v; } } return Py_FindMethod(xx_methods, (PyObject *)xp, name); } static int xx_setattr(xp, name, v) xxobject *xp; char *name; PyObject *v; { if (xp->x_attr == NULL) { xp->x_attr = PyDict_New(); if (xp->x_attr == NULL) return -1; } if (v == NULL) { int rv = PyDict_DelItemString(xp->x_attr, name); if (rv < 0) PyErr_SetString(PyExc_AttributeError, "delete non-existing xx attribute"); return rv; } else return PyDict_SetItemString(xp->x_attr, name, v); } static PyTypeObject Xxtype = { PyObject_HEAD_INIT(&PyType_Type) 0, /*ob_size*/ "xx", /*tp_name*/ sizeof(xxobject), /*tp_basicsize*/ 0, /*tp_itemsize*/ /* methods */ (destructor)xx_dealloc, /*tp_dealloc*/ 0, /*tp_print*/ (getattrfunc)xx_getattr, /*tp_getattr*/ (setattrfunc)xx_setattr, /*tp_setattr*/ 0, /*tp_compare*/ 0, /*tp_repr*/ 0, /*tp_as_number*/ 0, /*tp_as_sequence*/ 0, /*tp_as_mapping*/ 0, /*tp_hash*/ }; OR`, `CMAKE_PROJECT_VERSION_PATCH` and `CMAKE_PROJECT_VERSION_TWEAK`. * `CPack` module use `CMAKE_PROJECT_VERSION_MAJOR`, `CMAKE_PROJECT_VERSION_MINOR` and `CMAKE_PROJECT_VERSION_PATCH` to initialize corresponsing CPack variables. * CMake Nightly Date StampKitware Robot2018-04-291-1/+1 | * CMake Nightly Date StampKitware Robot2018-04-281-1/+1 | * Merge topic 'vs-refactor-xml'Brad King2018-04-272-56/+49 |\ | | | | | | | | | | | | 4465a27882 cmVisualStudio10TargetGenerator: XML refactoring Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2012 | * cmVisualStudio10TargetGenerator: XML refactoringVitaly Stakhovsky2018-04-262-56/+49 | | * | Merge topic 'vs-managed-fastlink'Brad King2018-04-271-0/+9 |\ \ | | | | | | | | | | | | | | | | | | 27b28c001f VS: Don't turn on /DEBUG:FASTLINK for managed C++ targets Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2011 | * | VS: Don't turn on /DEBUG:FASTLINK for managed C++ targetsCalum Robinson2018-04-261-0/+9 | | | | | | | | | | | | | | | FastLink is only supported for native C++ targets. Turning it off avoids a warning when building managed C++. * | | CMake Nightly Date StampKitware Robot2018-04-271-1/+1 | |/ |/| * | Merge topic 'csharp_reference_imported_targets'Brad King2018-04-2625-82/+475 |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | de549083e3 cmVisualStudio10TargetGenerator: warn if /clr flag is set manually 59ec7d50bd cmVisualStudio10TargetGenerator: fix for backward compatibility 663f5120f4 cmGlobalVisualStudioGenerator: remove TargetCanBeReferenced() 359544a907 add tests for using target_link_libraries() with imported managed targets 43571073e0 cmVisualStudio10TargetGenerator: store managed reference information in maps 16fec7e2fc cmVisualStudio10TargetGenerator: make some methods config aware f3c6828876 cmVisualStudio10TargetGenerator: /clr compatible flags for managed tgt f9042d807d remove TargetIsCSharpOnly() and use methods from cmGeneratorTarget ... Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !1805 | * | cmVisualStudio10TargetGenerator: warn if /clr flag is set manuallyMichael Stürmer2018-04-241-2/+14 | | | | * | cmVisualStudio10TargetGenerator: fix for backward compatibilityMichael Stürmer2018-04-241-5/+18 | | | | * | cmGlobalVisualStudioGenerator: remove TargetCanBeReferenced()Michael Stürmer2018-04-243-17/+4 | | | | * | add tests for using target_link_libraries() with imported managed targetsMichael Stürmer2018-04-2418-0/+332 | | | | * | cmVisualStudio10TargetGenerator: store managed reference information in mapsMichael Stürmer2018-04-242-7/+60 | | | | * | cmVisualStudio10TargetGenerator: make some methods config awareMichael Stürmer2018-04-232-12/+22 | | | | * | cmVisualStudio10TargetGenerator: /clr compatible flags for managed tgtMichael Stürmer2018-04-231-1/+6 | | | | * | remove TargetIsCSharpOnly() and use methods from cmGeneratorTargetMichael Stürmer2018-04-234-40/+14 | | | | * | cmExportFileGenerator: set IMPORTED_COMMON_LANGUAGE_RUNTIME for CSharp targetMichael Stürmer2018-04-231-2/+7 | | | | * | cmGeneratorTarget: change GetManagedType() result if language is CSharpMichael Stürmer2018-04-231-3/+5 | | | * | | Merge branch 'release-3.11'Brad King2018-04-260-0/+0 |\ \ \ | * \ \ Merge branch 'backport-ninja-issue-17942' into release-3.11Brad King2018-04-262-1/+9 | |\ \ \ | | | | | | | | | | | | | | | Merge-request: !2010 * | \ \ \ Merge topic 'ninja-issue-17942'Brad King2018-04-266-4/+39 |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ee44f390ce Ninja: Make assumed source dependencies order-only 625b8f9076 Ninja: Avoid empty phony edges for target ordering ae6722483e Merge branch 'backport-ninja-issue-17942' into ninja-issue-17942 0826c20128 Ninja: Do not add empty custom command for file(GENERATE) outputs Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2010 | * | | | | Ninja: Make assumed source dependencies order-onlyBrad King2018-04-261-3/+5 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since its beginning the Ninja generator has handled `GENERATED` source files that have no custom command producing them by writing a dummy custom command for them that depends on the target ordering phony edge. Make the custom command's dependency order-only since the phony edge also has only order-only dependencies. The dummy custom command should never be considered "dirty" by `ninja`. Fixes: #17942 | * | | | | Ninja: Avoid empty phony edges for target orderingBrad King2018-04-264-0/+25 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit v3.9.0-rc1~230^2~2 (ninja: break unnecessary target dependencies, 2017-04-17) we unconditionally generate a phony edge for target ordering. It is needed in case a later target depends on it. However, if the phony edge has no inputs then `ninja -d explain` prints: ninja explain: output ... of phony edge with no inputs doesn't exist Furthermore the phony edge's output is considered dirty and can cause dependents to be incorrectly considered dirty. Avoid this by always generating at least one input to the target ordering phony edges. If we have no real dependencies just use a path that always exists. Fixes: #17942 | * | | | | Merge branch 'backport-ninja-issue-17942' into ninja-issue-17942Brad King2018-04-262-1/+9 | |\ \ \ \ \ | | | |/ / / | | |/| | | | | * | | | Ninja: Do not add empty custom command for file(GENERATE) outputsBrad King2018-04-262-1/+9 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Internally we mark `file(GENERATE)` outputs as `GENERATED` in order to tell custom command dependency tracing logic not to expect the files to exist on disk yet. This is because we do not generate the files until after that tracing is done. The Ninja generator also interprets the `GENERATED` property to mean that it is expected that some build rule will generate the file if another build rule depends on it. If the generator does not know of a custom command that generates the file then it adds an empty one so that the `ninja` build tool does not complain about a dependency on a file that does not exist and has no rule to generate it. However, this step is not necessary for `file(GENERATE)` outputs because there is no build rule to generate them and they will exist before `ninja` runs. Add an additional `__CMAKE_GENERATED_BY_CMAKE` property internally to tell the Ninja generator that a `GENERATED` file will exist before the build starts and is not expected to have a build rule producing it. Fixes: #17942 * | | | | | Merge topic 'vs-refactor-xml'Brad King2018-04-262-50/+71 |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dfff12c808 VS: Add Elem::Content() helper and usage demo 1f29777798 cmVisualStudio10TargetGenerator: refactoring (continued) Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2005 | * | | | | | VS: Add Elem::Content() helper and usage demoVitaly Stakhovsky2018-04-262-18/+21 | | | | | | | | * | | | | | cmVisualStudio10TargetGenerator: refactoring (continued)Vitaly Stakhovsky2018-04-242-32/+50 | | | | | | | * | | | | | | Merge topic 'numeric-indent'Brad King2018-04-26