Commit Graph

2639 Commits

Author SHA1 Message Date
Sam Edwards 10b5c9f3e6 CMake: Use CMake 3.12 FindPython, where available 2018-10-07 00:51:26 -06:00
Sam Edwards 0997c6b19c CMake: Don't depend on Python interpreter
This allows building against the Python libraries even when the
Python interpreter/executable is missing. The correct extensions
for the binary modules will be guessed, the tests will fail,
and the bytecode for any pure-Python modules will not be
precompiled.
2018-10-07 00:51:26 -06:00
Sam Edwards 645fe32ca3 CMake: Fix capitalization of OpenSSL components 2018-09-24 14:06:26 -06:00
Sam Edwards e917c54433 Merge branch 'master' into cmake 2018-09-22 15:55:59 -06:00
Sam Edwards cfb32fad84 CMake: Detect OpenGL (and SpeedTree) the proper way 2018-09-22 15:55:03 -06:00
Sam Edwards bd187643f3 CMake: Look for packages by CONFIG first
This requires a macro to override find_package,
as the default behavior in CMake is to fall back
from MODULE onto CONFIG.

Note that Bullet is given a specific override
not to look for a CONFIG, since Bullet tends to
use weird paths in its CONFIG script.
2018-09-21 19:22:59 -06:00
Sam Edwards 968ca123d4 CMake: Use packages by imported target where available
This is preferable because imported targets generally include
all of the relevant information specific to the particular
installation of each package, and without needing to hunt down
a bunch of variables to do it.

To do this, package_option() (which is starting to grow in scope
a little beyond just providing the package option, come to think
of it) is given a new IMPORTED_AS option, which tells the package
configuration system to look for one or more imported targets and
link against them instead.
2018-09-21 16:24:48 -06:00
Sam Edwards 1520d712d4 CMake: Remove target_use_packages
Instead, let's use a PKG::PKGNAME interface library, which simplifies
the linking and also allows us to use imported libraries from
find_package in the future.
2018-09-21 10:17:05 -06:00
Sam Edwards cf26888672 CMake: Stop using include_directories()
Setting this directly on the target is cleaner,
and in most cases, the INTERFACE_INCLUDE_DIRECTORIES
mechanism takes care of it for us.
2018-09-18 18:17:43 -06:00
rdb 8b3cc74cad interrogate: write out OS-generic filenames in #include directives
Fixes #386
2018-09-13 21:14:04 +02:00
rdb cb9e65720a interrogate: do not use MOVE in generated code, but use std::move 2018-09-09 13:48:50 +02:00
Sam Edwards e501d20927 CMake: Don't compile Interrogate runtime code into interrogatedb
This should obviate the need for pystub as well.

Note that it's currently a little bit hacky; the source will
have to be moved to make the CMake dependencies work better.
2018-09-06 23:57:53 -06:00
Sam Edwards 0c889db928 CMake: Don't conflict with find_package internal variables 2018-09-05 19:19:36 -06:00
rdb 809f9b04f6 Fix problems with spinlock mutex/cvar implementation
This reimplements the spinlock on top of std::atomic_flag, which is guaranteed to be lockless.  It also inserts the PAUSE (REP NOP) instruction which is strongly recommended to be placed in busy-wait loops by Intel.

This also includes a recursive spinlock implementation.

The spinlock implementation is disabled by default, but can be enabled by adding the --override MUTEX_SPINLOCK=1 flag to makepanda.
2018-09-04 12:58:48 +02:00
rdb 670047b4b0 dtoolbase: enable use of std::atomic_flag, also on macOS 2018-09-04 12:02:13 +02:00
Sam Edwards 77018c5383 CMake: Name Python targets more distinctively
Python targets are now prefixed with "panda3d." in
e.g. "panda3d.core"
2018-09-03 21:01:54 -06:00
Sam Edwards 23f46d8a84 CMake: Build p3bullet 2018-09-02 16:14:01 -06:00
Sam Edwards 208ecd6708 Merge branch 'master' into cmake 2018-09-02 16:06:41 -06:00
Sam Edwards fa1e1a2e63 CMake: Tidy up installation directory
Don't install "object-Configuration/" directories when
using metalibs, and also put .dll files in bin/ on Windows.
2018-09-01 11:07:55 -06:00
Sam Edwards 4695557a5d general: Don't require BUILDING_* for static builds 2018-08-31 23:54:32 -06:00
rdb b1fc88027a dtoolbase: add missing DTOOL_PLATFORM for linux_aarch64 2018-08-26 14:04:48 +02:00
rdb c9372c3699 Fix a few GCC compile warnings 2018-08-26 14:02:33 +02:00
Sam Edwards ab2ad99278 CMake: Don't use GREATER_EQUAL
It's not compatible with CMake 3.0.
2018-08-23 00:42:54 -06:00
Sam Edwards 76378c8990 CMake: Ask Python for preferred binary extension suffix 2018-08-19 23:10:20 -06:00
Sam Edwards 9c3841177b CMake: Move dtool_config.h to a configuration-specific dir 2018-08-19 15:39:42 -06:00
Mitchell Stokes f663d215d5 Remove some unused variables 2018-08-19 16:55:07 +02:00
rdb c4b657b5b2 interrogate: support implicit typecast operators in some cases
For example, this will let us pass a ConfigVariableFilename to anything that accepts a Filename, just like in C++.

Does not work if the return value if the typecast operator requires management.
2018-08-19 16:06:16 +02:00
rdb 21f5e77467 dtoolbase: prefer GCC AtomicAdjust implementation over i386 asm one 2018-08-19 16:05:39 +02:00
rdb 5da8b63a66 cppparser: fix formatting of typecast operator 2018-08-19 16:04:56 +02:00
Sam Edwards 2ab77d9a27 Merge branch 'master' into cmake 2018-08-14 21:59:45 -06:00
Sam Edwards 0feadd9775 CMake: Use OPENSSL package correctly in p3prc 2018-08-14 21:59:32 -06:00
rdb 4ff619b75f pystub: fix some definitions that should be variables, not funcs
This is needed to compile Panda3D with -flto.
2018-08-09 14:56:40 +02:00
rdb 2a2b48134b parser-inc: fix bad socklen_t definition in ws2tcpip.h 2018-08-02 21:24:37 +02:00
rdb 30721ba33b cppparser: fix issues when parsing templated constructor definition 2018-07-31 14:05:08 +02:00
rdb 079a7495f2 Fix macOS build by providing missing std::copysign 2018-07-31 10:47:16 +02:00
rdb ad3ab3ad21 Define stable ordering for WeakPointerTo for use as map/set key
Currently, the WeakPointerTo comparison operators compare the raw pointers, but this is not useful as it may cause a false equality if one weak pointer in the comparison is expired and points to memory that has since been reused.

Instead, we can define a comparison based on the control block pointer, which exists since the new weak pointer implementation in 0bb81a43c9.  This is implemented in the owner_before method, matching C++11 std::weak_ptr semantics.

I would now recommend deprecating most comparison operators of WeakPointerTo or redefining them to make more sense, ie. comparing equal if they (once) referred to the same object and not if they simply point to the same memory address.  This has not yet been done, though code that uses the comparison operators has been fixed in this commit.

Overloads of std::owner_less have been provided for creating a map or set with Weak(Const)PointerTo keys.
2018-07-30 17:27:09 +02:00
rdb 684a58e7e9 parser-inc: add timespec 2018-07-17 22:21:44 +02:00
rdb e673937384 parser-inc: add <memory> include to unordered_map/set for allocator 2018-07-09 16:02:06 +02:00
rdb e9e18c2277 dtoolutil: fix PandaSystem TypeHandle static init issue 2018-07-04 20:29:31 +02:00
rdb 68e7f681f4 interrogate: support enum class to limited extent in Python 2
Only the basics are supported; the __members__ or iter interface is not supported at this time.

See also #351 for discussion on pulling in enum34 module.
2018-07-02 12:16:35 +02:00
rdb 9441c28f61 interrogate: do not wrap methods with rvalue arguments
This could in theory be supported, but this is not really intuitive from a Python user's point of view.
2018-06-30 21:38:45 +02:00
rdb e191ee84f4 cppparser: class is not implicitly copyable if it has a move ctor 2018-06-30 21:38:45 +02:00
rdb b2c04a8c7a interrogate: support scoped enum args and return values 2018-06-30 21:38:40 +02:00
rdb c03a75d755 interrogate: use range for in various places for code cleanliness 2018-06-30 17:18:14 +02:00
rdb 0367c73026 py_panda: fix leak of reference counted class with inaccessible dtor
If a class inherits from ReferenceCount, it can be destructed by downcasting to ReferenceCount, so it should not be an obstacle to properly clean it up when such a class is returned from C++.

This issue comes up when a CycleData is returned via MemoryUsagePointers, which is not exposed so is wrapped as NodeReferenceCount instead, which has a protected destructor.
2018-06-22 20:49:19 +02:00
rdb 886e1c2f16 general: fix many compilation warnings in GCC 8 2018-06-19 00:37:28 +02:00
Sam Edwards b2bfb31114 general: Remove `using std::*` from headers
Also remove most `using namespace std;` statements. The only one that remains is in py_panda.h.

Closes #350
Closes #335
2018-06-14 16:04:49 +02:00
Sam Edwards 29bc62bf9b CMake: Alias Interrogate
This allows us to have a different name for Interrogate
on the host vs. Interrogate on the target platform, which
facilitates cross-compiling.
2018-06-13 21:07:56 -06:00
Sam Edwards 21a30a8429 CMake: Make INTERROGATE_PYTHON_INTERFACE option dependent
This also makes it sufficient for turning on Interrogate.
2018-06-13 21:07:56 -06:00
Sam Edwards d6d6df83ef CMake: Move Python detection to Package.cmake 2018-06-13 21:07:56 -06:00