From 94f438f52b517df4d3730e6f5b35db6e6c95ff6d Mon Sep 17 00:00:00 2001 From: Tom Finegan Date: Thu, 17 Feb 2022 11:58:44 -0800 Subject: [PATCH 01/21] WIP: Transcoder build/install test. --- src/draco/tools/install_test/main.cc | 5 +++++ src/draco/tools/install_test/test.py | 14 ++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/draco/tools/install_test/main.cc b/src/draco/tools/install_test/main.cc index cddcdc147..106a33614 100644 --- a/src/draco/tools/install_test/main.cc +++ b/src/draco/tools/install_test/main.cc @@ -26,5 +26,10 @@ int main(int /*argc*/, char** /*argv*/) { std::vector empty_buffer; draco::DecoderBuffer buffer; buffer.Init(empty_buffer.data(), empty_buffer.size()); + +#if DRACO_TRANSCODER_SUPPORTED +#error I LOVE THIS BRITISH SHIT +#endif + return 0; } diff --git a/src/draco/tools/install_test/test.py b/src/draco/tools/install_test/test.py index ad66a1dcf..df9366341 100755 --- a/src/draco/tools/install_test/test.py +++ b/src/draco/tools/install_test/test.py @@ -35,6 +35,9 @@ # List of generators available in the current CMake executable. CMAKE_AVAILABLE_GENERATORS = [] +# List of variable defs to be passed through to CMake via its -D argument. +CMAKE_DEFINES = [] + # CMake builds use the specified generator. CMAKE_GENERATOR = None @@ -183,6 +186,10 @@ def cmake_configure(source_path, cmake_args=None): for arg in cmake_args: command += f' {arg}' + if CMAKE_DEFINES: + for arg in CMAKE_DEFINES: + command += f' -D{arg}' + if VERBOSE: print(f'CONFIGURE command:\n{command}') @@ -301,6 +308,10 @@ def test_draco_install(): parser = argparse.ArgumentParser() parser.add_argument( '-G', '--generator', help='CMake builds use the specified generator.') + parser.add_argument( + '-D', '--cmake_define', + action='append', + help='Passes argument through to CMake as a CMake variable via cmake -D.') parser.add_argument( '-v', '--verbose', @@ -308,6 +319,8 @@ def test_draco_install(): help='Show configuration and build output.') args = parser.parse_args() + if args.cmake_define: + CMAKE_DEFINES=args.cmake_define if args.generator: CMAKE_GENERATOR = args.generator if args.verbose: @@ -315,6 +328,7 @@ def test_draco_install(): if VERBOSE: print(f'CMAKE={CMAKE}') + print(f'CMAKE_DEFINES={CMAKE_DEFINES}') print(f'CMAKE_GENERATOR={CMAKE_GENERATOR}') print(f'CMAKE_AVAILABLE_GENERATORS={CMAKE_AVAILABLE_GENERATORS}') print(f'DRACO_SOURCES_PATH={DRACO_SOURCES_PATH}') From 1c6bc2b6f612b2cad92c364b8ebf91056f3450fb Mon Sep 17 00:00:00 2001 From: Tom Finegan Date: Thu, 24 Feb 2022 17:49:35 -0800 Subject: [PATCH 02/21] Add missing include to sources list to ensure it is installed. --- CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 03624207c..15e7477a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -246,9 +246,11 @@ list(APPEND draco_dec_config_sources list(APPEND draco_compression_decode_sources "${draco_src_root}/compression/decode.cc" - "${draco_src_root}/compression/decode.h") + "${draco_src_root}/compression/decode.h" + "${draco_src_root}/compression/draco_compression_options.h") list(APPEND draco_compression_encode_sources + "${draco_src_root}/compression/draco_compression_options.h" "${draco_src_root}/compression/encode.cc" "${draco_src_root}/compression/encode.h" "${draco_src_root}/compression/encode_base.h" From 619c55210c422699ddaab7ee321b1173afc4e863 Mon Sep 17 00:00:00 2001 From: Tom Finegan Date: Thu, 24 Feb 2022 17:50:45 -0800 Subject: [PATCH 03/21] Update the install check program to use sources that require transcoder support. --- src/draco/tools/install_test/main.cc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/draco/tools/install_test/main.cc b/src/draco/tools/install_test/main.cc index 106a33614..a6037b7c7 100644 --- a/src/draco/tools/install_test/main.cc +++ b/src/draco/tools/install_test/main.cc @@ -18,18 +18,27 @@ // against an installed version of Draco without errors. It does not perform // any sort of library tests. +#include #include #include "draco/core/decoder_buffer.h" -int main(int /*argc*/, char** /*argv*/) { +#if defined DRACO_TRANSCODER_SUPPORTED +#include "draco/scene/scene.h" +#include "draco/scene/scene_utils.h" +#endif + +int main(int /*argc*/, char **/*argv*/) { std::vector empty_buffer; draco::DecoderBuffer buffer; buffer.Init(empty_buffer.data(), empty_buffer.size()); -#if DRACO_TRANSCODER_SUPPORTED -#error I LOVE THIS BRITISH SHIT +#if defined DRACO_TRANSCODER_SUPPORTED + draco::Scene empty_scene; + const int num_meshes = empty_scene.NumMeshes(); + (void)num_meshes; #endif + printf("Partial sanity test passed.\n"); return 0; } From ebc70d2f1c7ee9a2b612778826ca33bd42b65c85 Mon Sep 17 00:00:00 2001 From: Tom Finegan Date: Thu, 24 Feb 2022 17:52:09 -0800 Subject: [PATCH 04/21] Add install testing for transcoder enabled builds. The main addition here is the new function build_and_install_transcoder_dependencies(). It does what its name claims: builds and/or install Draco dependencies for transcoder enabled builds. In addition: - The flag -t/--with_transcoder has been added to allow for optionally enabling the additional testing support. - Verbose mode cleanup: stop double output of command output output. --- src/draco/tools/install_test/test.py | 115 +++++++++++++++++++++++++-- 1 file changed, 108 insertions(+), 7 deletions(-) diff --git a/src/draco/tools/install_test/test.py b/src/draco/tools/install_test/test.py index df9366341..24e77b433 100755 --- a/src/draco/tools/install_test/test.py +++ b/src/draco/tools/install_test/test.py @@ -41,6 +41,10 @@ # CMake builds use the specified generator. CMAKE_GENERATOR = None +# Enable the transcoder before running tests (sets DRACO_TRANSCODER_SUPPORTED +# and builds transcoder support dependencies). +ENABLE_TRANSCODER = False + # The Draco tree that this script uses. DRACO_SOURCES_PATH = os.path.abspath(os.path.join('..', '..', '..', '..')) @@ -139,6 +143,9 @@ def run_process_and_capture_output(cmd, env=None): proc = subprocess.Popen( cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, env=env) + if VERBOSE: + print('COMMAND output:') + stdout = '' for line in iter(proc.stdout.readline, b''): decoded_line = line.decode('utf-8') @@ -198,9 +205,6 @@ def cmake_configure(source_path, cmake_args=None): if result[0] != 0: raise Exception(f'CONFIGURE failed!\nexit_code: {result[0]}\n{result[1]}') - if VERBOSE: - print(f'CONFIGURE result:\nexit_code: {result[0]}\n{result[1]}') - def cmake_build(cmake_args=None, build_args=None): """Runs a CMake build.""" @@ -232,30 +236,118 @@ def cmake_build(cmake_args=None, build_args=None): if result[0] != 0: raise Exception(f'BUILD failed!\nexit_code: {result[0]}\n{result[1]}') - if VERBOSE: - print(f'BUILD result:\nexit_code: {result[0]}\n{result[1]}') - def run_install_check(install_path): """Runs the install_check program.""" cmd = os.path.join(install_path, 'bin', 'install_check') - result = run_process_and_capture_output(cmd) + if VERBOSE: + print(f'RUN command: {cmd}') + result = run_process_and_capture_output(cmd) if result[0] != 0: raise Exception( f'install_check run failed!\nexit_code: {result[0]}\n{result[1]}') +def build_and_install_transcoder_dependencies(): + """Builds and installs Draco dependencies for transcoder enabled builds.""" + orig_dir = os.getcwd() + + # The Eigen CMake build in the release Draco has pinned is, to put it mildly, + # user unfriendly. Instead of wasting time trying to integrate it here, just + # shutil.copytree() everything in $eigen_submodule_path to + # $CMAKE_INSTALL_PREFIX/include/Eigen. + # Eigen claims to be header-only, so this should be adequate for Draco's + # needs here. + eigen_submodule_path = os.path.join( + DRACO_SOURCES_PATH, 'third_party', 'eigen', 'Eigen') + + # "Install" Eigen for the shared install root. + eigen_install_path = os.path.join( + DRACO_SHARED_INSTALL_PATH, 'include', 'Eigen') + shutil.copytree( + src=eigen_submodule_path, dst=eigen_install_path, dirs_exist_ok=True) + + # "Install" Eigen for the static install root. + eigen_install_path = os.path.join( + DRACO_STATIC_INSTALL_PATH, 'include', 'Eigen') + shutil.copytree( + src=eigen_submodule_path, dst=eigen_install_path, dirs_exist_ok=True) + + # Build and install gulrak/filesystem for shared and static configurations. + # Note that this is basically running gulrak/filesystem's CMake build as an + # install script. + fs_submodule_path = os.path.join( + DRACO_SOURCES_PATH, 'third_party', 'filesystem') + + # Install gulrak/filesystem in the shared draco install root. + fs_shared_build = os.path.join(DRACO_SHARED_BUILD_PATH, '_fs') + pathlib.Path(fs_shared_build).mkdir(parents=True, exist_ok=True) + os.chdir(fs_shared_build) + cmake_args = [] + cmake_args.append(f'-DCMAKE_INSTALL_PREFIX={DRACO_SHARED_INSTALL_PATH}') + cmake_args.append('-DBUILD_SHARED_LIBS=ON') + cmake_args.append('-DGHC_FILESYSTEM_BUILD_TESTING=OFF') + cmake_args.append('-DGHC_FILESYSTEM_BUILD_EXAMPLES=OFF') + cmake_configure(source_path=fs_submodule_path, cmake_args=cmake_args) + cmake_build(cmake_args=['--target install']) + + # Install gulrak/filesystem in the shared draco install root. + fs_static_build = os.path.join(DRACO_STATIC_BUILD_PATH, '_fs') + pathlib.Path(fs_static_build).mkdir(parents=True, exist_ok=True) + os.chdir(fs_static_build) + cmake_args = [] + cmake_args.append(f'-DCMAKE_INSTALL_PREFIX={DRACO_SHARED_INSTALL_PATH}') + cmake_args.append('-DBUILD_SHARED_LIBS=OFF') + cmake_args.append('-DGHC_FILESYSTEM_BUILD_TESTING=OFF') + cmake_args.append('-DGHC_FILESYSTEM_BUILD_EXAMPLES=OFF') + cmake_configure(source_path=fs_submodule_path, cmake_args=cmake_args) + cmake_build(cmake_args=['--target install']) + + # Build and install TinyGLTF for shared and static configurations. + # Note, as above, that this is basically running TinyGLTF's CMake build as an + # install script. + tinygltf_submodule_path = os.path.join( + DRACO_SOURCES_PATH, 'third_party', 'tinygltf') + + # Install TinyGLTF in the shared draco install root. + tinygltf_shared_build = os.path.join(DRACO_SHARED_BUILD_PATH, '_TinyGLTF') + pathlib.Path(tinygltf_shared_build).mkdir(parents=True, exist_ok=True) + os.chdir(tinygltf_shared_build) + cmake_args = [] + cmake_args.append(f'-DCMAKE_INSTALL_PREFIX={DRACO_SHARED_INSTALL_PATH}') + cmake_args.append('-DTINYGLTF_BUILD_EXAMPLES=OFF') + cmake_configure(source_path=tinygltf_submodule_path, cmake_args=cmake_args) + cmake_build(cmake_args=['--target install']) + + # Install TinyGLTF in the static draco install root. + tinygltf_static_build = os.path.join(DRACO_STATIC_BUILD_PATH, '_TinyGLTF') + pathlib.Path(tinygltf_static_build).mkdir(parents=True, exist_ok=True) + os.chdir(tinygltf_static_build) + cmake_args = [] + cmake_args.append(f'-DCMAKE_INSTALL_PREFIX={DRACO_STATIC_INSTALL_PATH}') + cmake_args.append('-DTINYGLTF_BUILD_EXAMPLES=OFF') + cmake_configure(source_path=tinygltf_submodule_path, cmake_args=cmake_args) + cmake_build(cmake_args=['--target install']) + + os.chdir(orig_dir) + + def build_and_install_draco(): """Builds Draco in shared and static configurations.""" orig_dir = os.getcwd() + if ENABLE_TRANSCODER: + build_and_install_transcoder_dependencies() + # Build and install Draco in shared library config for the current host # machine. os.chdir(DRACO_SHARED_BUILD_PATH) cmake_args = [] cmake_args.append(f'-DCMAKE_INSTALL_PREFIX={DRACO_SHARED_INSTALL_PATH}') cmake_args.append('-DBUILD_SHARED_LIBS=ON') + if ENABLE_TRANSCODER: + cmake_args.append('-DDRACO_TRANSCODER_SUPPORTED=ON') cmake_configure(source_path=DRACO_SOURCES_PATH, cmake_args=cmake_args) cmake_build(cmake_args=['--target install']) @@ -264,6 +356,8 @@ def build_and_install_draco(): cmake_args = [] cmake_args.append(f'-DCMAKE_INSTALL_PREFIX={DRACO_STATIC_INSTALL_PATH}') cmake_args.append('-DBUILD_SHARED_LIBS=OFF') + if ENABLE_TRANSCODER: + cmake_args.append('-DDRACO_TRANSCODER_SUPPORTED=ON') cmake_configure(source_path=DRACO_SOURCES_PATH, cmake_args=cmake_args) cmake_build(cmake_args=['--target install']) @@ -312,6 +406,10 @@ def test_draco_install(): '-D', '--cmake_define', action='append', help='Passes argument through to CMake as a CMake variable via cmake -D.') + parser.add_argument( + '-t', '--with_transcoder', + action='store_true', + help='Run tests with Draco transcoder support enabled.') parser.add_argument( '-v', '--verbose', @@ -325,12 +423,15 @@ def test_draco_install(): CMAKE_GENERATOR = args.generator if args.verbose: VERBOSE = True + if args.with_transcoder: + ENABLE_TRANSCODER = True if VERBOSE: print(f'CMAKE={CMAKE}') print(f'CMAKE_DEFINES={CMAKE_DEFINES}') print(f'CMAKE_GENERATOR={CMAKE_GENERATOR}') print(f'CMAKE_AVAILABLE_GENERATORS={CMAKE_AVAILABLE_GENERATORS}') + print(f'ENABLE_TRANSCODER={ENABLE_TRANSCODER}') print(f'DRACO_SOURCES_PATH={DRACO_SOURCES_PATH}') print(f'DRACO_SHARED_BUILD_PATH={DRACO_SHARED_BUILD_PATH}') print(f'DRACO_STATIC_BUILD_PATH={DRACO_STATIC_BUILD_PATH}') From 07c5a1d753027b6cb01aee151c8846f473dca553 Mon Sep 17 00:00:00 2001 From: Tom Finegan Date: Thu, 24 Feb 2022 18:21:04 -0800 Subject: [PATCH 05/21] Add transcoder enabled tests to ci.yml. --- .github/workflows/ci.yml | 124 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 124 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 33af1f185..8f72a33da 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,6 +28,16 @@ jobs: -DDRACO_TESTS=ON cmake_build_command: cmake --build . -- -j2 draco_test_command: ./draco_tests + - test_name: macos-make-release-shared-with-transcoder + os: macos-latest + cmake_configure_command: |- + cmake .. -G "Unix Makefiles" \ + -DBUILD_SHARED_LIBS=ON \ + -DCMAKE_BUILD_TYPE=Release \ + -DDRACO_TESTS=ON \ + -DDRACO_TRANSCODER_SUPPORTED=ON + cmake_build_command: cmake --build . -- -j2 + draco_test_command: ./draco_tests - test_name: macos-make-release-static os: macos-latest @@ -38,6 +48,16 @@ jobs: -DDRACO_TESTS=ON cmake_build_command: cmake --build . -- -j2 draco_test_command: ./draco_tests + - test_name: macos-make-release-static-with-transcoder + os: macos-latest + cmake_configure_command: |- + cmake .. -G "Unix Makefiles" \ + -DBUILD_SHARED_LIBS=OFF \ + -DCMAKE_BUILD_TYPE=Release \ + -DDRACO_TESTS=ON \ + -DDRACO_TRANSCODER_SUPPORTED=ON + cmake_build_command: cmake --build . -- -j2 + draco_test_command: ./draco_tests - test_name: macos-xcode-release-shared os: macos-latest @@ -48,6 +68,16 @@ jobs: -DDRACO_TESTS=ON cmake_build_command: cmake --build . --config Release draco_test_command: Release/draco_tests + - test_name: macos-xcode-release-shared-with-transcoder + os: macos-latest + cmake_configure_command: |- + cmake .. -G Xcode \ + -DBUILD_SHARED_LIBS=ON \ + -DCMAKE_CONFIGURATION_TYPES=Release \ + -DDRACO_TESTS=ON \ + -DDRACO_TRANSCODER_SUPPORTED=ON + cmake_build_command: cmake --build . --config Release + draco_test_command: Release/draco_tests - test_name: macos-xcode-release-static os: macos-latest @@ -58,6 +88,16 @@ jobs: -DDRACO_TESTS=ON cmake_build_command: cmake --build . --config Release draco_test_command: Release/draco_tests + - test_name: macos-xcode-release-static-with-transcoder + os: macos-latest + cmake_configure_command: |- + cmake .. -G Xcode \ + -DBUILD_SHARED_LIBS=OFF \ + -DCMAKE_CONFIGURATION_TYPES=Release \ + -DDRACO_TESTS=ON \ + -DDRACO_TRANSCODER_SUPPORTED=ON + cmake_build_command: cmake --build . --config Release + draco_test_command: Release/draco_tests - test_name: ubuntu-make-release-shared os: ubuntu-latest @@ -70,6 +110,18 @@ jobs: -DDRACO_TESTS=ON cmake_build_command: cmake --build . -- -j2 draco_test_command: ./draco_tests + - test_name: ubuntu-make-release-shared-with-transcoder + os: ubuntu-latest + cmake_configure_command: |- + cmake .. -G "Unix Makefiles" \ + -DBUILD_SHARED_LIBS=ON \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_COMPILER=gcc-10 \ + -DCMAKE_CXX_COMPILER=g++-10 \ + -DDRACO_TESTS=ON \ + -DDRACO_TRANSCODER_SUPPORTED=ON + cmake_build_command: cmake --build . -- -j2 + draco_test_command: ./draco_tests - test_name: ubuntu-make-release-static os: ubuntu-latest @@ -82,6 +134,18 @@ jobs: -DDRACO_TESTS=ON cmake_build_command: cmake --build . -- -j2 draco_test_command: ./draco_tests + - test_name: ubuntu-make-release-static-with-transcoder + os: ubuntu-latest + cmake_configure_command: |- + cmake .. -G "Unix Makefiles" \ + -DBUILD_SHARED_LIBS=OFF \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_COMPILER=gcc-10 \ + -DCMAKE_CXX_COMPILER=g++-10 \ + -DDRACO_TESTS=ON \ + -DDRACO_TRANSCODER_SUPPORTED=ON + cmake_build_command: cmake --build . -- -j2 + draco_test_command: ./draco_tests - test_name: windows-msvc-release-shared os: windows-2019 @@ -92,6 +156,17 @@ jobs: -DDRACO_TESTS=ON cmake_build_command: cmake --build . --config Release -- -m:2 draco_test_command: Release/draco_tests + - test_name: windows-msvc-release-shared-with-transcoder + os: windows-2019 + cmake_configure_command: |- + cmake .. -G "Visual Studio 16 2019" \ + -DBUILD_SHARED_LIBS=ON \ + -DCMAKE_CONFIGURATION_TYPES=Release \ + -DDRACO_TESTS=ON \ + -DDRACO_TRANSCODER_SUPPORTED=ON + cmake_build_command: cmake --build . --config Release -- -m:2 + draco_test_command: Release/draco_tests + - test_name: windows-msvc-release-static os: windows-2019 @@ -102,6 +177,16 @@ jobs: -DDRACO_TESTS=ON cmake_build_command: cmake --build . --config Release -- -m:2 draco_test_command: Release/draco_tests + - test_name: windows-msvc-release-static-with-transcoder + os: windows-2019 + cmake_configure_command: |- + cmake .. -G "Visual Studio 16 2019" \ + -DBUILD_SHARED_LIBS=OFF \ + -DCMAKE_CONFIGURATION_TYPES=Release \ + -DDRACO_TESTS=ON \ + -DDRACO_TRANSCODER_SUPPORTED=ON + cmake_build_command: cmake --build . --config Release -- -m:2 + draco_test_command: Release/draco_tests - test_name: windows-make-release-shared os: windows-2019 @@ -114,6 +199,18 @@ jobs: -DDRACO_TESTS=ON cmake_build_command: cmake --build . -- -j2 draco_test_command: ./draco_tests + - test_name: windows-make-release-shared-with-transcoder + os: windows-2019 + cmake_configure_command: |- + cmake .. -G "MinGW Makefiles" \ + -DBUILD_SHARED_LIBS=ON \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc \ + -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ \ + -DDRACO_TESTS=ON \ + -DDRACO_TRANSCODER_SUPPORTED=ON + cmake_build_command: cmake --build . -- -j2 + draco_test_command: ./draco_tests - test_name: windows-make-release-static os: windows-2019 @@ -126,6 +223,18 @@ jobs: -DDRACO_TESTS=ON cmake_build_command: cmake --build . -- -j2 draco_test_command: ./draco_tests + - test_name: windows-make-release-static-with-transcoder + os: windows-2019 + cmake_configure_command: |- + cmake .. -G "MinGW Makefiles" \ + -DBUILD_SHARED_LIBS=OFF \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc \ + -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ \ + -DDRACO_TESTS=ON \ + -DDRACO_TRANSCODER_SUPPORTED=ON + cmake_build_command: cmake --build . -- -j2 + draco_test_command: ./draco_tests name: test-${{ matrix.test_name }} runs-on: ${{ matrix.os }} @@ -163,22 +272,37 @@ jobs: - test_name: ubuntu-make os: ubuntu-latest test_command: python3 test.py -v -G "Unix Makefiles" + - test_name: ubuntu-make-with-transcoder + os: ubuntu-latest + test_command: python3 test.py -v -t -G "Unix Makefiles" - test_name: macos-make os: macos-latest test_command: python3 test.py -v -G "Unix Makefiles" + - test_name: macos-make-with-transcoder + os: macos-latest + test_command: python3 test.py -v -t -G "Unix Makefiles" - test_name: macos-xcode os: macos-latest test_command: python3 test.py -v -G Xcode + - test_name: macos-xcode-with-transcoder + os: macos-latest + test_command: python3 test.py -v -t -G Xcode - test_name: windows-make os: windows-2019 test_command: python3 test.py -v -G "MinGW Makefiles" + - test_name: windows-make-with-transcoder + os: windows-2019 + test_command: python3 test.py -v -t -G "MinGW Makefiles" - test_name: windows-msvc os: windows-2019 test_command: python3 test.py -v -G "Visual Studio 16 2019" + - test_name: windows-msvc-with-transcoder + os: windows-2019 + test_command: python3 test.py -v -t -G "Visual Studio 16 2019" name: install-test-${{ matrix.test_name }} runs-on: ${{ matrix.os }} From 610dd88293b9d7855d531cd43c16ff9695dea9b5 Mon Sep 17 00:00:00 2001 From: Tom Finegan Date: Thu, 24 Feb 2022 18:31:55 -0800 Subject: [PATCH 06/21] Add version check before blind usage of dirs_exist_ok with shutil.copytree. --- src/draco/tools/install_test/test.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/draco/tools/install_test/test.py b/src/draco/tools/install_test/test.py index 24e77b433..5693c0482 100755 --- a/src/draco/tools/install_test/test.py +++ b/src/draco/tools/install_test/test.py @@ -265,14 +265,21 @@ def build_and_install_transcoder_dependencies(): # "Install" Eigen for the shared install root. eigen_install_path = os.path.join( DRACO_SHARED_INSTALL_PATH, 'include', 'Eigen') - shutil.copytree( - src=eigen_submodule_path, dst=eigen_install_path, dirs_exist_ok=True) + if sys.version_info >= (3, 8): + shutil.copytree( + src=eigen_submodule_path, dst=eigen_install_path, dirs_exist_ok=True) + else: + shutil.copytree(src=eigen_submodule_path, dst=eigen_install_path) # "Install" Eigen for the static install root. eigen_install_path = os.path.join( DRACO_STATIC_INSTALL_PATH, 'include', 'Eigen') - shutil.copytree( - src=eigen_submodule_path, dst=eigen_install_path, dirs_exist_ok=True) + if sys.version_info >= (3, 8): + shutil.copytree( + src=eigen_submodule_path, dst=eigen_install_path, dirs_exist_ok=True) + else: + shutil.copytree(src=eigen_submodule_path, dst=eigen_install_path) + # Build and install gulrak/filesystem for shared and static configurations. # Note that this is basically running gulrak/filesystem's CMake build as an From a774e8081f12b319462c5a25061534d30786c4d2 Mon Sep 17 00:00:00 2001 From: Tom Finegan Date: Thu, 24 Feb 2022 18:47:01 -0800 Subject: [PATCH 07/21] Fix compile for light.cc on Windows. --- src/draco/scene/light.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/draco/scene/light.cc b/src/draco/scene/light.cc index a7094cf0e..36d0d7b49 100644 --- a/src/draco/scene/light.cc +++ b/src/draco/scene/light.cc @@ -16,6 +16,11 @@ #ifdef DRACO_TRANSCODER_SUPPORTED +#ifdef _WIN32 +// M_PI is non-standard: enable use on windows. +#define _USE_MATH_DEFINES +#endif + #include #include From e79029243a9e3878ed4fcbd337a7a071722766a0 Mon Sep 17 00:00:00 2001 From: Tom Finegan Date: Thu, 24 Feb 2022 19:01:13 -0800 Subject: [PATCH 08/21] Move _USE_MATH_DEFINES to light.h: vector_d.h includes it as well, so it must be defined here. --- src/draco/scene/light.cc | 5 ----- src/draco/scene/light.h | 6 ++++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/draco/scene/light.cc b/src/draco/scene/light.cc index 36d0d7b49..a7094cf0e 100644 --- a/src/draco/scene/light.cc +++ b/src/draco/scene/light.cc @@ -16,11 +16,6 @@ #ifdef DRACO_TRANSCODER_SUPPORTED -#ifdef _WIN32 -// M_PI is non-standard: enable use on windows. -#define _USE_MATH_DEFINES -#endif - #include #include diff --git a/src/draco/scene/light.h b/src/draco/scene/light.h index 5ff0d4a6b..c032f830f 100644 --- a/src/draco/scene/light.h +++ b/src/draco/scene/light.h @@ -20,6 +20,12 @@ #ifdef DRACO_TRANSCODER_SUPPORTED #include +#ifdef _WIN32 +// M_PI is non-standard: enable use on windows. +// Note: Defined here because vector_d.h also includes . +#define _USE_MATH_DEFINES +#endif + #include "draco/core/vector_d.h" namespace draco { From 59d387909a3fa94d707d0aae252319f3a3ec24a9 Mon Sep 17 00:00:00 2001 From: Tom Finegan Date: Thu, 24 Feb 2022 19:22:39 -0800 Subject: [PATCH 09/21] cmath -> math.h, and _USE_MATH_DEFINES back to light.cc because MSVC is special. --- src/draco/scene/light.cc | 8 +++++++- src/draco/scene/light.h | 6 ------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/draco/scene/light.cc b/src/draco/scene/light.cc index a7094cf0e..39cf06f78 100644 --- a/src/draco/scene/light.cc +++ b/src/draco/scene/light.cc @@ -16,7 +16,13 @@ #ifdef DRACO_TRANSCODER_SUPPORTED -#include +#ifdef _WIN32 +// M_PI is non-standard: enable use on windows. +#define _USE_MATH_DEFINES +#endif + +#include + #include namespace draco { diff --git a/src/draco/scene/light.h b/src/draco/scene/light.h index c032f830f..5ff0d4a6b 100644 --- a/src/draco/scene/light.h +++ b/src/draco/scene/light.h @@ -20,12 +20,6 @@ #ifdef DRACO_TRANSCODER_SUPPORTED #include -#ifdef _WIN32 -// M_PI is non-standard: enable use on windows. -// Note: Defined here because vector_d.h also includes . -#define _USE_MATH_DEFINES -#endif - #include "draco/core/vector_d.h" namespace draco { From 730e7f63b596bcaff04a4e9a80c2381107de6793 Mon Sep 17 00:00:00 2001 From: Tom Finegan Date: Thu, 24 Feb 2022 19:43:11 -0800 Subject: [PATCH 10/21] Add _USE_MATH_DEFINES to gltf_decoder_test and light_test. --- src/draco/io/gltf_decoder_test.cc | 8 +++++++- src/draco/scene/light_test.cc | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/draco/io/gltf_decoder_test.cc b/src/draco/io/gltf_decoder_test.cc index 58e3303cc..3d7af5490 100644 --- a/src/draco/io/gltf_decoder_test.cc +++ b/src/draco/io/gltf_decoder_test.cc @@ -14,7 +14,13 @@ // #include "draco/io/gltf_decoder.h" -#include +#ifdef _WIN32 +// M_PI is non-standard: enable use on windows. +#define _USE_MATH_DEFINES +#endif + +#include + #include #include #include diff --git a/src/draco/scene/light_test.cc b/src/draco/scene/light_test.cc index 12d51f65f..d97ba82b2 100644 --- a/src/draco/scene/light_test.cc +++ b/src/draco/scene/light_test.cc @@ -14,7 +14,13 @@ // #include "draco/scene/light.h" -#include +#ifdef _WIN32 +// M_PI is non-standard: enable use on windows. +#define _USE_MATH_DEFINES +#endif + +#include + #include #include "draco/core/draco_test_base.h" From cb1ca9ede80a90ba98b558946984307695f3c143 Mon Sep 17 00:00:00 2001 From: Tom Finegan Date: Thu, 24 Feb 2022 20:32:15 -0800 Subject: [PATCH 11/21] Drop /Ox from the MSVC build. --- cmake/draco_build_definitions.cmake | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cmake/draco_build_definitions.cmake b/cmake/draco_build_definitions.cmake index 6c972dfa1..a50c7cc87 100644 --- a/cmake/draco_build_definitions.cmake +++ b/cmake/draco_build_definitions.cmake @@ -43,7 +43,8 @@ macro(draco_set_build_definitions) if(build_type_lowercase MATCHES "rel" AND DRACO_FAST) if(MSVC) - list(APPEND draco_msvc_cxx_flags "/Ox") + message("USING DEFAULT MSVC OPT LEVEL.") + #list(APPEND draco_msvc_cxx_flags "/Ox") else() list(APPEND draco_base_cxx_flags "-O3") endif() From 84164c2a2319a77bdc7fc525221bffb55114beb5 Mon Sep 17 00:00:00 2001 From: Tom Finegan Date: Thu, 24 Feb 2022 23:33:40 -0800 Subject: [PATCH 12/21] Revert change to opt level. --- cmake/draco_build_definitions.cmake | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/cmake/draco_build_definitions.cmake b/cmake/draco_build_definitions.cmake index a50c7cc87..6c972dfa1 100644 --- a/cmake/draco_build_definitions.cmake +++ b/cmake/draco_build_definitions.cmake @@ -43,8 +43,7 @@ macro(draco_set_build_definitions) if(build_type_lowercase MATCHES "rel" AND DRACO_FAST) if(MSVC) - message("USING DEFAULT MSVC OPT LEVEL.") - #list(APPEND draco_msvc_cxx_flags "/Ox") + list(APPEND draco_msvc_cxx_flags "/Ox") else() list(APPEND draco_base_cxx_flags "-O3") endif() From 44b396171103648236332aed3c57227bda662e43 Mon Sep 17 00:00:00 2001 From: Tom Finegan Date: Fri, 25 Feb 2022 00:42:32 -0800 Subject: [PATCH 13/21] Disable the transcoder-enabled tests for Windows. --- .github/workflows/ci.yml | 44 ++++++++++++++++++++++------------------ 1 file changed, 24 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8f72a33da..f2c0f446e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -156,16 +156,18 @@ jobs: -DDRACO_TESTS=ON cmake_build_command: cmake --build . --config Release -- -m:2 draco_test_command: Release/draco_tests - - test_name: windows-msvc-release-shared-with-transcoder - os: windows-2019 - cmake_configure_command: |- - cmake .. -G "Visual Studio 16 2019" \ - -DBUILD_SHARED_LIBS=ON \ - -DCMAKE_CONFIGURATION_TYPES=Release \ - -DDRACO_TESTS=ON \ - -DDRACO_TRANSCODER_SUPPORTED=ON - cmake_build_command: cmake --build . --config Release -- -m:2 - draco_test_command: Release/draco_tests + # Temporarily disabled: We have some work to do on the Windows + # transcoder-enabled builds. + #- test_name: windows-msvc-release-shared-with-transcoder + # os: windows-2019 + # cmake_configure_command: |- + # cmake .. -G "Visual Studio 16 2019" \ + # -DBUILD_SHARED_LIBS=ON \ + # -DCMAKE_CONFIGURATION_TYPES=Release \ + # -DDRACO_TESTS=ON \ + # -DDRACO_TRANSCODER_SUPPORTED=ON + # cmake_build_command: cmake --build . --config Release -- -m:2 + # draco_test_command: Release/draco_tests - test_name: windows-msvc-release-static @@ -177,16 +179,18 @@ jobs: -DDRACO_TESTS=ON cmake_build_command: cmake --build . --config Release -- -m:2 draco_test_command: Release/draco_tests - - test_name: windows-msvc-release-static-with-transcoder - os: windows-2019 - cmake_configure_command: |- - cmake .. -G "Visual Studio 16 2019" \ - -DBUILD_SHARED_LIBS=OFF \ - -DCMAKE_CONFIGURATION_TYPES=Release \ - -DDRACO_TESTS=ON \ - -DDRACO_TRANSCODER_SUPPORTED=ON - cmake_build_command: cmake --build . --config Release -- -m:2 - draco_test_command: Release/draco_tests + # Temporarily disabled: We have some work to do on the Windows + # transcoder-enabled builds. + #- test_name: windows-msvc-release-static-with-transcoder + # os: windows-2019 + # cmake_configure_command: |- + # cmake .. -G "Visual Studio 16 2019" \ + # -DBUILD_SHARED_LIBS=OFF \ + # -DCMAKE_CONFIGURATION_TYPES=Release \ + # -DDRACO_TESTS=ON \ + # -DDRACO_TRANSCODER_SUPPORTED=ON + # cmake_build_command: cmake --build . --config Release -- -m:2 + # draco_test_command: Release/draco_tests - test_name: windows-make-release-shared os: windows-2019 From f04eecca5d4fc0dad55b924bdcbb4143687b3e61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Blissing?= Date: Sat, 26 Feb 2022 05:46:51 +0100 Subject: [PATCH 14/21] Avoid comparing bool using the < and > operator (#817) There is no need to perform the check if T is of type bool, since it is guaranteed to fit in all other integral types. This avoids triggering a C4804 warning in Visual Studio, ie. `unsafe use of type 'bool' in operation` --- src/draco/attributes/geometry_attribute.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/draco/attributes/geometry_attribute.h b/src/draco/attributes/geometry_attribute.h index fd478a425..5d4a22fb4 100644 --- a/src/draco/attributes/geometry_attribute.h +++ b/src/draco/attributes/geometry_attribute.h @@ -284,7 +284,8 @@ class GeometryAttribute { // Make sure the in_value fits within the range of values that OutT // is able to represent. Perform the check only for integral types. - if (std::is_integral::value && std::is_integral::value) { + if (!std::is_same::value && std::is_integral::value && + std::is_integral::value) { static constexpr OutT kOutMin = std::is_signed::value ? std::numeric_limits::lowest() : 0; if (in_value < kOutMin || in_value > std::numeric_limits::max()) { From bc4177b230bc4c92816517eb6e80fa084b20927d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 28 Feb 2022 09:59:05 -0800 Subject: [PATCH 15/21] Bump nokogiri from 1.13.1 to 1.13.3 in /docs (#822) Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.13.1 to 1.13.3. - [Release notes](https://github.com/sparklemotion/nokogiri/releases) - [Changelog](https://github.com/sparklemotion/nokogiri/blob/main/CHANGELOG.md) - [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.13.1...v1.13.3) --- updated-dependencies: - dependency-name: nokogiri dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- docs/Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/Gemfile.lock b/docs/Gemfile.lock index 3ecf1d2ee..6bb404d16 100644 --- a/docs/Gemfile.lock +++ b/docs/Gemfile.lock @@ -215,15 +215,15 @@ GEM rb-inotify (~> 0.9, >= 0.9.7) ruby_dep (~> 1.2) mercenary (0.3.6) - mini_portile2 (2.7.1) + mini_portile2 (2.8.0) minima (2.5.0) jekyll (~> 3.5) jekyll-feed (~> 0.9) jekyll-seo-tag (~> 2.1) minitest (5.11.3) multipart-post (2.1.1) - nokogiri (1.13.1) - mini_portile2 (~> 2.7.0) + nokogiri (1.13.3) + mini_portile2 (~> 2.8.0) racc (~> 1.4) octokit (4.21.0) faraday (>= 0.9) From 5c98634657327458da4bfc65829f10de3f0e1111 Mon Sep 17 00:00:00 2001 From: Tom Finegan Date: Tue, 1 Mar 2022 22:48:23 -0800 Subject: [PATCH 16/21] Sync internal fixes for transcoder CI coverage blockers. - Use a local dupe of a constant to avoid DLL linkage issues on Windows in the GLTF encoder test.. - Define DRACO_PI to avoid M_PI and entertaining include ordering issues related to _USE_MATH_DEFINES and interactions between and on Windows (fun include guards and order related things). --- CMakeLists.txt | 1 + src/draco/io/gltf_decoder_test.cc | 13 ++++--------- src/draco/io/gltf_encoder_test.cc | 7 +++++-- src/draco/scene/light.cc | 11 +++-------- src/draco/scene/light_test.cc | 18 ++++++------------ 5 files changed, 19 insertions(+), 31 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 15e7477a3..e5519013f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -339,6 +339,7 @@ list(APPEND draco_core_sources "${draco_src_root}/core/bit_utils.h" "${draco_src_root}/core/bounding_box.cc" "${draco_src_root}/core/bounding_box.h" + "${draco_src_root}/core/constants.h" "${draco_src_root}/core/cycle_timer.cc" "${draco_src_root}/core/cycle_timer.h" "${draco_src_root}/core/data_buffer.cc" diff --git a/src/draco/io/gltf_decoder_test.cc b/src/draco/io/gltf_decoder_test.cc index 3d7af5490..0e5a07468 100644 --- a/src/draco/io/gltf_decoder_test.cc +++ b/src/draco/io/gltf_decoder_test.cc @@ -14,13 +14,7 @@ // #include "draco/io/gltf_decoder.h" -#ifdef _WIN32 -// M_PI is non-standard: enable use on windows. -#define _USE_MATH_DEFINES -#endif - -#include - +#include #include #include #include @@ -28,6 +22,7 @@ #include #ifdef DRACO_TRANSCODER_SUPPORTED +#include "draco/core/constants.h" #include "draco/core/draco_test_base.h" #include "draco/core/draco_test_utils.h" #include "draco/core/draco_types.h" @@ -1162,7 +1157,7 @@ TEST(GltfDecoderTest, DecodeLightsIntoScene) { ASSERT_EQ(light.GetType(), draco::Light::POINT); ASSERT_EQ(light.GetRange(), 1000); ASSERT_EQ(light.GetInnerConeAngle(), 0.0); - ASSERT_NEAR(light.GetOuterConeAngle(), M_PI / 4.0f, 1e-8); + ASSERT_NEAR(light.GetOuterConeAngle(), DRACO_PI / 4.0f, 1e-8); // Check directional light with some properties specified. light = *scene->GetLight(LightIndex(2)); @@ -1180,7 +1175,7 @@ TEST(GltfDecoderTest, DecodeLightsIntoScene) { ASSERT_EQ(light.GetType(), draco::Light::SPOT); ASSERT_EQ(light.GetRange(), std::numeric_limits::max()); ASSERT_EQ(light.GetInnerConeAngle(), 0.0); - ASSERT_NEAR(light.GetOuterConeAngle(), M_PI / 4.0f, 1e-8); + ASSERT_NEAR(light.GetOuterConeAngle(), DRACO_PI / 4.0f, 1e-8); // Check that lights are referenced by the scene nodes. ASSERT_EQ(scene->GetNode(SceneNodeIndex(0))->GetLightIndex(), diff --git a/src/draco/io/gltf_encoder_test.cc b/src/draco/io/gltf_encoder_test.cc index cbdb286bf..99cd64dd7 100644 --- a/src/draco/io/gltf_encoder_test.cc +++ b/src/draco/io/gltf_encoder_test.cc @@ -16,7 +16,9 @@ #ifdef DRACO_TRANSCODER_SUPPORTED #include +#include #include +#include #include "draco/core/draco_test_base.h" #include "draco/core/draco_test_utils.h" @@ -411,8 +413,9 @@ TEST_F(GltfEncoderTest, EncodeNamedGenericAttribute) { // Set metadata for first attribute so it gets written out by glTF encoder. std::unique_ptr am(new draco::AttributeMetadata()); constexpr char kAttributeName[] = "MyAttributeName"; - am->AddEntryString(GltfEncoder::kDracoMetadataGltfAttributeName, - kAttributeName); + constexpr char kDracoMetadataGltfAttributeName[] = + "//GLTF/ApplicationSpecificAttributeName"; + am->AddEntryString(kDracoMetadataGltfAttributeName, kAttributeName); mesh->AddAttributeMetadata(new_att_id_0, std::move(am)); // Make sure the GLTF contains a reference to the named attribute. diff --git a/src/draco/scene/light.cc b/src/draco/scene/light.cc index 39cf06f78..1fef98c0c 100644 --- a/src/draco/scene/light.cc +++ b/src/draco/scene/light.cc @@ -16,15 +16,10 @@ #ifdef DRACO_TRANSCODER_SUPPORTED -#ifdef _WIN32 -// M_PI is non-standard: enable use on windows. -#define _USE_MATH_DEFINES -#endif - -#include - #include +#include "draco/core/constants.h" + namespace draco { Light::Light() @@ -33,7 +28,7 @@ Light::Light() type_(POINT), range_(std::numeric_limits::max()), // Infinity. inner_cone_angle_(0.0), - outer_cone_angle_(M_PI / 4.0) {} + outer_cone_angle_(DRACO_PI / 4.0) {} void Light::Copy(const Light &light) { name_ = light.name_; diff --git a/src/draco/scene/light_test.cc b/src/draco/scene/light_test.cc index d97ba82b2..bc24a14ad 100644 --- a/src/draco/scene/light_test.cc +++ b/src/draco/scene/light_test.cc @@ -14,15 +14,9 @@ // #include "draco/scene/light.h" -#ifdef _WIN32 -// M_PI is non-standard: enable use on windows. -#define _USE_MATH_DEFINES -#endif - -#include - #include +#include "draco/core/constants.h" #include "draco/core/draco_test_base.h" #include "draco/core/draco_test_utils.h" @@ -39,7 +33,7 @@ TEST(LightTest, TestDefaults) { ASSERT_EQ(light.GetType(), draco::Light::POINT); ASSERT_EQ(light.GetRange(), std::numeric_limits::max()); ASSERT_EQ(light.GetInnerConeAngle(), 0.0); - ASSERT_EQ(light.GetOuterConeAngle(), M_PI / 4.0); + ASSERT_EQ(light.GetOuterConeAngle(), DRACO_PI / 4.0); } TEST(LightTest, TestCopy) { @@ -50,8 +44,8 @@ TEST(LightTest, TestCopy) { light.SetIntensity(5.0); light.SetType(draco::Light::SPOT); light.SetRange(1000.0); - light.SetInnerConeAngle(M_PI / 8.0); - light.SetOuterConeAngle(M_PI / 2.0); + light.SetInnerConeAngle(DRACO_PI / 8.0); + light.SetOuterConeAngle(DRACO_PI / 2.0); // Create a copy of the initialized light and check all properties. draco::Light copy; @@ -61,8 +55,8 @@ TEST(LightTest, TestCopy) { ASSERT_EQ(copy.GetIntensity(), 5.0); ASSERT_EQ(copy.GetType(), draco::Light::SPOT); ASSERT_EQ(copy.GetRange(), 1000.0); - ASSERT_EQ(copy.GetInnerConeAngle(), M_PI / 8.0); - ASSERT_EQ(copy.GetOuterConeAngle(), M_PI / 2.0); + ASSERT_EQ(copy.GetInnerConeAngle(), DRACO_PI / 8.0); + ASSERT_EQ(copy.GetOuterConeAngle(), DRACO_PI / 2.0); } #endif // DRACO_TRANSCODER_SUPPORTED From e94a7747153449a175b66a26f8bff80fc02a64a5 Mon Sep 17 00:00:00 2001 From: Tom Finegan Date: Tue, 1 Mar 2022 22:51:22 -0800 Subject: [PATCH 17/21] Style tidying. --- src/draco/tools/install_test/main.cc | 2 +- src/draco/tools/install_test/test.py | 15 +++------------ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/src/draco/tools/install_test/main.cc b/src/draco/tools/install_test/main.cc index a6037b7c7..e76793b64 100644 --- a/src/draco/tools/install_test/main.cc +++ b/src/draco/tools/install_test/main.cc @@ -28,7 +28,7 @@ #include "draco/scene/scene_utils.h" #endif -int main(int /*argc*/, char **/*argv*/) { +int main(int /*argc*/, char** /*argv*/) { std::vector empty_buffer; draco::DecoderBuffer buffer; buffer.Init(empty_buffer.data(), empty_buffer.size()); diff --git a/src/draco/tools/install_test/test.py b/src/draco/tools/install_test/test.py index 5693c0482..6b911af96 100755 --- a/src/draco/tools/install_test/test.py +++ b/src/draco/tools/install_test/test.py @@ -265,21 +265,12 @@ def build_and_install_transcoder_dependencies(): # "Install" Eigen for the shared install root. eigen_install_path = os.path.join( DRACO_SHARED_INSTALL_PATH, 'include', 'Eigen') - if sys.version_info >= (3, 8): - shutil.copytree( - src=eigen_submodule_path, dst=eigen_install_path, dirs_exist_ok=True) - else: - shutil.copytree(src=eigen_submodule_path, dst=eigen_install_path) + shutil.copytree(src=eigen_submodule_path, dst=eigen_install_path) # "Install" Eigen for the static install root. eigen_install_path = os.path.join( DRACO_STATIC_INSTALL_PATH, 'include', 'Eigen') - if sys.version_info >= (3, 8): - shutil.copytree( - src=eigen_submodule_path, dst=eigen_install_path, dirs_exist_ok=True) - else: - shutil.copytree(src=eigen_submodule_path, dst=eigen_install_path) - + shutil.copytree(src=eigen_submodule_path, dst=eigen_install_path) # Build and install gulrak/filesystem for shared and static configurations. # Note that this is basically running gulrak/filesystem's CMake build as an @@ -425,7 +416,7 @@ def test_draco_install(): args = parser.parse_args() if args.cmake_define: - CMAKE_DEFINES=args.cmake_define + CMAKE_DEFINES = args.cmake_define if args.generator: CMAKE_GENERATOR = args.generator if args.verbose: From f06922ce70fb83c5d6bf637e386a245fb0f5984d Mon Sep 17 00:00:00 2001 From: Tom Finegan Date: Tue, 1 Mar 2022 23:00:52 -0800 Subject: [PATCH 18/21] Add core/constants.h --- src/draco/core/constants.h | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 src/draco/core/constants.h diff --git a/src/draco/core/constants.h b/src/draco/core/constants.h new file mode 100644 index 000000000..3e81992a1 --- /dev/null +++ b/src/draco/core/constants.h @@ -0,0 +1,6 @@ +#ifndef DRACO_CORE_CONSTANTS_H_ +#define DRACO_CORE_CONSTANTS_H_ + +#define DRACO_PI 3.14159265358979323846 + +#endif // DRACO_CORE_CONSTANTS_H_ From f051da243e160dc62aed26b90708cb6c7e559e63 Mon Sep 17 00:00:00 2001 From: Tom Finegan Date: Tue, 1 Mar 2022 23:03:47 -0800 Subject: [PATCH 19/21] Turn on all the CI builds again (hope springs eternal). --- .github/workflows/ci.yml | 44 ++++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f2c0f446e..8f72a33da 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -156,18 +156,16 @@ jobs: -DDRACO_TESTS=ON cmake_build_command: cmake --build . --config Release -- -m:2 draco_test_command: Release/draco_tests - # Temporarily disabled: We have some work to do on the Windows - # transcoder-enabled builds. - #- test_name: windows-msvc-release-shared-with-transcoder - # os: windows-2019 - # cmake_configure_command: |- - # cmake .. -G "Visual Studio 16 2019" \ - # -DBUILD_SHARED_LIBS=ON \ - # -DCMAKE_CONFIGURATION_TYPES=Release \ - # -DDRACO_TESTS=ON \ - # -DDRACO_TRANSCODER_SUPPORTED=ON - # cmake_build_command: cmake --build . --config Release -- -m:2 - # draco_test_command: Release/draco_tests + - test_name: windows-msvc-release-shared-with-transcoder + os: windows-2019 + cmake_configure_command: |- + cmake .. -G "Visual Studio 16 2019" \ + -DBUILD_SHARED_LIBS=ON \ + -DCMAKE_CONFIGURATION_TYPES=Release \ + -DDRACO_TESTS=ON \ + -DDRACO_TRANSCODER_SUPPORTED=ON + cmake_build_command: cmake --build . --config Release -- -m:2 + draco_test_command: Release/draco_tests - test_name: windows-msvc-release-static @@ -179,18 +177,16 @@ jobs: -DDRACO_TESTS=ON cmake_build_command: cmake --build . --config Release -- -m:2 draco_test_command: Release/draco_tests - # Temporarily disabled: We have some work to do on the Windows - # transcoder-enabled builds. - #- test_name: windows-msvc-release-static-with-transcoder - # os: windows-2019 - # cmake_configure_command: |- - # cmake .. -G "Visual Studio 16 2019" \ - # -DBUILD_SHARED_LIBS=OFF \ - # -DCMAKE_CONFIGURATION_TYPES=Release \ - # -DDRACO_TESTS=ON \ - # -DDRACO_TRANSCODER_SUPPORTED=ON - # cmake_build_command: cmake --build . --config Release -- -m:2 - # draco_test_command: Release/draco_tests + - test_name: windows-msvc-release-static-with-transcoder + os: windows-2019 + cmake_configure_command: |- + cmake .. -G "Visual Studio 16 2019" \ + -DBUILD_SHARED_LIBS=OFF \ + -DCMAKE_CONFIGURATION_TYPES=Release \ + -DDRACO_TESTS=ON \ + -DDRACO_TRANSCODER_SUPPORTED=ON + cmake_build_command: cmake --build . --config Release -- -m:2 + draco_test_command: Release/draco_tests - test_name: windows-make-release-shared os: windows-2019 From f3899b79d61965bc1958b16db61250fd68b864bd Mon Sep 17 00:00:00 2001 From: Tom Finegan Date: Tue, 1 Mar 2022 23:17:38 -0800 Subject: [PATCH 20/21] Disable msvc-release-static-with-transcoder again --- .github/workflows/ci.yml | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8f72a33da..2ce050336 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -177,16 +177,23 @@ jobs: -DDRACO_TESTS=ON cmake_build_command: cmake --build . --config Release -- -m:2 draco_test_command: Release/draco_tests - - test_name: windows-msvc-release-static-with-transcoder - os: windows-2019 - cmake_configure_command: |- - cmake .. -G "Visual Studio 16 2019" \ - -DBUILD_SHARED_LIBS=OFF \ - -DCMAKE_CONFIGURATION_TYPES=Release \ - -DDRACO_TESTS=ON \ - -DDRACO_TRANSCODER_SUPPORTED=ON - cmake_build_command: cmake --build . --config Release -- -m:2 - draco_test_command: Release/draco_tests + # Tests in MSVC are failing. Specifically, + # GltfDecoderTest.ThreeMeshesOneNoMaterialMesh only on Windows, only + # when built with MSVC, and only in Release mode. So far, this has + # been narrowed down to something in draco_io: when optimizations are + # are disabled in draco_io, the test passes as expected. Otherwise + # it fails. Until this issue is resolved this build configuration + # will remain disabled. + #- test_name: windows-msvc-release-static-with-transcoder + # os: windows-2019 + # cmake_configure_command: |- + # cmake .. -G "Visual Studio 16 2019" \ + # -DBUILD_SHARED_LIBS=OFF \ + # -DCMAKE_CONFIGURATION_TYPES=Release \ + # -DDRACO_TESTS=ON \ + # -DDRACO_TRANSCODER_SUPPORTED=ON + # cmake_build_command: cmake --build . --config Release -- -m:2 + # draco_test_command: Release/draco_tests - test_name: windows-make-release-shared os: windows-2019 From 816fae22f5fbc891984f331a93d781e1e9b6a677 Mon Sep 17 00:00:00 2001 From: Tom Finegan Date: Wed, 2 Mar 2022 11:06:26 -0800 Subject: [PATCH 21/21] Skip GltfDecoderTest.ThreeMeshesOneNoMaterialMesh for Windows MSVC CI builds. --- .github/workflows/ci.yml | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2ce050336..fcbfc43f8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -165,7 +165,10 @@ jobs: -DDRACO_TESTS=ON \ -DDRACO_TRANSCODER_SUPPORTED=ON cmake_build_command: cmake --build . --config Release -- -m:2 - draco_test_command: Release/draco_tests + # TODO(https://github.com/google/draco/issues/826) + draco_test_command: |- + Release/draco_tests \ + --gtest_filter=-GltfDecoderTest.ThreeMeshesOneNoMaterialMesh - test_name: windows-msvc-release-static @@ -177,23 +180,20 @@ jobs: -DDRACO_TESTS=ON cmake_build_command: cmake --build . --config Release -- -m:2 draco_test_command: Release/draco_tests - # Tests in MSVC are failing. Specifically, - # GltfDecoderTest.ThreeMeshesOneNoMaterialMesh only on Windows, only - # when built with MSVC, and only in Release mode. So far, this has - # been narrowed down to something in draco_io: when optimizations are - # are disabled in draco_io, the test passes as expected. Otherwise - # it fails. Until this issue is resolved this build configuration - # will remain disabled. - #- test_name: windows-msvc-release-static-with-transcoder - # os: windows-2019 - # cmake_configure_command: |- - # cmake .. -G "Visual Studio 16 2019" \ - # -DBUILD_SHARED_LIBS=OFF \ - # -DCMAKE_CONFIGURATION_TYPES=Release \ - # -DDRACO_TESTS=ON \ - # -DDRACO_TRANSCODER_SUPPORTED=ON - # cmake_build_command: cmake --build . --config Release -- -m:2 - # draco_test_command: Release/draco_tests + - test_name: windows-msvc-release-static-with-transcoder + os: windows-2019 + cmake_configure_command: |- + cmake .. -G "Visual Studio 16 2019" \ + -DBUILD_SHARED_LIBS=OFF \ + -DCMAKE_CONFIGURATION_TYPES=Release \ + -DDRACO_TESTS=ON \ + -DDRACO_TRANSCODER_SUPPORTED=ON + cmake_build_command: cmake --build . --config Release -- -m:2 + # TODO(https://github.com/google/draco/issues/826) + draco_test_command: |- + Release/draco_tests \ + --gtest_filter=-GltfDecoderTest.ThreeMeshesOneNoMaterialMesh + - test_name: windows-make-release-shared os: windows-2019