MADEAPPS / newton-dynamics

Newton Dynamics is an integrated solution for real time simulation of physics environments.
http://www.newtondynamics.com
Other
938 stars 182 forks source link

Seemingly useless tlhelp32.h header inclusion on Windows #212

Closed JayFoxRox closed 2 years ago

JayFoxRox commented 4 years ago

Somehow, for Windows, except Durango (which I assume to be Xbox One), Newton appears to depend on tlhelp32.h:

https://github.com/MADEAPPS/newton-dynamics/blob/fd2c31db491cda38612649809c5f4341f7f7393a/sdk/dgCore/dgTypes.h#L74-L76

In practice, this does not seem to be used.

I'm currently building Newton for original Xbox, and our custom toolchain (nxdk) does not have tlhelp32.h; I simply define _DURANGO for the target to hack around it. However, this is the only place in the codebase where this macro is actually checked.

An empty tlhelp32.h would also work for my compile settings (even without -D_DURANGO):

set(NEWTON_BUILD_SANDBOX_DEMOS "OFF")
set(NEWTON_BUILD_CORE_ONLY "ON")
set(NEWTON_BUILD_SHARED_LIBS "OFF")
set(NEWTON_WITH_AVX_PLUGIN "OFF")
set(NEWTON_WITH_AVX2_PLUGIN OFF)
set(NEWTON_WITH_REFERENCE_GPU_PLUGIN "OFF")
add_subdirectory(newton-dynamics)
include_directories(newton-dynamics/sdk/dNewton/)
target_compile_definitions(dgCore PUBLIC -D_NEWTON_STATIC_LIB -DDG_USE_THREAD_EMULATION -DDG_SCALAR_VECTOR_CLASS -D_DURANGO)

tlhelp32.h is actually used by the third-party dep "tracy", but that's an optional feature (which I didn't enable for my original Xbox port). I don't think dgTypes.h should include tlhelp32.h.

JulioJerez commented 4 years ago

you are right, that file is not needed for any configuration, It is removed. please sync again.