Skip to content

Commit 8a979f7

Browse files
committed
Draco v1.4.0
1 parent 894c953 commit 8a979f7

File tree

186 files changed

+6986
-3206
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

186 files changed

+6986
-3206
lines changed

BUILDING.md

+34-44
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ _**Contents**_
77
* [Debugging and Optimization](#debugging-and-optimization)
88
* [Googletest Integration](#googletest-integration)
99
* [Javascript Encoder/Decoder](#javascript-encoderdecoder)
10+
* [WebAssembly Decoder](#webassembly-decoder)
11+
* [WebAssembly Mesh Only Decoder](#webassembly-mesh-only-decoder)
12+
* [WebAssembly Point Cloud Only Decoder](#webassembly-point-cloud-only-decoder)
13+
* [iOS Builds](#ios-builds)
1014
* [Android Studio Project Integration](#android-studio-project-integration)
1115
* [Native Android Builds](#native-android-builds)
1216
* [vcpkg](#vcpkg)
@@ -52,16 +56,16 @@ Windows
5256
-------
5357

5458
On a Windows box you would run the following command to generate Visual Studio
55-
2017 projects:
59+
2019 projects:
5660

5761
~~~~~ bash
58-
C:\Users\nobody> cmake ../ -G "Visual Studio 15 2017"
62+
C:\Users\nobody> cmake ../ -G "Visual Studio 16 2019" -A Win32
5963
~~~~~
6064

61-
To generate 64-bit Windows Visual Studio 2017 projects:
65+
To generate 64-bit Windows Visual Studio 2019 projects:
6266

6367
~~~~~ bash
64-
C:\Users\nobody> cmake ../ -G "Visual Studio 15 2017 Win64"
68+
C:\Users\nobody> cmake ../ -G "Visual Studio 16 2019" -A x64
6569
~~~~~
6670

6771

@@ -85,49 +89,42 @@ $ cmake ../
8589
A makefile using release (optimized) flags is produced like this:
8690

8791
~~~~~ bash
88-
$ cmake ../ -DCMAKE_BUILD_TYPE=release
92+
$ cmake ../ -DCMAKE_BUILD_TYPE=Release
8993
~~~~~
9094

9195
A release build with debug info can be produced as well:
9296

9397
~~~~~ bash
94-
$ cmake ../ -DCMAKE_BUILD_TYPE=relwithdebinfo
98+
$ cmake ../ -DCMAKE_BUILD_TYPE=RelWithDebInfo
9599
~~~~~
96100

97101
And your standard debug build will be produced using:
98102

99103
~~~~~ bash
100-
$ cmake ../ -DCMAKE_BUILD_TYPE=debug
104+
$ cmake ../ -DCMAKE_BUILD_TYPE=Debug
101105
~~~~~
102106

103107
To enable the use of sanitizers when the compiler in use supports them, set the
104108
sanitizer type when running CMake:
105109

106110
~~~~~ bash
107-
$ cmake ../ -DSANITIZE=address
111+
$ cmake ../ -DDRACO_SANITIZE=address
108112
~~~~~
109113

110114
Googletest Integration
111115
----------------------
112116

113117
Draco includes testing support built using Googletest. To enable Googletest unit
114-
test support the ENABLE_TESTS cmake variable must be turned on at cmake
118+
test support the DRACO_TESTS cmake variable must be turned on at cmake
115119
generation time:
116120

117121
~~~~~ bash
118-
$ cmake ../ -DENABLE_TESTS=ON
122+
$ cmake ../ -DDRACO_TESTS=ON
119123
~~~~~
120124

121-
When cmake is used as shown in the above example the Draco cmake file assumes
122-
that the Googletest source directory is a sibling of the Draco repository. To
123-
change the location to something else use the GTEST_SOURCE_DIR cmake variable:
124-
125-
~~~~~ bash
126-
$ cmake ../ -DENABLE_TESTS=ON -DGTEST_SOURCE_DIR=path/to/googletest
127-
~~~~~
128-
129-
To run the tests just execute `draco_tests` from your toolchain's build output
130-
directory.
125+
When cmake is used as shown in the above example the googletest directory must
126+
be a sibling of the Draco repository root directory. To run the tests execute
127+
`draco_tests` from your build output directory.
131128

132129
WebAssembly Decoder
133130
-------------------
@@ -144,7 +141,7 @@ $ export EMSCRIPTEN=/path/to/emscripten/tools/parent
144141

145142
# Emscripten.cmake can be found within your Emscripten installation directory,
146143
# it should be the subdir: cmake/Modules/Platform/Emscripten.cmake
147-
$ cmake ../ -DCMAKE_TOOLCHAIN_FILE=/path/to/Emscripten.cmake -DENABLE_WASM=ON
144+
$ cmake ../ -DCMAKE_TOOLCHAIN_FILE=/path/to/Emscripten.cmake -DDRACO_WASM=ON
148145

149146
# Build the WebAssembly decoder.
150147
$ make
@@ -160,7 +157,7 @@ WebAssembly Mesh Only Decoder
160157
~~~~~ bash
161158

162159
# cmake command line for mesh only WebAssembly decoder.
163-
$ cmake ../ -DCMAKE_TOOLCHAIN_FILE=/path/to/Emscripten.cmake -DENABLE_WASM=ON -DENABLE_POINT_CLOUD_COMPRESSION=OFF
160+
$ cmake ../ -DCMAKE_TOOLCHAIN_FILE=/path/to/Emscripten.cmake -DDRACO_WASM=ON -DDRACO_POINT_CLOUD_COMPRESSION=OFF
164161

165162
~~~~~
166163

@@ -170,7 +167,7 @@ WebAssembly Point Cloud Only Decoder
170167
~~~~~ bash
171168

172169
# cmake command line for point cloud only WebAssembly decoder.
173-
$ cmake ../ -DCMAKE_TOOLCHAIN_FILE=/path/to/Emscripten.cmake -DENABLE_WASM=ON -DENABLE_MESH_COMPRESSION=OFF
170+
$ cmake ../ -DCMAKE_TOOLCHAIN_FILE=/path/to/Emscripten.cmake -DDRACO_WASM=ON -DDRACO_MESH_COMPRESSION=OFF
174171

175172
~~~~~
176173

@@ -199,8 +196,7 @@ $ make
199196

200197
iOS Builds
201198
---------------------
202-
To build Draco for different iOS architectures and simulators for iphone and the simulators
203-
199+
These are the basic commands needed to build Draco for iOS targets.
204200
~~~~~ bash
205201

206202
#arm64
@@ -220,7 +216,8 @@ $ cmake ../ -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/i386-ios.cmake
220216
$ make
221217
~~~~~~
222218

223-
After building the tools they can be merged into fat lib and used in Iphone applications.
219+
After building for each target the libraries can be merged into a single
220+
universal/fat library using lipo, and then used in iOS applications.
224221

225222

226223
Native Android Builds
@@ -230,24 +227,13 @@ It's sometimes useful to build Draco command line tools and run them directly on
230227
Android devices via adb.
231228
232229
~~~~~ bash
233-
# All targets require CMAKE_ANDROID_NDK. It must be set in the environment.
234-
$ export CMAKE_ANDROID_NDK=path/to/ndk
235-
236-
# arm
237-
$ cmake ../ -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/armv7-android-ndk-libcpp.cmake
230+
# This example is for armeabi-v7a.
231+
$ cmake ../ -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/android.cmake \
232+
-DDRACO_ANDROID_NDK_PATH=path/to/ndk -DANDROID_ABI=armeabi-v7a
238233
$ make
239234
240-
# arm64
241-
$ cmake ../ -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/arm64-android-ndk-libcpp.cmake
242-
$ make
243-
244-
# x86
245-
$ cmake ../ -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/x86-android-ndk-libcpp.cmake
246-
$ make
247-
248-
# x86_64
249-
$ cmake ../ -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchains/x86_64-android-ndk-libcpp.cmake
250-
$ make
235+
# See the android.cmake toolchain file for additional ANDROID_ABI options and
236+
# other configurable Android variables.
251237
~~~~~
252238
253239
After building the tools they can be moved to an android device via the use of
@@ -300,12 +286,16 @@ To add Draco to your project:
300286
301287
vcpkg
302288
---------------------
303-
You can download and install Draco using the [vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager:
289+
You can download and install Draco using the
290+
[vcpkg](https://github.com/Microsoft/vcpkg/) dependency manager:
304291
305292
git clone https://github.com/Microsoft/vcpkg.git
306293
cd vcpkg
307294
./bootstrap-vcpkg.sh
308295
./vcpkg integrate install
309296
vcpkg install draco
310297
311-
The Draco port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.
298+
The Draco port in vcpkg is kept up to date by Microsoft team members and
299+
community contributors. If the version is out of date, please
300+
[create an issue or pull request](https://github.com/Microsoft/vcpkg) on the
301+
vcpkg repository.

CMAKE.md

+106
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
# CMake Build System Overview
2+
3+
[TOC]
4+
5+
This document provides a general layout of the Draco CMake build system.
6+
7+
## Core Build System Files
8+
9+
These files are listed in order of interest to maintainers of the build system.
10+
11+
- `CMakeLists.txt` is the main driver of the build system. It's responsible
12+
for defining targets and source lists, surfacing build system options, and
13+
tying the components of the build system together.
14+
15+
- `cmake/draco_build_definitions.cmake` defines the macro
16+
`draco_set_build_definitions()`, which is called from `CMakeLists.txt` to
17+
configure include paths, compiler and linker flags, library settings,
18+
platform speficic configuration, and other build system settings that
19+
depend on optional build configurations.
20+
21+
- `cmake/draco_targets.cmake` defines the macros `draco_add_library()` and
22+
`draco_add_executable()` which are used to create all targets in the CMake
23+
build. These macros attempt to behave in a manner that loosely mirrors the
24+
blaze `cc_library()` and `cc_binary()` commands. Note that
25+
`draco_add_executable()` is also used for tests.
26+
27+
- `cmake/draco_emscripten.cmake` handles Emscripten SDK integration. It
28+
defines several Emscripten specific macros that are required to build the
29+
Emscripten specific targets defined in `CMakeLists.txt`.
30+
31+
- `cmake/draco_flags.cmake` defines macros related to compiler and linker
32+
flags. Testing macros, macros for isolating flags to specific source files,
33+
and the main flag configuration function for the library are defined here.
34+
35+
- `cmake/draco_options.cmake` defines macros that control optional features
36+
of draco, and help track draco library and build system options.
37+
38+
- `cmake/draco_install.cmake` defines the draco install target.
39+
40+
- `cmake/draco_cpu_detection.cmake` determines the optimization types to
41+
enable based on target system processor as reported by CMake.
42+
43+
- `cmake/draco_intrinsics.cmake` manages flags for source files that use
44+
intrinsics. It handles detection of whether flags are necessary, and the
45+
application of the flags to the sources that need them when they are
46+
required.
47+
48+
## Helper and Utility Files
49+
50+
- `.cmake-format.py` Defines coding style for cmake-format.
51+
52+
- `cmake/draco_helpers.cmake` defines utility macros.
53+
54+
- `cmake/draco_sanitizer.cmake` defines the `draco_configure_sanitizer()`
55+
macro, which implements support for `DRACO_SANITIZE`. It handles the
56+
compiler and linker flags necessary for using sanitizers like asan and msan.
57+
58+
- `cmake/draco_variables.cmake` defines macros for tracking and control of
59+
draco build system variables.
60+
61+
## Toolchain Files
62+
63+
These files help facilitate cross compiling of draco for various targets.
64+
65+
- `cmake/toolchains/aarch64-linux-gnu.cmake` provides cross compilation
66+
support for arm64 targets.
67+
68+
- `cmake/toolchains/android.cmake` provides cross compilation support for
69+
Android targets.
70+
71+
- `cmake/toolchains/arm-linux-gnueabihf.cmake` provides cross compilation
72+
support for armv7 targets.
73+
74+
- `cmake/toolchains/arm64-ios.cmake`, `cmake/toolchains/armv7-ios.cmake`,
75+
and `cmake/toolchains/armv7s-ios.cmake` provide support for iOS.
76+
77+
- `cmake/toolchains/arm64-linux-gcc.cmake` and
78+
`cmake/toolchains/armv7-linux-gcc.cmake` are deprecated, but remain for
79+
compatibility. `cmake/toolchains/android.cmake` should be used instead.
80+
81+
- `cmake/toolchains/arm64-android-ndk-libcpp.cmake`,
82+
`cmake/toolchains/armv7-android-ndk-libcpp.cmake`,
83+
`cmake/toolchains/x86-android-ndk-libcpp.cmake`, and
84+
`cmake/toolchains/x86_64-android-ndk-libcpp.cmake` are deprecated, but
85+
remain for compatibility. `cmake/toolchains/android.cmake` should be used
86+
instead.
87+
88+
- `cmake/toolchains/i386-ios.cmake` and `cmake/toolchains/x86_64-ios.cmake`
89+
provide support for the iOS simulator.
90+
91+
- `cmake/toolchains/android-ndk-common.cmake` and
92+
`cmake/toolchains/arm-ios-common.cmake` are support files used by other
93+
toolchain files.
94+
95+
## Template Files
96+
97+
These files are inputs to the CMake build and are used to generate inputs to the
98+
build system output by CMake.
99+
100+
- `cmake/draco-config.cmake.template` is used to produce
101+
draco-config.cmake. draco-config.cmake can be used by CMake to find draco
102+
when another CMake project depends on draco.
103+
104+
- `cmake/draco.pc.template` is used to produce draco's pkg-config file.
105+
Some build systems use pkg-config to configure include and library paths
106+
when they depend upon third party libraries like draco.

0 commit comments

Comments
 (0)