Commit Graph

2554 Commits

Author SHA1 Message Date
Donny Lawrence a270b0f292 Merge branch 'cmake' of https://github.com/panda3d/panda3d into cmake 2018-05-29 22:55:21 -05:00
Donny Lawrence 5619c3ed90 Make sure HAVE_OPENAL_FRAMEWORK is set correctly 2018-05-29 21:58:43 -05:00
Donny Lawrence a8954d7f67 Don't build GLX support if on macOS 2018-05-29 21:49:00 -05:00
Sam Edwards 827f322d0e CMake: Update for upstream change 2018-05-27 14:07:26 -06:00
Sam Edwards d0ebc59d32 Merge branch 'master' into cmake 2018-05-27 14:07:05 -06:00
Sam Edwards a504a910b0 CMake: Rename `check` function in checkPandaVersion.h
This mirrors 239f66c on master.
2018-05-27 14:06:58 -06:00
Sam Edwards a251c6dd8f general: Change HAVE_LOCKF to PHAVE_LOCKF
HAVE_LOCKF is already defined by pyconfig.h in
(at least) Python 3.6 - changing the macro name
here avoids warnings
2018-05-27 14:06:14 -06:00
Sam Edwards 0ce9dc98b1 general: Move inclusion of checkPandaVersion.h to dtoolbase
This includes it everywhere, meaning developers no longer must
remember to include it in each metalib init file.
2018-05-26 18:39:24 -06:00
Sam Edwards 399f4a33a1 CMake: Check Git commit SHA1
This is for PandaSystem::get_git_commit()
2018-05-25 13:33:47 -06:00
Sam Edwards 2d5d1400be CMake: Remove references to WxWidgets/FLTK
The plugin once used these; it's since been deprecated,
so we don't be needing GUI toolkits anymore.
2018-05-24 18:33:15 -06:00
Sam Edwards 85b8d96919 CMake: Add reminder for when we upgrade to C++17 2018-05-24 14:47:12 -06:00
rdb 5e0ce969fe Work around clang 3.1 compile error with static constexpr
There is a bug in clang versions before 3.2 (including the one shipped with Xcode) that makes it give a "conflicting types" compile error when there is a static constexpr function defined outside the class.  The way to work around this is either to remove one of the "static" or "constexpr" keywords, or to simply put the definition inline.

See: https://stackoverflow.com/a/17494592/2135754

I would try and upgrade Xcode to version 5 to see if the problem is fixed, but the buildbot still runs OS X Lion (10.7) and the last version of Xcode that works on Lion is 4.6.3, so it seems easier to just apply these workarounds for now.
2018-05-24 14:34:03 +02:00
rdb 9fad3dba60 general: remove macros for compatibility with non-C++11 compilers
Now that we require MSVC 2015, we no longer need all this nonsense, so we can write cleaner code.
2018-05-23 23:33:05 +02:00
rdb f45ddcab2f general: switch to C++11 Lockable semantics for mutexes
This renames acquire/release to lock/unlock in order to be compatible with std::lock_guard and std::unique_lock (which will eventually replace the *MutexHolder classes).  It will also allow us to typedef MutexImpl to std::mutex later on.
2018-05-23 20:37:56 +02:00
rdb 3b4d12cb99 interrogate: also fall back to compare_to in Python 2
This is to create the same behaviour in Python 2 and 3.
2018-05-21 11:55:46 +02:00
Donny Lawrence 1b3c6fb444 Fix issue with extra flags 2018-05-19 10:30:26 -05:00
Donny Lawrence 8b51b0faeb Merge branch 'cmake' of https://github.com/panda3d/panda3d into cmake 2018-05-17 16:59:04 -05:00
Donny Lawrence beec6578c8 Fix CMake build issues on macOS. 2018-05-17 15:41:31 -05:00
Sam Edwards c62f3d0d23 CMake: Don't set a default Python version.
A blank string to FindPythonInterp finds the version
of Python that the system "python" interpreter invokes,
so this means the default is now the system default.
2018-05-16 18:14:07 -06:00
Sam Edwards d96765b957 CMake: Enhance checkPandaVersion.h
This removes the requirement that it only be included
in a single C++ file per library, by forcing the compiler
to emit the function that references the version symbol
as a weak symbol itself.  Now, the linker will not only
tolerate redundant inclusions, it will also coalesce them
together.
2018-05-16 17:38:13 -06:00
Sam Edwards b08ab6324e CMake: Move panda version logic to dtoolbase 2018-05-16 14:36:31 -06:00
Sam Edwards 9f46d3dc48 CMake: Remove unused LINK_IN_PHYSX 2018-05-15 18:35:22 -06:00
rdb 0bb81a43c9 express: make a thread safe weak pointer implementation (#321)
To access a WeakPointerTo in a thread-safe way, use something like this:

    if (auto ptr = weak_ptr.lock()) {
      ..use ptr as regular PointerTo
    }

The new implementation no longer needs a reference to be stored to all weak pointers on the WeakReferenceList; a mere count of weak pointers is sufficient.  Therefore, callbacks theoretically no longer require a WeakPointerTo to be constructed.

The WeakPointerTo class is not actually atomic; it could be made so, but I don't believe it's worth it at this time.
2018-05-15 13:40:21 +02:00
Sam Edwards 6efb07de93 Merge branch 'master' into cmake 2018-05-14 19:09:14 -06:00
Sam Edwards aeeabdbd3b CMake: Move interrogatedb interrogation to p3interrogatedb 2018-05-14 19:07:27 -06:00
Sam Edwards 8e230495a1 CMake: Consolidate "module or static" library logic 2018-05-14 19:07:27 -06:00
Sam Edwards d2d5e3014c CMake: Generate, don't use, pydtool.cxx 2018-05-14 19:07:27 -06:00
rdb 6175e79c57 cppparser: fix infinite recursion stack overflow with enum classes 2018-05-06 22:21:24 +02:00
rdb 666591ff48 cppparser: fix compile warnings on MSVC 2018-05-06 22:19:33 +02:00
rdb 8a98bf42a3 general: enable use of tie and tuple on macOS (from TR1, for now) 2018-05-05 23:09:39 +02:00
Sam Edwards 95785407a3 CMake: General whitespace fixes
- Remove trailing whitespace from ends of lines
- Convert tabs to (two) spaces
2018-04-20 02:30:04 -06:00
Sam Edwards 56a6e6a80a Merge remote-tracking branch 'origin/master' into cmake 2018-04-20 01:57:46 -06:00
Sam Edwards 570afa6973 CMake: Fix include path when building prc into metalib 2018-04-19 20:06:09 -06:00
Sam Edwards 218d0e8ade CMake: Build dtool metalibs as metalibs 2018-04-19 00:07:08 -06:00
Sam Edwards 4cec331722 CMake: Add support for building metalibs as metalibs 2018-04-18 14:42:56 -06:00
Sam Edwards 655e661035 CMake: Minor typo fix 2018-04-18 14:38:59 -06:00
rdb d13464104c Fix compilation issue with --nothing on MSVC
I have no idea why this error happens, but it does not seem worth the effort to investigate further, so I'm just reverting the previous change to this file.
2018-04-06 20:50:31 +02:00
Sam Edwards cfd603bb8d CMake: Build Python binary modules as MODULE, never SHARED 2018-04-05 16:11:59 -06:00
rdb 7125a3e587 interrogate: allow passing None for args that have NULL as default value 2018-04-05 20:49:13 +02:00
rdb 552a649ef3 interrogate: add back NULL definition, fixes some keyword arguments
I am not sure why the definition of NULL was removed; it might have been by mistake, but in any case it broke code like this:

    img = PNMImage(w, h, color_space=CS_srgb)

since it would not understand the default value (NULL) for the argument preceding color_space.
2018-04-04 21:50:02 +02:00
Sam Edwards aed544bf5f CMake: Have CMake itself track versions 2018-04-02 15:47:53 -06:00
rdb e9ae7dcc40 Use vector_uchar instead of string for binary network/file data
This distinction allows us to better support Python 3, since it will raise exceptions when trying to put arbitrary binary data in a str object.

This also adds some convenience functions for efficiently initializing a Datagram or PTA_uchar from a vector_uchar.
2018-04-02 23:17:14 +02:00
Sam Edwards 449195a33d CMake: Define appropriate BUILDING_ symbols 2018-03-31 04:24:06 -06:00
Sam Edwards dd42371610 CMake: Update for upstream changes 2018-03-31 04:24:03 -06:00
Sam Edwards 25b13ad199 Merge branch 'master' into cmake 2018-03-31 04:23:49 -06:00
rdb 84915073e1 Fix compilation warning on MSVC 2015 2018-03-30 20:15:13 +02:00
Sam Edwards 9dd37e9dbc general: Add guards to ensure proper BUILDING_ macros defined
This is designed to sanity-check the buildsystem, ensuring that the
expected BUILDING_ macros are defined at the expected time. It
also helps catch cases where the wrong BUILDING_/EXPCL_ macros
are used.
2018-03-25 13:17:52 -06:00
Sam Edwards bd2a9d709a dtoolbase: Introduce BUILDING_ defines for each component
This mirrors the prior commit.
2018-03-25 13:17:52 -06:00
Sam Edwards 9739923593 dconfig: Change export macros to EXP*_DTOOL_DCONFIG
This is for consistency with `panda`, which follows this format.
2018-03-25 13:17:52 -06:00
Sam Edwards 775fcb5b0b prc: Change export macros to EXP*_DTOOL_PRC
This is for consistency with `panda`, which follows this format.
2018-03-25 13:17:52 -06:00