|
@@ -862,7 +862,6 @@ if (COMPILER=="GCC"):
|
|
|
assimp_libs = ("libassimp", "libassimpd")
|
|
assimp_libs = ("libassimp", "libassimpd")
|
|
|
|
|
|
|
|
# Name pkg-config libs, include(dir)s
|
|
# Name pkg-config libs, include(dir)s
|
|
|
- SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
|
|
|
|
|
SmartPkgEnable("ARTOOLKIT", "", ("AR"), "AR/ar.h")
|
|
SmartPkgEnable("ARTOOLKIT", "", ("AR"), "AR/ar.h")
|
|
|
SmartPkgEnable("FCOLLADA", "", ChooseLib(fcollada_libs, "FCOLLADA"), ("FCollada", "FCollada/FCollada.h"))
|
|
SmartPkgEnable("FCOLLADA", "", ChooseLib(fcollada_libs, "FCOLLADA"), ("FCollada", "FCollada/FCollada.h"))
|
|
|
SmartPkgEnable("ASSIMP", "assimp", ChooseLib(assimp_libs, "ASSIMP"), "assimp/Importer.hpp")
|
|
SmartPkgEnable("ASSIMP", "assimp", ChooseLib(assimp_libs, "ASSIMP"), "assimp/Importer.hpp")
|
|
@@ -871,31 +870,52 @@ if (COMPILER=="GCC"):
|
|
|
SmartPkgEnable("SWRESAMPLE","libswresample", "libswresample", ("libswresample/swresample.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
|
|
SmartPkgEnable("SWRESAMPLE","libswresample", "libswresample", ("libswresample/swresample.h"), target_pkg = "FFMPEG", thirdparty_dir = "ffmpeg")
|
|
|
SmartPkgEnable("FFTW", "fftw3", ("fftw3"), ("fftw.h"))
|
|
SmartPkgEnable("FFTW", "fftw3", ("fftw3"), ("fftw.h"))
|
|
|
SmartPkgEnable("FMODEX", "", ("fmodex"), ("fmodex", "fmodex/fmod.h"))
|
|
SmartPkgEnable("FMODEX", "", ("fmodex"), ("fmodex", "fmodex/fmod.h"))
|
|
|
- SmartPkgEnable("FREETYPE", "freetype2", ("freetype"), ("freetype2", "freetype2/freetype/freetype.h"))
|
|
|
|
|
- SmartPkgEnable("HARFBUZZ", "harfbuzz", ("harfbuzz"), ("harfbuzz", "harfbuzz/hb-ft.h"))
|
|
|
|
|
- SmartPkgEnable("GL", "gl", ("GL"), ("GL/gl.h"), framework = "OpenGL")
|
|
|
|
|
- SmartPkgEnable("GLES", "glesv1_cm", ("GLESv1_CM"), ("GLES/gl.h"), framework = "OpenGLES")
|
|
|
|
|
- SmartPkgEnable("GLES2", "glesv2", ("GLESv2"), ("GLES2/gl2.h")) #framework = "OpenGLES"?
|
|
|
|
|
- SmartPkgEnable("EGL", "egl", ("EGL"), ("EGL/egl.h"))
|
|
|
|
|
SmartPkgEnable("NVIDIACG", "", ("Cg"), "Cg/cg.h", framework = "Cg")
|
|
SmartPkgEnable("NVIDIACG", "", ("Cg"), "Cg/cg.h", framework = "Cg")
|
|
|
SmartPkgEnable("ODE", "", ("ode"), "ode/ode.h", tool = "ode-config")
|
|
SmartPkgEnable("ODE", "", ("ode"), "ode/ode.h", tool = "ode-config")
|
|
|
- SmartPkgEnable("OPENAL", "openal", ("openal"), "AL/al.h", framework = "OpenAL")
|
|
|
|
|
SmartPkgEnable("SQUISH", "", ("squish"), "squish.h")
|
|
SmartPkgEnable("SQUISH", "", ("squish"), "squish.h")
|
|
|
SmartPkgEnable("TIFF", "libtiff-4", ("tiff"), "tiff.h")
|
|
SmartPkgEnable("TIFF", "libtiff-4", ("tiff"), "tiff.h")
|
|
|
SmartPkgEnable("VRPN", "", ("vrpn", "quat"), ("vrpn", "quat.h", "vrpn/vrpn_Types.h"))
|
|
SmartPkgEnable("VRPN", "", ("vrpn", "quat"), ("vrpn", "quat.h", "vrpn/vrpn_Types.h"))
|
|
|
- SmartPkgEnable("BULLET", "bullet", ("BulletSoftBody", "BulletDynamics", "BulletCollision", "LinearMath"), ("bullet", "bullet/btBulletDynamicsCommon.h"))
|
|
|
|
|
- SmartPkgEnable("VORBIS", "vorbisfile",("vorbisfile", "vorbis", "ogg"), ("ogg/ogg.h", "vorbis/vorbisfile.h"))
|
|
|
|
|
SmartPkgEnable("OPUS", "opusfile", ("opusfile", "opus", "ogg"), ("ogg/ogg.h", "opus/opusfile.h", "opus"))
|
|
SmartPkgEnable("OPUS", "opusfile", ("opusfile", "opus", "ogg"), ("ogg/ogg.h", "opus/opusfile.h", "opus"))
|
|
|
SmartPkgEnable("JPEG", "", ("jpeg"), "jpeglib.h")
|
|
SmartPkgEnable("JPEG", "", ("jpeg"), "jpeglib.h")
|
|
|
- SmartPkgEnable("PNG", "libpng", ("png"), "png.h", tool = "libpng-config")
|
|
|
|
|
SmartPkgEnable("MIMALLOC", "", ("mimalloc"), "mimalloc.h")
|
|
SmartPkgEnable("MIMALLOC", "", ("mimalloc"), "mimalloc.h")
|
|
|
|
|
|
|
|
- # Copy freetype libraries to be specified after harfbuzz libraries as well,
|
|
|
|
|
- # because there's a circular dependency between the two libraries.
|
|
|
|
|
- if not PkgSkip("FREETYPE") and not PkgSkip("HARFBUZZ"):
|
|
|
|
|
- for (opt, name) in LIBNAMES:
|
|
|
|
|
- if opt == "FREETYPE":
|
|
|
|
|
- LibName("HARFBUZZ", name)
|
|
|
|
|
|
|
+ if GetTarget() != 'emscripten':
|
|
|
|
|
+ # Most of these are provided by emscripten or via emscripten-ports.
|
|
|
|
|
+ SmartPkgEnable("OPENAL", "openal", ("openal"), "AL/al.h", framework = "OpenAL")
|
|
|
|
|
+ SmartPkgEnable("EIGEN", "eigen3", (), ("Eigen/Dense",), target_pkg = 'ALWAYS')
|
|
|
|
|
+ SmartPkgEnable("VORBIS", "vorbisfile",("vorbisfile", "vorbis", "ogg"), ("ogg/ogg.h", "vorbis/vorbisfile.h"))
|
|
|
|
|
+ SmartPkgEnable("BULLET", "bullet", ("BulletSoftBody", "BulletDynamics", "BulletCollision", "LinearMath"), ("bullet", "bullet/btBulletDynamicsCommon.h"))
|
|
|
|
|
+ SmartPkgEnable("FREETYPE", "freetype2", ("freetype"), ("freetype2", "freetype2/freetype/freetype.h"))
|
|
|
|
|
+ SmartPkgEnable("HARFBUZZ", "harfbuzz", ("harfbuzz"), ("harfbuzz", "harfbuzz/hb-ft.h"))
|
|
|
|
|
+ SmartPkgEnable("PNG", "libpng", ("png"), "png.h", tool = "libpng-config")
|
|
|
|
|
+ SmartPkgEnable("GL", "gl", ("GL"), ("GL/gl.h"), framework = "OpenGL")
|
|
|
|
|
+ SmartPkgEnable("GLES", "glesv1_cm", ("GLESv1_CM"), ("GLES/gl.h"), framework = "OpenGLES")
|
|
|
|
|
+ SmartPkgEnable("GLES2", "glesv2", ("GLESv2"), ("GLES2/gl2.h")) #framework = "OpenGLES"?
|
|
|
|
|
+ SmartPkgEnable("EGL", "egl", ("EGL"), ("EGL/egl.h"))
|
|
|
|
|
+
|
|
|
|
|
+ # Copy freetype libraries to be specified after harfbuzz libraries as well,
|
|
|
|
|
+ # because there's a circular dependency between the two libraries.
|
|
|
|
|
+ if not PkgSkip("FREETYPE") and not PkgSkip("HARFBUZZ"):
|
|
|
|
|
+ for (opt, name) in LIBNAMES:
|
|
|
|
|
+ if opt == "FREETYPE":
|
|
|
|
|
+ LibName("HARFBUZZ", name)
|
|
|
|
|
+ else:
|
|
|
|
|
+ PkgDisable("EIGEN")
|
|
|
|
|
+ PkgDisable("X11")
|
|
|
|
|
+ PkgDisable("GL")
|
|
|
|
|
+ PkgDisable("GLES")
|
|
|
|
|
+ PkgDisable("TINYDISPLAY")
|
|
|
|
|
+ for pkg, empkg in {
|
|
|
|
|
+ 'VORBIS': 'VORBIS',
|
|
|
|
|
+ 'BULLET': 'BULLET',
|
|
|
|
|
+ 'ZLIB': 'ZLIB',
|
|
|
|
|
+ 'FREETYPE': 'FREETYPE',
|
|
|
|
|
+ 'HARFBUZZ': 'HARFBUZZ',
|
|
|
|
|
+ 'PNG': 'LIBPNG',
|
|
|
|
|
+ }.items():
|
|
|
|
|
+ if not PkgSkip(pkg):
|
|
|
|
|
+ LinkFlag(pkg, '-s USE_' + empkg + '=1')
|
|
|
|
|
+ CompileFlag(pkg, '-s USE_' + empkg + '=1')
|
|
|
|
|
|
|
|
if not PkgSkip("FFMPEG"):
|
|
if not PkgSkip("FFMPEG"):
|
|
|
if GetTarget() == "darwin":
|
|
if GetTarget() == "darwin":
|
|
@@ -904,8 +924,9 @@ if (COMPILER=="GCC"):
|
|
|
# Needed when linking ffmpeg statically on Linux.
|
|
# Needed when linking ffmpeg statically on Linux.
|
|
|
LibName("FFMPEG", "-Wl,-Bsymbolic")
|
|
LibName("FFMPEG", "-Wl,-Bsymbolic")
|
|
|
# Don't export ffmpeg symbols from libp3ffmpeg when linking statically.
|
|
# Don't export ffmpeg symbols from libp3ffmpeg when linking statically.
|
|
|
- for ffmpeg_lib in ffmpeg_libs:
|
|
|
|
|
- LibName("FFMPEG", "-Wl,--exclude-libs,%s.a" % (ffmpeg_lib))
|
|
|
|
|
|
|
+ if GetTarget() != "emscripten":
|
|
|
|
|
+ for ffmpeg_lib in ffmpeg_libs:
|
|
|
|
|
+ LibName("FFMPEG", "-Wl,--exclude-libs,%s.a" % (ffmpeg_lib))
|
|
|
|
|
|
|
|
if not PkgSkip("OPENEXR"):
|
|
if not PkgSkip("OPENEXR"):
|
|
|
# OpenEXR libraries have different names depending on the version.
|
|
# OpenEXR libraries have different names depending on the version.
|
|
@@ -924,7 +945,7 @@ if (COMPILER=="GCC"):
|
|
|
# using the OpenEXR 3 naming scheme.
|
|
# using the OpenEXR 3 naming scheme.
|
|
|
SmartPkgEnable("OPENEXR", "OpenEXR", ("OpenEXR", "IlmThread", "Imath", "Iex"), openexr_incs)
|
|
SmartPkgEnable("OPENEXR", "OpenEXR", ("OpenEXR", "IlmThread", "Imath", "Iex"), openexr_incs)
|
|
|
|
|
|
|
|
- if GetTarget() != "darwin":
|
|
|
|
|
|
|
+ if GetTarget() not in ("darwin", "emscripten"):
|
|
|
for fcollada_lib in fcollada_libs:
|
|
for fcollada_lib in fcollada_libs:
|
|
|
LibName("FCOLLADA", "-Wl,--exclude-libs,lib%s.a" % (fcollada_lib))
|
|
LibName("FCOLLADA", "-Wl,--exclude-libs,lib%s.a" % (fcollada_lib))
|
|
|
|
|
|
|
@@ -1000,7 +1021,7 @@ if (COMPILER=="GCC"):
|
|
|
LibName("OPENAL", "-framework AudioUnit")
|
|
LibName("OPENAL", "-framework AudioUnit")
|
|
|
LibName("OPENAL", "-framework AudioToolbox")
|
|
LibName("OPENAL", "-framework AudioToolbox")
|
|
|
LibName("OPENAL", "-framework CoreAudio")
|
|
LibName("OPENAL", "-framework CoreAudio")
|
|
|
- else:
|
|
|
|
|
|
|
+ elif GetTarget() != "emscripten":
|
|
|
LibName("OPENAL", "-Wl,--exclude-libs,libopenal.a")
|
|
LibName("OPENAL", "-Wl,--exclude-libs,libopenal.a")
|
|
|
|
|
|
|
|
if not PkgSkip("ASSIMP") and \
|
|
if not PkgSkip("ASSIMP") and \
|
|
@@ -1010,7 +1031,7 @@ if (COMPILER=="GCC"):
|
|
|
if os.path.isfile(irrxml):
|
|
if os.path.isfile(irrxml):
|
|
|
LibName("ASSIMP", irrxml)
|
|
LibName("ASSIMP", irrxml)
|
|
|
|
|
|
|
|
- if GetTarget() != "darwin":
|
|
|
|
|
|
|
+ if GetTarget() not in ("darwin", "emscripten"):
|
|
|
LibName("ASSIMP", "-Wl,--exclude-libs,libassimp.a")
|
|
LibName("ASSIMP", "-Wl,--exclude-libs,libassimp.a")
|
|
|
LibName("ASSIMP", "-Wl,--exclude-libs,libIrrXML.a")
|
|
LibName("ASSIMP", "-Wl,--exclude-libs,libIrrXML.a")
|
|
|
|
|
|
|
@@ -1018,19 +1039,31 @@ if (COMPILER=="GCC"):
|
|
|
python_lib = SDK["PYTHONVERSION"]
|
|
python_lib = SDK["PYTHONVERSION"]
|
|
|
SmartPkgEnable("PYTHON", "", python_lib, (SDK["PYTHONVERSION"], SDK["PYTHONVERSION"] + "/Python.h"))
|
|
SmartPkgEnable("PYTHON", "", python_lib, (SDK["PYTHONVERSION"], SDK["PYTHONVERSION"] + "/Python.h"))
|
|
|
|
|
|
|
|
|
|
+ if not PkgSkip("PYTHON") and GetTarget() == "emscripten":
|
|
|
|
|
+ # Python may have been compiled with these requirements.
|
|
|
|
|
+ # Is there a cleaner way to check this?
|
|
|
|
|
+ LinkFlag("PYTHON", "-s USE_BZIP2=1 -s USE_SQLITE3=1")
|
|
|
|
|
+ if not PkgHasCustomLocation("PYTHON"):
|
|
|
|
|
+ python_libdir = GetThirdpartyDir() + "python/lib"
|
|
|
|
|
+ if os.path.isfile(python_libdir + "/libmpdec.a"):
|
|
|
|
|
+ LibName("PYTHON", python_libdir + "/libmpdec.a")
|
|
|
|
|
+ if os.path.isfile(python_libdir + "/libexpat.a"):
|
|
|
|
|
+ LibName("PYTHON", python_libdir + "/libexpat.a")
|
|
|
|
|
+
|
|
|
if GetTarget() == "linux":
|
|
if GetTarget() == "linux":
|
|
|
LibName("PYTHON", "-lutil")
|
|
LibName("PYTHON", "-lutil")
|
|
|
LibName("PYTHON", "-lrt")
|
|
LibName("PYTHON", "-lrt")
|
|
|
|
|
|
|
|
SmartPkgEnable("OPENSSL", "openssl", ("ssl", "crypto"), ("openssl/ssl.h", "openssl/crypto.h"))
|
|
SmartPkgEnable("OPENSSL", "openssl", ("ssl", "crypto"), ("openssl/ssl.h", "openssl/crypto.h"))
|
|
|
- SmartPkgEnable("ZLIB", "zlib", ("z"), "zlib.h")
|
|
|
|
|
SmartPkgEnable("GTK3", "gtk+-3.0")
|
|
SmartPkgEnable("GTK3", "gtk+-3.0")
|
|
|
|
|
+ if GetTarget() != 'emscripten':
|
|
|
|
|
+ SmartPkgEnable("ZLIB", "zlib", ("z"), "zlib.h")
|
|
|
|
|
|
|
|
- if not PkgSkip("OPENSSL") and GetTarget() != "darwin":
|
|
|
|
|
|
|
+ if not PkgSkip("OPENSSL") and GetTarget() not in ("darwin", "emscripten"):
|
|
|
LibName("OPENSSL", "-Wl,--exclude-libs,libssl.a")
|
|
LibName("OPENSSL", "-Wl,--exclude-libs,libssl.a")
|
|
|
LibName("OPENSSL", "-Wl,--exclude-libs,libcrypto.a")
|
|
LibName("OPENSSL", "-Wl,--exclude-libs,libcrypto.a")
|
|
|
|
|
|
|
|
- if GetTarget() != 'darwin':
|
|
|
|
|
|
|
+ if GetTarget() not in ('darwin', 'emscripten'):
|
|
|
# CgGL is covered by the Cg framework, and we don't need X11 components on OSX
|
|
# CgGL is covered by the Cg framework, and we don't need X11 components on OSX
|
|
|
if not PkgSkip("NVIDIACG"):
|
|
if not PkgSkip("NVIDIACG"):
|
|
|
SmartPkgEnable("CGGL", "", ("CgGL"), "Cg/cgGL.h", thirdparty_dir = "nvidiacg")
|
|
SmartPkgEnable("CGGL", "", ("CgGL"), "Cg/cgGL.h", thirdparty_dir = "nvidiacg")
|
|
@@ -1134,7 +1167,7 @@ if (COMPILER=="GCC"):
|
|
|
LibName(pkg, "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
|
|
LibName(pkg, "-dylib_file /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib")
|
|
|
|
|
|
|
|
DefSymbol("WITHINPANDA", "WITHIN_PANDA", "1")
|
|
DefSymbol("WITHINPANDA", "WITHIN_PANDA", "1")
|
|
|
-if GetLinkAllStatic():
|
|
|
|
|
|
|
+if GetLinkAllStatic() or GetTarget() == 'emscripten':
|
|
|
DefSymbol("ALWAYS", "LINK_ALL_STATIC")
|
|
DefSymbol("ALWAYS", "LINK_ALL_STATIC")
|
|
|
if GetTarget() == 'android':
|
|
if GetTarget() == 'android':
|
|
|
DefSymbol("ALWAYS", "ANDROID")
|
|
DefSymbol("ALWAYS", "ANDROID")
|
|
@@ -1368,6 +1401,8 @@ def CompileCxx(obj,src,opts):
|
|
|
if (opt=="ALWAYS") or (opt in opts): cmd += ' -F' + BracketNameWithQuotes(dir)
|
|
if (opt=="ALWAYS") or (opt in opts): cmd += ' -F' + BracketNameWithQuotes(dir)
|
|
|
for (opt,var,val) in DEFSYMBOLS:
|
|
for (opt,var,val) in DEFSYMBOLS:
|
|
|
if (opt=="ALWAYS") or (opt in opts): cmd += ' -D' + var + '=' + val
|
|
if (opt=="ALWAYS") or (opt in opts): cmd += ' -D' + var + '=' + val
|
|
|
|
|
+ for (opt,flag) in COMPILEFLAGS:
|
|
|
|
|
+ if (opt=="ALWAYS") or (opt in opts): cmd += ' ' + flag
|
|
|
for x in ipath: cmd += ' -I' + x
|
|
for x in ipath: cmd += ' -I' + x
|
|
|
|
|
|
|
|
if not GetLinkAllStatic() and 'NOHIDDEN' not in opts:
|
|
if not GetLinkAllStatic() and 'NOHIDDEN' not in opts:
|
|
@@ -1391,7 +1426,7 @@ def CompileCxx(obj,src,opts):
|
|
|
if 'NOARCH:' + arch.upper() not in opts:
|
|
if 'NOARCH:' + arch.upper() not in opts:
|
|
|
cmd += " -arch %s" % arch
|
|
cmd += " -arch %s" % arch
|
|
|
|
|
|
|
|
- elif 'clang' not in GetCXX().split('/')[-1]:
|
|
|
|
|
|
|
+ elif 'clang' not in GetCXX().split('/')[-1] and GetCXX() != 'em++':
|
|
|
# Enable interprocedural optimizations in GCC.
|
|
# Enable interprocedural optimizations in GCC.
|
|
|
cmd += " -fno-semantic-interposition"
|
|
cmd += " -fno-semantic-interposition"
|
|
|
|
|
|
|
@@ -1437,6 +1472,12 @@ def CompileCxx(obj,src,opts):
|
|
|
if arch != 'arm64' and arch.startswith('arm') and PkgSkip("NEON") == 0:
|
|
if arch != 'arm64' and arch.startswith('arm') and PkgSkip("NEON") == 0:
|
|
|
cmd += ' -mfpu=neon'
|
|
cmd += ' -mfpu=neon'
|
|
|
|
|
|
|
|
|
|
+ elif GetTarget() == 'emscripten':
|
|
|
|
|
+ if GetOptimize() <= 1:
|
|
|
|
|
+ cmd += " -s ASSERTIONS=2"
|
|
|
|
|
+ elif GetOptimize() <= 2:
|
|
|
|
|
+ cmd += " -s ASSERTIONS=1"
|
|
|
|
|
+
|
|
|
else:
|
|
else:
|
|
|
cmd += " -pthread"
|
|
cmd += " -pthread"
|
|
|
|
|
|
|
@@ -1446,6 +1487,8 @@ def CompileCxx(obj,src,opts):
|
|
|
cmd += " -fexceptions"
|
|
cmd += " -fexceptions"
|
|
|
else:
|
|
else:
|
|
|
cmd += " -fno-exceptions"
|
|
cmd += " -fno-exceptions"
|
|
|
|
|
+ if GetTarget() == 'emscripten':
|
|
|
|
|
+ cmd += " -s DISABLE_EXCEPTION_CATCHING=1"
|
|
|
|
|
|
|
|
if src.endswith(".mm"):
|
|
if src.endswith(".mm"):
|
|
|
# Work around Apple compiler bug.
|
|
# Work around Apple compiler bug.
|
|
@@ -1458,7 +1501,8 @@ def CompileCxx(obj,src,opts):
|
|
|
cmd += " -fno-rtti"
|
|
cmd += " -fno-rtti"
|
|
|
|
|
|
|
|
if ('SSE2' in opts or not PkgSkip("SSE2")) and not arch.startswith("arm") and arch != 'aarch64':
|
|
if ('SSE2' in opts or not PkgSkip("SSE2")) and not arch.startswith("arm") and arch != 'aarch64':
|
|
|
- cmd += " -msse2"
|
|
|
|
|
|
|
+ if GetTarget() != "emscripten":
|
|
|
|
|
+ cmd += " -msse2"
|
|
|
|
|
|
|
|
# Needed by both Python, Panda, Eigen, all of which break aliasing rules.
|
|
# Needed by both Python, Panda, Eigen, all of which break aliasing rules.
|
|
|
cmd += " -fno-strict-aliasing"
|
|
cmd += " -fno-strict-aliasing"
|
|
@@ -1473,9 +1517,14 @@ def CompileCxx(obj,src,opts):
|
|
|
cmd += " -fno-finite-math-only"
|
|
cmd += " -fno-finite-math-only"
|
|
|
|
|
|
|
|
# Make sure this is off to avoid GCC/Eigen bug (see GitHub #228)
|
|
# Make sure this is off to avoid GCC/Eigen bug (see GitHub #228)
|
|
|
- cmd += " -fno-unsafe-math-optimizations"
|
|
|
|
|
|
|
+ if GetTarget() != "emscripten":
|
|
|
|
|
+ cmd += " -fno-unsafe-math-optimizations"
|
|
|
|
|
|
|
|
- if (optlevel==1): cmd += " -ggdb -D_DEBUG"
|
|
|
|
|
|
|
+ if (optlevel==1):
|
|
|
|
|
+ if GetTarget() == "emscripten":
|
|
|
|
|
+ cmd += " -g -D_DEBUG"
|
|
|
|
|
+ else:
|
|
|
|
|
+ cmd += " -ggdb -D_DEBUG"
|
|
|
if (optlevel==2): cmd += " -O1 -D_DEBUG"
|
|
if (optlevel==2): cmd += " -O1 -D_DEBUG"
|
|
|
if (optlevel==3): cmd += " -O2"
|
|
if (optlevel==3): cmd += " -O2"
|
|
|
if (optlevel==4): cmd += " -O3 -DNDEBUG"
|
|
if (optlevel==4): cmd += " -O3 -DNDEBUG"
|
|
@@ -1625,6 +1674,9 @@ def CompileIgate(woutd,wsrc,opts):
|
|
|
elif target == 'android':
|
|
elif target == 'android':
|
|
|
cmd += ' -D__ANDROID__'
|
|
cmd += ' -D__ANDROID__'
|
|
|
|
|
|
|
|
|
|
+ if GetTarget() == "emscripten":
|
|
|
|
|
+ cmd += ' -D__EMSCRIPTEN__'
|
|
|
|
|
+
|
|
|
optlevel = GetOptimizeOption(opts)
|
|
optlevel = GetOptimizeOption(opts)
|
|
|
if (optlevel==1): cmd += ' -D_DEBUG'
|
|
if (optlevel==1): cmd += ' -D_DEBUG'
|
|
|
if (optlevel==2): cmd += ' -D_DEBUG'
|
|
if (optlevel==2): cmd += ' -D_DEBUG'
|
|
@@ -1663,10 +1715,8 @@ def CompileIgate(woutd,wsrc,opts):
|
|
|
def CompileImod(wobj, wsrc, opts):
|
|
def CompileImod(wobj, wsrc, opts):
|
|
|
module = GetValueOption(opts, "IMOD:")
|
|
module = GetValueOption(opts, "IMOD:")
|
|
|
library = GetValueOption(opts, "ILIB:")
|
|
library = GetValueOption(opts, "ILIB:")
|
|
|
- if (COMPILER=="MSVC"):
|
|
|
|
|
- woutc = wobj[:-4]+".cxx"
|
|
|
|
|
- if (COMPILER=="GCC"):
|
|
|
|
|
- woutc = wobj[:-2]+".cxx"
|
|
|
|
|
|
|
+ woutc = os.path.splitext(wobj)[0] + ".cxx"
|
|
|
|
|
+
|
|
|
if (PkgSkip("PYTHON")):
|
|
if (PkgSkip("PYTHON")):
|
|
|
WriteFile(woutc, "")
|
|
WriteFile(woutc, "")
|
|
|
CompileCxx(wobj, woutc, opts)
|
|
CompileCxx(wobj, woutc, opts)
|
|
@@ -1889,13 +1939,18 @@ def CompileLink(dll, obj, opts):
|
|
|
else:
|
|
else:
|
|
|
cmd = cxx + ' -shared'
|
|
cmd = cxx + ' -shared'
|
|
|
# Always set soname on Android to avoid a linker warning when loading the library.
|
|
# Always set soname on Android to avoid a linker warning when loading the library.
|
|
|
- if "MODULE" not in opts or GetTarget() == 'android':
|
|
|
|
|
|
|
+ if GetTarget() == 'android' or ("MODULE" not in opts and GetTarget() != 'emscripten'):
|
|
|
cmd += " -Wl,-soname=" + os.path.basename(dll)
|
|
cmd += " -Wl,-soname=" + os.path.basename(dll)
|
|
|
cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
|
|
cmd += ' -o ' + dll + ' -L' + GetOutputDir() + '/lib -L' + GetOutputDir() + '/tmp'
|
|
|
|
|
|
|
|
- for x in obj:
|
|
|
|
|
- if GetOrigExt(x) != ".dat":
|
|
|
|
|
- cmd += ' ' + x
|
|
|
|
|
|
|
+ if GetTarget() == 'emscripten' and GetOrigExt(dll) != ".exe":
|
|
|
|
|
+ for x in obj:
|
|
|
|
|
+ if GetOrigExt(x) not in (".dat", ".dll"):
|
|
|
|
|
+ cmd += ' ' + x
|
|
|
|
|
+ else:
|
|
|
|
|
+ for x in obj:
|
|
|
|
|
+ if GetOrigExt(x) != ".dat":
|
|
|
|
|
+ cmd += ' ' + x
|
|
|
|
|
|
|
|
if (GetOrigExt(dll) == ".exe" and GetTarget() == 'windows' and "NOICON" not in opts):
|
|
if (GetOrigExt(dll) == ".exe" and GetTarget() == 'windows' and "NOICON" not in opts):
|
|
|
cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
|
|
cmd += " " + GetOutputDir() + "/tmp/pandaIcon.res"
|
|
@@ -1929,6 +1984,13 @@ def CompileLink(dll, obj, opts):
|
|
|
elif arch == 'mips':
|
|
elif arch == 'mips':
|
|
|
cmd += ' -mips32'
|
|
cmd += ' -mips32'
|
|
|
cmd += ' -lc -lm'
|
|
cmd += ' -lc -lm'
|
|
|
|
|
+
|
|
|
|
|
+ elif GetTarget() == 'emscripten':
|
|
|
|
|
+ cmd += " -s WARN_ON_UNDEFINED_SYMBOLS=1"
|
|
|
|
|
+ if GetOrigExt(dll) == ".exe":
|
|
|
|
|
+ cmd += " --memory-init-file 0"
|
|
|
|
|
+ cmd += " -s EXIT_RUNTIME=1"
|
|
|
|
|
+
|
|
|
else:
|
|
else:
|
|
|
cmd += " -pthread"
|
|
cmd += " -pthread"
|
|
|
if "SYSROOT" in SDK:
|
|
if "SYSROOT" in SDK:
|
|
@@ -1948,13 +2010,23 @@ def CompileLink(dll, obj, opts):
|
|
|
for (opt, dir) in FRAMEWORKDIRECTORIES:
|
|
for (opt, dir) in FRAMEWORKDIRECTORIES:
|
|
|
if (opt=="ALWAYS") or (opt in opts):
|
|
if (opt=="ALWAYS") or (opt in opts):
|
|
|
cmd += ' -F' + BracketNameWithQuotes(dir)
|
|
cmd += ' -F' + BracketNameWithQuotes(dir)
|
|
|
- for (opt, name) in LIBNAMES:
|
|
|
|
|
|
|
+ if GetOrigExt(dll) == ".exe" or GetTarget() != 'emscripten':
|
|
|
|
|
+ for (opt, name) in LIBNAMES:
|
|
|
|
|
+ if (opt=="ALWAYS") or (opt in opts):
|
|
|
|
|
+ cmd += ' ' + BracketNameWithQuotes(name)
|
|
|
|
|
+ for (opt, flag) in LINKFLAGS:
|
|
|
if (opt=="ALWAYS") or (opt in opts):
|
|
if (opt=="ALWAYS") or (opt in opts):
|
|
|
- cmd += ' ' + BracketNameWithQuotes(name)
|
|
|
|
|
|
|
+ cmd += ' ' + flag
|
|
|
|
|
|
|
|
- if GetTarget() != 'freebsd':
|
|
|
|
|
|
|
+ if GetTarget() not in ('freebsd', 'emscripten'):
|
|
|
cmd += " -ldl"
|
|
cmd += " -ldl"
|
|
|
|
|
|
|
|
|
|
+ if GetTarget() == 'emscripten':
|
|
|
|
|
+ optlevel = GetOptimizeOption(opts)
|
|
|
|
|
+ if optlevel == 2: cmd += " -O1"
|
|
|
|
|
+ if optlevel == 3: cmd += " -O2"
|
|
|
|
|
+ if optlevel == 4: cmd += " -O3"
|
|
|
|
|
+
|
|
|
oscmd(cmd)
|
|
oscmd(cmd)
|
|
|
|
|
|
|
|
if GetOptimizeOption(opts) == 4 and GetTarget() in ('linux', 'android'):
|
|
if GetOptimizeOption(opts) == 4 and GetTarget() in ('linux', 'android'):
|
|
@@ -2278,7 +2350,7 @@ def CompileAnything(target, inputs, opts, progress = None):
|
|
|
if target.lower().endswith(".dylib"):
|
|
if target.lower().endswith(".dylib"):
|
|
|
target = target[:-5] + MAJOR_VERSION + ".dylib"
|
|
target = target[:-5] + MAJOR_VERSION + ".dylib"
|
|
|
SetOrigExt(target, origsuffix)
|
|
SetOrigExt(target, origsuffix)
|
|
|
- elif tplatform != "windows" and tplatform != "android":
|
|
|
|
|
|
|
+ elif tplatform not in ("windows", "android", "emscripten"):
|
|
|
# On Linux, libraries are named like libpanda.so.1.2
|
|
# On Linux, libraries are named like libpanda.so.1.2
|
|
|
target += "." + MAJOR_VERSION
|
|
target += "." + MAJOR_VERSION
|
|
|
SetOrigExt(target, origsuffix)
|
|
SetOrigExt(target, origsuffix)
|
|
@@ -2463,11 +2535,11 @@ PRC_PARAMETERS=[
|
|
|
("DEFAULT_PRC_DIR", '"<auto>etc"', '"<auto>etc"'),
|
|
("DEFAULT_PRC_DIR", '"<auto>etc"', '"<auto>etc"'),
|
|
|
("PRC_DIR_ENVVARS", '"PANDA_PRC_DIR"', '"PANDA_PRC_DIR"'),
|
|
("PRC_DIR_ENVVARS", '"PANDA_PRC_DIR"', '"PANDA_PRC_DIR"'),
|
|
|
("PRC_PATH_ENVVARS", '"PANDA_PRC_PATH"', '"PANDA_PRC_PATH"'),
|
|
("PRC_PATH_ENVVARS", '"PANDA_PRC_PATH"', '"PANDA_PRC_PATH"'),
|
|
|
- ("PRC_PATH2_ENVVARS", '""', '""'),
|
|
|
|
|
|
|
+ ("PRC_PATH2_ENVVARS", 'UNDEF', 'UNDEF'),
|
|
|
("PRC_PATTERNS", '"*.prc"', '"*.prc"'),
|
|
("PRC_PATTERNS", '"*.prc"', '"*.prc"'),
|
|
|
("PRC_ENCRYPTED_PATTERNS", '"*.prc.pe"', '"*.prc.pe"'),
|
|
("PRC_ENCRYPTED_PATTERNS", '"*.prc.pe"', '"*.prc.pe"'),
|
|
|
("PRC_ENCRYPTION_KEY", '""', '""'),
|
|
("PRC_ENCRYPTION_KEY", '""', '""'),
|
|
|
- ("PRC_EXECUTABLE_PATTERNS", '""', '""'),
|
|
|
|
|
|
|
+ ("PRC_EXECUTABLE_PATTERNS", 'UNDEF', 'UNDEF'),
|
|
|
("PRC_EXECUTABLE_ARGS_ENVVAR", '"PANDA_PRC_XARGS"', '"PANDA_PRC_XARGS"'),
|
|
("PRC_EXECUTABLE_ARGS_ENVVAR", '"PANDA_PRC_XARGS"', '"PANDA_PRC_XARGS"'),
|
|
|
("PRC_PUBLIC_KEYS_FILENAME", '""', '""'),
|
|
("PRC_PUBLIC_KEYS_FILENAME", '""', '""'),
|
|
|
("PRC_RESPECT_TRUST_LEVEL", 'UNDEF', 'UNDEF'),
|
|
("PRC_RESPECT_TRUST_LEVEL", 'UNDEF', 'UNDEF'),
|
|
@@ -2553,6 +2625,26 @@ def WriteConfigSettings():
|
|
|
dtool_config["PHAVE_LOCKF"] = 'UNDEF'
|
|
dtool_config["PHAVE_LOCKF"] = 'UNDEF'
|
|
|
dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
|
|
dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
|
|
|
|
|
|
|
|
|
|
+ if (GetTarget() == "emscripten"):
|
|
|
|
|
+ # There are no threads in JavaScript, so don't bother using them.
|
|
|
|
|
+ dtool_config["HAVE_THREADS"] = 'UNDEF'
|
|
|
|
|
+ dtool_config["DO_PIPELINING"] = 'UNDEF'
|
|
|
|
|
+ dtool_config["HAVE_POSIX_THREADS"] = 'UNDEF'
|
|
|
|
|
+ dtool_config["IS_LINUX"] = 'UNDEF'
|
|
|
|
|
+ dtool_config["HAVE_VIDEO4LINUX"] = 'UNDEF'
|
|
|
|
|
+ dtool_config["HAVE_NET"] = 'UNDEF'
|
|
|
|
|
+ dtool_config["PHAVE_LINUX_INPUT_H"] = 'UNDEF'
|
|
|
|
|
+ dtool_config["HAVE_X11"] = 'UNDEF'
|
|
|
|
|
+ dtool_config["HAVE_GLX"] = 'UNDEF'
|
|
|
|
|
+
|
|
|
|
|
+ # There are no environment vars either, or default prc files.
|
|
|
|
|
+ prc_parameters["DEFAULT_PRC_DIR"] = 'UNDEF'
|
|
|
|
|
+ prc_parameters["PRC_DIR_ENVVARS"] = 'UNDEF'
|
|
|
|
|
+ prc_parameters["PRC_PATH_ENVVARS"] = 'UNDEF'
|
|
|
|
|
+ prc_parameters["PRC_PATH2_ENVVARS"] = 'UNDEF'
|
|
|
|
|
+ prc_parameters["PRC_PATTERNS"] = 'UNDEF'
|
|
|
|
|
+ prc_parameters["PRC_ENCRYPTED_PATTERNS"] = 'UNDEF'
|
|
|
|
|
+
|
|
|
if (GetOptimize() <= 2 and GetTarget() == "windows"):
|
|
if (GetOptimize() <= 2 and GetTarget() == "windows"):
|
|
|
dtool_config["USE_DEBUG_PYTHON"] = '1'
|
|
dtool_config["USE_DEBUG_PYTHON"] = '1'
|
|
|
|
|
|
|
@@ -2566,7 +2658,7 @@ def WriteConfigSettings():
|
|
|
if (GetOptimize() <= 3):
|
|
if (GetOptimize() <= 3):
|
|
|
dtool_config["DO_COLLISION_RECORDING"] = '1'
|
|
dtool_config["DO_COLLISION_RECORDING"] = '1'
|
|
|
|
|
|
|
|
- if (GetOptimize() <= 3):
|
|
|
|
|
|
|
+ if (GetOptimize() <= 3) and GetTarget() != 'emscripten':
|
|
|
dtool_config["DO_MEMORY_USAGE"] = '1'
|
|
dtool_config["DO_MEMORY_USAGE"] = '1'
|
|
|
|
|
|
|
|
if (GetOptimize() <= 3):
|
|
if (GetOptimize() <= 3):
|
|
@@ -3791,7 +3883,9 @@ TargetAdd('libp3gsgbase.in', opts=['IMOD:panda3d.core', 'ILIB:libp3gsgbase', 'SR
|
|
|
OPTS=['DIR:panda/src/pnmimage', 'BUILDING:PANDA', 'ZLIB']
|
|
OPTS=['DIR:panda/src/pnmimage', 'BUILDING:PANDA', 'ZLIB']
|
|
|
TargetAdd('p3pnmimage_composite1.obj', opts=OPTS, input='p3pnmimage_composite1.cxx')
|
|
TargetAdd('p3pnmimage_composite1.obj', opts=OPTS, input='p3pnmimage_composite1.cxx')
|
|
|
TargetAdd('p3pnmimage_composite2.obj', opts=OPTS, input='p3pnmimage_composite2.cxx')
|
|
TargetAdd('p3pnmimage_composite2.obj', opts=OPTS, input='p3pnmimage_composite2.cxx')
|
|
|
-TargetAdd('p3pnmimage_convert_srgb_sse2.obj', opts=OPTS+['SSE2'], input='convert_srgb_sse2.cxx')
|
|
|
|
|
|
|
+
|
|
|
|
|
+if GetTarget() != "emscripten":
|
|
|
|
|
+ TargetAdd('p3pnmimage_convert_srgb_sse2.obj', opts=OPTS+['SSE2'], input='convert_srgb_sse2.cxx')
|
|
|
|
|
|
|
|
OPTS=['DIR:panda/src/pnmimage', 'ZLIB']
|
|
OPTS=['DIR:panda/src/pnmimage', 'ZLIB']
|
|
|
IGATEFILES=GetDirectoryContents('panda/src/pnmimage', ["*.h", "*_composite*.cxx"])
|
|
IGATEFILES=GetDirectoryContents('panda/src/pnmimage', ["*.h", "*_composite*.cxx"])
|
|
@@ -3803,8 +3897,9 @@ PyTargetAdd('p3pnmimage_pfmFile_ext.obj', opts=OPTS, input='pfmFile_ext.cxx')
|
|
|
# DIRECTORY: panda/src/nativenet/
|
|
# DIRECTORY: panda/src/nativenet/
|
|
|
#
|
|
#
|
|
|
|
|
|
|
|
-OPTS=['DIR:panda/src/nativenet', 'BUILDING:PANDA']
|
|
|
|
|
-TargetAdd('p3nativenet_composite1.obj', opts=OPTS, input='p3nativenet_composite1.cxx')
|
|
|
|
|
|
|
+if GetTarget() != 'emscripten':
|
|
|
|
|
+ OPTS=['DIR:panda/src/nativenet', 'BUILDING:PANDA']
|
|
|
|
|
+ TargetAdd('p3nativenet_composite1.obj', opts=OPTS, input='p3nativenet_composite1.cxx')
|
|
|
|
|
|
|
|
OPTS=['DIR:panda/src/nativenet']
|
|
OPTS=['DIR:panda/src/nativenet']
|
|
|
IGATEFILES=GetDirectoryContents('panda/src/nativenet', ["*.h", "*_composite*.cxx"])
|
|
IGATEFILES=GetDirectoryContents('panda/src/nativenet', ["*.h", "*_composite*.cxx"])
|
|
@@ -3815,9 +3910,10 @@ TargetAdd('libp3nativenet.in', opts=['IMOD:panda3d.core', 'ILIB:libp3nativenet',
|
|
|
# DIRECTORY: panda/src/net/
|
|
# DIRECTORY: panda/src/net/
|
|
|
#
|
|
#
|
|
|
|
|
|
|
|
-OPTS=['DIR:panda/src/net', 'BUILDING:PANDA']
|
|
|
|
|
-TargetAdd('p3net_composite1.obj', opts=OPTS, input='p3net_composite1.cxx')
|
|
|
|
|
-TargetAdd('p3net_composite2.obj', opts=OPTS, input='p3net_composite2.cxx')
|
|
|
|
|
|
|
+if GetTarget() != 'emscripten':
|
|
|
|
|
+ OPTS=['DIR:panda/src/net', 'BUILDING:PANDA']
|
|
|
|
|
+ TargetAdd('p3net_composite1.obj', opts=OPTS, input='p3net_composite1.cxx')
|
|
|
|
|
+ TargetAdd('p3net_composite2.obj', opts=OPTS, input='p3net_composite2.cxx')
|
|
|
|
|
|
|
|
OPTS=['DIR:panda/src/net']
|
|
OPTS=['DIR:panda/src/net']
|
|
|
IGATEFILES=GetDirectoryContents('panda/src/net', ["*.h", "*_composite*.cxx"])
|
|
IGATEFILES=GetDirectoryContents('panda/src/net', ["*.h", "*_composite*.cxx"])
|
|
@@ -4155,7 +4251,6 @@ TargetAdd('libpanda.dll', input='p3pnmimagetypes_composite1.obj')
|
|
|
TargetAdd('libpanda.dll', input='p3pnmimagetypes_composite2.obj')
|
|
TargetAdd('libpanda.dll', input='p3pnmimagetypes_composite2.obj')
|
|
|
TargetAdd('libpanda.dll', input='p3pnmimage_composite1.obj')
|
|
TargetAdd('libpanda.dll', input='p3pnmimage_composite1.obj')
|
|
|
TargetAdd('libpanda.dll', input='p3pnmimage_composite2.obj')
|
|
TargetAdd('libpanda.dll', input='p3pnmimage_composite2.obj')
|
|
|
-TargetAdd('libpanda.dll', input='p3pnmimage_convert_srgb_sse2.obj')
|
|
|
|
|
TargetAdd('libpanda.dll', input='p3text_composite1.obj')
|
|
TargetAdd('libpanda.dll', input='p3text_composite1.obj')
|
|
|
TargetAdd('libpanda.dll', input='p3text_composite2.obj')
|
|
TargetAdd('libpanda.dll', input='p3text_composite2.obj')
|
|
|
TargetAdd('libpanda.dll', input='p3tform_composite1.obj')
|
|
TargetAdd('libpanda.dll', input='p3tform_composite1.obj')
|
|
@@ -4165,14 +4260,17 @@ TargetAdd('libpanda.dll', input='p3putil_composite2.obj')
|
|
|
TargetAdd('libpanda.dll', input='p3audio_composite1.obj')
|
|
TargetAdd('libpanda.dll', input='p3audio_composite1.obj')
|
|
|
TargetAdd('libpanda.dll', input='p3pgui_composite1.obj')
|
|
TargetAdd('libpanda.dll', input='p3pgui_composite1.obj')
|
|
|
TargetAdd('libpanda.dll', input='p3pgui_composite2.obj')
|
|
TargetAdd('libpanda.dll', input='p3pgui_composite2.obj')
|
|
|
-TargetAdd('libpanda.dll', input='p3net_composite1.obj')
|
|
|
|
|
-TargetAdd('libpanda.dll', input='p3net_composite2.obj')
|
|
|
|
|
-TargetAdd('libpanda.dll', input='p3nativenet_composite1.obj')
|
|
|
|
|
TargetAdd('libpanda.dll', input='p3pandabase_pandabase.obj')
|
|
TargetAdd('libpanda.dll', input='p3pandabase_pandabase.obj')
|
|
|
TargetAdd('libpanda.dll', input='libpandaexpress.dll')
|
|
TargetAdd('libpanda.dll', input='libpandaexpress.dll')
|
|
|
TargetAdd('libpanda.dll', input='libp3dtoolconfig.dll')
|
|
TargetAdd('libpanda.dll', input='libp3dtoolconfig.dll')
|
|
|
TargetAdd('libpanda.dll', input='libp3dtool.dll')
|
|
TargetAdd('libpanda.dll', input='libp3dtool.dll')
|
|
|
|
|
|
|
|
|
|
+if GetTarget() != "emscripten":
|
|
|
|
|
+ TargetAdd('libpanda.dll', input='p3net_composite1.obj')
|
|
|
|
|
+ TargetAdd('libpanda.dll', input='p3net_composite2.obj')
|
|
|
|
|
+ TargetAdd('libpanda.dll', input='p3nativenet_composite1.obj')
|
|
|
|
|
+ TargetAdd('libpanda.dll', input='p3pnmimage_convert_srgb_sse2.obj')
|
|
|
|
|
+
|
|
|
if PkgSkip("FREETYPE")==0:
|
|
if PkgSkip("FREETYPE")==0:
|
|
|
TargetAdd('libpanda.dll', input="p3pnmtext_composite1.obj")
|
|
TargetAdd('libpanda.dll', input="p3pnmtext_composite1.obj")
|
|
|
|
|
|
|
@@ -4210,11 +4308,13 @@ PyTargetAdd('core_module.obj', input='libp3text.in')
|
|
|
PyTargetAdd('core_module.obj', input='libp3tform.in')
|
|
PyTargetAdd('core_module.obj', input='libp3tform.in')
|
|
|
PyTargetAdd('core_module.obj', input='libp3putil.in')
|
|
PyTargetAdd('core_module.obj', input='libp3putil.in')
|
|
|
PyTargetAdd('core_module.obj', input='libp3audio.in')
|
|
PyTargetAdd('core_module.obj', input='libp3audio.in')
|
|
|
-PyTargetAdd('core_module.obj', input='libp3nativenet.in')
|
|
|
|
|
-PyTargetAdd('core_module.obj', input='libp3net.in')
|
|
|
|
|
PyTargetAdd('core_module.obj', input='libp3pgui.in')
|
|
PyTargetAdd('core_module.obj', input='libp3pgui.in')
|
|
|
PyTargetAdd('core_module.obj', input='libp3movies.in')
|
|
PyTargetAdd('core_module.obj', input='libp3movies.in')
|
|
|
|
|
|
|
|
|
|
+if GetTarget() != "emscripten":
|
|
|
|
|
+ PyTargetAdd('core_module.obj', input='libp3nativenet.in')
|
|
|
|
|
+ PyTargetAdd('core_module.obj', input='libp3net.in')
|
|
|
|
|
+
|
|
|
if PkgSkip("FREETYPE")==0:
|
|
if PkgSkip("FREETYPE")==0:
|
|
|
PyTargetAdd('core_module.obj', input='libp3pnmtext.in')
|
|
PyTargetAdd('core_module.obj', input='libp3pnmtext.in')
|
|
|
|
|
|
|
@@ -4256,8 +4356,10 @@ PyTargetAdd('core.pyd', input='libp3tform_igate.obj')
|
|
|
PyTargetAdd('core.pyd', input='libp3putil_igate.obj')
|
|
PyTargetAdd('core.pyd', input='libp3putil_igate.obj')
|
|
|
PyTargetAdd('core.pyd', input='libp3audio_igate.obj')
|
|
PyTargetAdd('core.pyd', input='libp3audio_igate.obj')
|
|
|
PyTargetAdd('core.pyd', input='libp3pgui_igate.obj')
|
|
PyTargetAdd('core.pyd', input='libp3pgui_igate.obj')
|
|
|
-PyTargetAdd('core.pyd', input='libp3net_igate.obj')
|
|
|
|
|
-PyTargetAdd('core.pyd', input='libp3nativenet_igate.obj')
|
|
|
|
|
|
|
+
|
|
|
|
|
+if GetTarget() != "emscripten":
|
|
|
|
|
+ PyTargetAdd('core.pyd', input='libp3net_igate.obj')
|
|
|
|
|
+ PyTargetAdd('core.pyd', input='libp3nativenet_igate.obj')
|
|
|
|
|
|
|
|
if PkgSkip("FREETYPE")==0:
|
|
if PkgSkip("FREETYPE")==0:
|
|
|
PyTargetAdd('core.pyd', input="libp3pnmtext_igate.obj")
|
|
PyTargetAdd('core.pyd', input="libp3pnmtext_igate.obj")
|
|
@@ -4635,7 +4737,7 @@ if not PkgSkip("EGG"):
|
|
|
# DIRECTORY: panda/src/x11display/
|
|
# DIRECTORY: panda/src/x11display/
|
|
|
#
|
|
#
|
|
|
|
|
|
|
|
-if GetTarget() not in ['windows', 'darwin'] and not PkgSkip("X11"):
|
|
|
|
|
|
|
+if GetTarget() not in ['windows', 'darwin', 'emscripten'] and not PkgSkip("X11"):
|
|
|
OPTS=['DIR:panda/src/x11display', 'BUILDING:PANDAX11', 'X11']
|
|
OPTS=['DIR:panda/src/x11display', 'BUILDING:PANDAX11', 'X11']
|
|
|
TargetAdd('p3x11display_composite1.obj', opts=OPTS, input='p3x11display_composite1.cxx')
|
|
TargetAdd('p3x11display_composite1.obj', opts=OPTS, input='p3x11display_composite1.cxx')
|
|
|
|
|
|
|
@@ -4643,7 +4745,7 @@ if GetTarget() not in ['windows', 'darwin'] and not PkgSkip("X11"):
|
|
|
# DIRECTORY: panda/src/glxdisplay/
|
|
# DIRECTORY: panda/src/glxdisplay/
|
|
|
#
|
|
#
|
|
|
|
|
|
|
|
-if GetTarget() not in ['windows', 'darwin'] and not PkgSkip("GL") and not PkgSkip("X11"):
|
|
|
|
|
|
|
+if GetTarget() not in ['windows', 'darwin', 'emscripten'] and not PkgSkip("GL") and not PkgSkip("X11"):
|
|
|
DefSymbol('GLX', 'HAVE_GLX', '')
|
|
DefSymbol('GLX', 'HAVE_GLX', '')
|
|
|
OPTS=['DIR:panda/src/glxdisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL', 'GLX']
|
|
OPTS=['DIR:panda/src/glxdisplay', 'BUILDING:PANDAGL', 'GL', 'NVIDIACG', 'CGGL', 'GLX']
|
|
|
TargetAdd('p3glxdisplay_composite1.obj', opts=OPTS, input='p3glxdisplay_composite1.cxx')
|
|
TargetAdd('p3glxdisplay_composite1.obj', opts=OPTS, input='p3glxdisplay_composite1.cxx')
|
|
@@ -4773,6 +4875,21 @@ if GetTarget() != 'android' and not PkgSkip("EGL") and not PkgSkip("GLES2"):
|
|
|
TargetAdd('libpandagles2.dll', input=COMMON_PANDA_LIBS)
|
|
TargetAdd('libpandagles2.dll', input=COMMON_PANDA_LIBS)
|
|
|
TargetAdd('libpandagles2.dll', opts=['MODULE', 'GLES2', 'EGL', 'X11'])
|
|
TargetAdd('libpandagles2.dll', opts=['MODULE', 'GLES2', 'EGL', 'X11'])
|
|
|
|
|
|
|
|
|
|
+#
|
|
|
|
|
+# DIRECTORY: panda/src/webgldisplay/
|
|
|
|
|
+#
|
|
|
|
|
+
|
|
|
|
|
+if GetTarget() == 'emscripten' and not PkgSkip("GLES2"):
|
|
|
|
|
+ DefSymbol('GLES2', 'OPENGLES_2', '')
|
|
|
|
|
+ LinkFlag('GLES2', '-s GL_ENABLE_GET_PROC_ADDRESS=1')
|
|
|
|
|
+ OPTS=['DIR:panda/src/webgldisplay', 'DIR:panda/src/glstuff', 'BUILDING:PANDAGLES2', 'GLES2', 'WEBGL']
|
|
|
|
|
+ TargetAdd('p3webgldisplay_webgldisplay_composite1.obj', opts=OPTS, input='p3webgldisplay_composite1.cxx')
|
|
|
|
|
+ TargetAdd('libp3webgldisplay.dll', input='p3gles2gsg_config_gles2gsg.obj')
|
|
|
|
|
+ TargetAdd('libp3webgldisplay.dll', input='p3gles2gsg_gles2gsg.obj')
|
|
|
|
|
+ TargetAdd('libp3webgldisplay.dll', input='p3webgldisplay_webgldisplay_composite1.obj')
|
|
|
|
|
+ TargetAdd('libp3webgldisplay.dll', input=COMMON_PANDA_LIBS)
|
|
|
|
|
+ TargetAdd('libp3webgldisplay.dll', opts=['MODULE', 'GLES2', 'WEBGL'])
|
|
|
|
|
+
|
|
|
#
|
|
#
|
|
|
# DIRECTORY: panda/src/ode/
|
|
# DIRECTORY: panda/src/ode/
|
|
|
#
|
|
#
|
|
@@ -4958,6 +5075,8 @@ if not PkgSkip("PVIEW"):
|
|
|
|
|
|
|
|
if GetLinkAllStatic() and not PkgSkip("GL"):
|
|
if GetLinkAllStatic() and not PkgSkip("GL"):
|
|
|
TargetAdd('pview.exe', input='libpandagl.dll')
|
|
TargetAdd('pview.exe', input='libpandagl.dll')
|
|
|
|
|
+ if GetTarget() == "emscripten" and not PkgSkip("GLES2"):
|
|
|
|
|
+ TargetAdd('pview.exe', input='libp3webgldisplay.dll')
|
|
|
|
|
|
|
|
#
|
|
#
|
|
|
# DIRECTORY: panda/src/android/
|
|
# DIRECTORY: panda/src/android/
|
|
@@ -5124,7 +5243,7 @@ if not PkgSkip("DIRECT"):
|
|
|
# DIRECTORY: direct/src/distributed/
|
|
# DIRECTORY: direct/src/distributed/
|
|
|
#
|
|
#
|
|
|
|
|
|
|
|
-if not PkgSkip("DIRECT"):
|
|
|
|
|
|
|
+if not PkgSkip("DIRECT") and GetTarget() != 'emscripten':
|
|
|
OPTS=['DIR:direct/src/distributed', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'BUILDING:DIRECT']
|
|
OPTS=['DIR:direct/src/distributed', 'DIR:direct/src/dcparser', 'WITHINPANDA', 'BUILDING:DIRECT']
|
|
|
TargetAdd('p3distributed_config_distributed.obj', opts=OPTS, input='config_distributed.cxx')
|
|
TargetAdd('p3distributed_config_distributed.obj', opts=OPTS, input='config_distributed.cxx')
|
|
|
|
|
|
|
@@ -5192,7 +5311,8 @@ if not PkgSkip("DIRECT"):
|
|
|
if GetTarget() == 'darwin':
|
|
if GetTarget() == 'darwin':
|
|
|
TargetAdd('libp3direct.dll', input='p3showbase_showBase_assist.obj')
|
|
TargetAdd('libp3direct.dll', input='p3showbase_showBase_assist.obj')
|
|
|
TargetAdd('libp3direct.dll', input='p3deadrec_composite1.obj')
|
|
TargetAdd('libp3direct.dll', input='p3deadrec_composite1.obj')
|
|
|
- TargetAdd('libp3direct.dll', input='p3distributed_config_distributed.obj')
|
|
|
|
|
|
|
+ if GetTarget() != 'emscripten':
|
|
|
|
|
+ TargetAdd('libp3direct.dll', input='p3distributed_config_distributed.obj')
|
|
|
TargetAdd('libp3direct.dll', input='p3interval_composite1.obj')
|
|
TargetAdd('libp3direct.dll', input='p3interval_composite1.obj')
|
|
|
TargetAdd('libp3direct.dll', input='p3motiontrail_config_motiontrail.obj')
|
|
TargetAdd('libp3direct.dll', input='p3motiontrail_config_motiontrail.obj')
|
|
|
TargetAdd('libp3direct.dll', input='p3motiontrail_cMotionTrail.obj')
|
|
TargetAdd('libp3direct.dll', input='p3motiontrail_cMotionTrail.obj')
|
|
@@ -5203,7 +5323,8 @@ if not PkgSkip("DIRECT"):
|
|
|
PyTargetAdd('direct_module.obj', input='libp3showbase.in')
|
|
PyTargetAdd('direct_module.obj', input='libp3showbase.in')
|
|
|
PyTargetAdd('direct_module.obj', input='libp3deadrec.in')
|
|
PyTargetAdd('direct_module.obj', input='libp3deadrec.in')
|
|
|
PyTargetAdd('direct_module.obj', input='libp3interval.in')
|
|
PyTargetAdd('direct_module.obj', input='libp3interval.in')
|
|
|
- PyTargetAdd('direct_module.obj', input='libp3distributed.in')
|
|
|
|
|
|
|
+ if GetTarget() != 'emscripten':
|
|
|
|
|
+ PyTargetAdd('direct_module.obj', input='libp3distributed.in')
|
|
|
PyTargetAdd('direct_module.obj', input='libp3motiontrail.in')
|
|
PyTargetAdd('direct_module.obj', input='libp3motiontrail.in')
|
|
|
PyTargetAdd('direct_module.obj', opts=['IMOD:panda3d.direct', 'ILIB:direct', 'IMPORT:panda3d.core'])
|
|
PyTargetAdd('direct_module.obj', opts=['IMOD:panda3d.direct', 'ILIB:direct', 'IMPORT:panda3d.core'])
|
|
|
|
|
|
|
@@ -5212,15 +5333,17 @@ if not PkgSkip("DIRECT"):
|
|
|
PyTargetAdd('direct.pyd', input='libp3deadrec_igate.obj')
|
|
PyTargetAdd('direct.pyd', input='libp3deadrec_igate.obj')
|
|
|
PyTargetAdd('direct.pyd', input='libp3interval_igate.obj')
|
|
PyTargetAdd('direct.pyd', input='libp3interval_igate.obj')
|
|
|
PyTargetAdd('direct.pyd', input='p3interval_cInterval_ext.obj')
|
|
PyTargetAdd('direct.pyd', input='p3interval_cInterval_ext.obj')
|
|
|
- PyTargetAdd('direct.pyd', input='libp3distributed_igate.obj')
|
|
|
|
|
|
|
+ if GetTarget() != 'emscripten':
|
|
|
|
|
+ PyTargetAdd('direct.pyd', input='libp3distributed_igate.obj')
|
|
|
PyTargetAdd('direct.pyd', input='libp3motiontrail_igate.obj')
|
|
PyTargetAdd('direct.pyd', input='libp3motiontrail_igate.obj')
|
|
|
|
|
|
|
|
# These are part of direct.pyd, not libp3direct.dll, because they rely on
|
|
# These are part of direct.pyd, not libp3direct.dll, because they rely on
|
|
|
# the Python libraries. If a C++ user needs these modules, we can move them
|
|
# the Python libraries. If a C++ user needs these modules, we can move them
|
|
|
# back and filter out the Python-specific code.
|
|
# back and filter out the Python-specific code.
|
|
|
PyTargetAdd('direct.pyd', input='p3dcparser_ext_composite.obj')
|
|
PyTargetAdd('direct.pyd', input='p3dcparser_ext_composite.obj')
|
|
|
- PyTargetAdd('direct.pyd', input='p3distributed_cConnectionRepository.obj')
|
|
|
|
|
- PyTargetAdd('direct.pyd', input='p3distributed_cDistributedSmoothNodeBase.obj')
|
|
|
|
|
|
|
+ if GetTarget() != 'emscripten':
|
|
|
|
|
+ PyTargetAdd('direct.pyd', input='p3distributed_cConnectionRepository.obj')
|
|
|
|
|
+ PyTargetAdd('direct.pyd', input='p3distributed_cDistributedSmoothNodeBase.obj')
|
|
|
|
|
|
|
|
PyTargetAdd('direct.pyd', input='direct_module.obj')
|
|
PyTargetAdd('direct.pyd', input='direct_module.obj')
|
|
|
PyTargetAdd('direct.pyd', input='libp3direct.dll')
|
|
PyTargetAdd('direct.pyd', input='libp3direct.dll')
|
|
@@ -5886,7 +6009,7 @@ if not PkgSkip("PANDATOOL"):
|
|
|
# DIRECTORY: pandatool/src/text-stats/
|
|
# DIRECTORY: pandatool/src/text-stats/
|
|
|
#
|
|
#
|
|
|
|
|
|
|
|
-if not PkgSkip("PANDATOOL"):
|
|
|
|
|
|
|
+if not PkgSkip("PANDATOOL") and GetTarget() != 'emscripten':
|
|
|
OPTS=['DIR:pandatool/src/text-stats']
|
|
OPTS=['DIR:pandatool/src/text-stats']
|
|
|
TargetAdd('text-stats_textMonitor.obj', opts=OPTS, input='textMonitor.cxx')
|
|
TargetAdd('text-stats_textMonitor.obj', opts=OPTS, input='textMonitor.cxx')
|
|
|
TargetAdd('text-stats_textStats.obj', opts=OPTS, input='textStats.cxx')
|
|
TargetAdd('text-stats_textStats.obj', opts=OPTS, input='textStats.cxx')
|
|
@@ -6159,6 +6282,9 @@ if PkgSkip("PYTHON") == 0:
|
|
|
PyTargetAdd('deploy-stub.exe', input='frozen_dllmain.obj')
|
|
PyTargetAdd('deploy-stub.exe', input='frozen_dllmain.obj')
|
|
|
PyTargetAdd('deploy-stub.exe', opts=['WINSHELL', 'DEPLOYSTUB', 'NOICON', 'ANDROID'])
|
|
PyTargetAdd('deploy-stub.exe', opts=['WINSHELL', 'DEPLOYSTUB', 'NOICON', 'ANDROID'])
|
|
|
|
|
|
|
|
|
|
+ if GetTarget() == 'emscripten':
|
|
|
|
|
+ PyTargetAdd('deploy-stub.exe', opts=['ZLIB'])
|
|
|
|
|
+
|
|
|
if GetTarget() == 'windows':
|
|
if GetTarget() == 'windows':
|
|
|
PyTargetAdd('deploy-stubw.exe', input='deploy-stub.obj')
|
|
PyTargetAdd('deploy-stubw.exe', input='deploy-stub.obj')
|
|
|
PyTargetAdd('deploy-stubw.exe', input='frozen_dllmain.obj')
|
|
PyTargetAdd('deploy-stubw.exe', input='frozen_dllmain.obj')
|