H-uru / Plasma

Cyan Worlds's Plasma game engine
http://h-uru.github.io/Plasma/
GNU General Public License v3.0
202 stars 80 forks source link

macOS Release Build Failure #1524

Closed Hoikas closed 8 months ago

Hoikas commented 8 months ago

Happens when building #1326 in either Release or RelWithDebInfo using Xcode generator:

In file included from /Users/adamj/Code/Plasma/build/Sources/Plasma/PubUtilLib/plPhysX/CMakeFiles/plPhysX.dir/Release/cmake_pch.hxx:4:
In file included from /Users/adamj/Code/Plasma/Sources/Plasma/PubUtilLib/plPhysX/Pch.h:48:
In file included from /Users/adamj/Code/Plasma/Sources/Plasma/PubUtilLib/plPhysX/plPhysXAPI.h:55:
In file included from /Users/adamj/Code/Plasma/build/vcpkg_installed/x64-macos-plasma/include/PxPhysicsAPI.h:45:
In file included from /Users/adamj/Code/Plasma/build/vcpkg_installed/x64-macos-plasma/include/foundation/Px.h:37:
In file included from /Users/adamj/Code/Plasma/build/vcpkg_installed/x64-macos-plasma/include/foundation/PxSimpleTypes.h:40:
/Users/adamj/Code/Plasma/build/vcpkg_installed/x64-macos-plasma/include/foundation/PxPreprocessor.h:454:2: error: Exactly one of NDEBUG and _DEBUG needs to be defined!
#error Exactly one of NDEBUG and _DEBUG needs to be defined!
dgelessus commented 8 months ago

1292 is probably relevant here somehow.

dpogue commented 8 months ago

I've seen this a few times, and it was always due to missing -DCMAKE_BUILD_TYPE on the initial command-line

Hoikas commented 8 months ago

AFAIK, Xcode is a multi-config generator, so that ought not to be required.

dgelessus commented 8 months ago

Also, CMAKE_BUILD_TYPE should default to Debug as far as I know. So if not passing -DCMAKE_BUILD_TYPE=... causes problems, that should be fixed too.

FindPhysX.cmake adds the _DEBUG macro definition conditionally using a generator expression. As I understand it, that's the intended way to make conditionals work correctly for multi-config generators, so I'm confused why this doesn't work here...

Hoikas commented 8 months ago

NDEBUG is not being defined by Xcode, I expect. I'm amending the find script to fix this.