I have encountered a weird behaviour with my Windows build of Panda3D SDK. If I compile with --optimize=4 panda3d seems broken. For example, the content of MAIN_DIR env variable changes :
With the following program :
from panda3d.core import ExecutionEnvironment
main_dir = ExecutionEnvironment.getEnvironmentVariable("MAIN_DIR")
print("MAIN", main_dir)
from direct.showbase.ShowBase import ShowBase
main_dir = ExecutionEnvironment.getEnvironmentVariable("MAIN_DIR")
print("MAIN", main_dir)
The output with optimize=3 is :
c:\msys64\home\ld\cosmonium>c:\panda3d-1.10.7-x64\python\python.exe test_main.py MAIN C:\msys64\home\ld\cosmonium MAIN C:\msys64\home\ld\cosmonium
But with optimize=4 :
c:\msys64\home\ld\cosmonium>c:\panda3d-1.10.7-x64\python\python.exe test_main.py MAIN C:\msys64\home\ld\cosmonium MAIN C:\
I’m buiding Panda3D using VS 2015 and the following command (using Python 3.7 from the thirdparty bundle):
makepanda/makepanda.py \ --everything \ --msvc-version=14 \ --windows-sdk=7.1 \ --no-eigen \ --nocolor \ --use-sse2 \ --threads=4 \ --optimize=4 \ --installer \ --lzma
Has anyone encoutered something like that ?