google / google/draco

How to build the 'draco3d' npm package?

Open
#1,017 1 comment 0 reactions 0 assignees View on GitHub
documentation question
Dominant language
C++
Stars
7.5k
Forks
1.1k
Avg merge
47m
Merged PRs (30d)
1

Description

Hello!

I need to rebuild the **draco3d** package with **backwards compatibility off**, but when I follow the BUILDING.md, it's only generating the following files:
image

Here's what I'm using:
- cmake version 3.27.3
- make GNU Make 3.81
- latest emsdk:
Resolving SDK alias 'latest' to '3.1.44'
Resolving SDK version '3.1.44' to 'sdk-releases-b90507fcf011da61bacfca613569d882f7749552-64bit'
Setting the following tools as active:
node-16.20.0-64bit
python-3.9.2-64bit
releases-b90507fcf011da61bacfca613569d882f7749552-64bit

Also tried ./emsdk install 2.0.0 followed by ./emsdk activate 2.0.0, but the output is the same.

Steps:
- clone repo, clone emsdk
- $ git submodule update --init
- $ mkdir build_dir && cd build_dir
- $ export EMSCRIPTEN=/Users/name/workspace/Git/Github/emsdk/upstream/emscripten
- $ cmake ../
- $ cmake ../ -DCMAKE_TOOLCHAIN_FILE=cmake/Modules/Platform/Emscripten.cmake -DDRACO_WASM=ON -DDRACO_BACKWARDS_COMPATIBILITY=OFF
- $ make

I also tried without -DDRACO_WASM=ON, but there's no javascript files being generated, to then use the closure compiler (as suggested in BUILDING.md).

What am I missing?

Thank you!

**Edit**:
Just found https://github.com/google/draco/issues/793 but using the relative paths results in the same output. if there are no js files then it must be something with the emscripten installation, correct?
I tried the following, but there's still no js files:
- $ export EMSCRIPTEN=../../emsdk/upstream/emscripten
- $ cmake ../
- $ cmake ../ -DCMAKE_TOOLCHAIN_FILE=../../emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -DDRACO_BACKWARDS_COMPATIBILITY=OFF
- $ make

**Edit 2**:
- just remove the first cmake ../ to make it work (See below)

Remaining questions:
- How to generate the draco_decoder_nodejs.js and draco_encoder_nodejs.js files? I'm guessing with the closure compiler, but not sure how to obtain the mangling one can see in those files within npm/draco3d

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.