8000 remove assimp submodule by elalish · Pull Request #194 · elalish/manifold · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

remove assimp submodule #194

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions .github/workflows/manifold.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,14 @@ jobs:
- name: Install dependencies
run: |
apt-get -y update
DEBIAN_FRONTEND=noninteractive apt install -y libomp-dev git libtbb-dev pkg-config libpython3-dev python3 python3-distutils python3-pip lcov
DEBIAN_FRONTEND=noninteractive apt install -y libomp-dev libassimp-dev git libtbb-dev pkg-config libpython3-dev python3 python3-distutils python3-pip lcov
pip install meshio[all]
- uses: actions/checkout@v3
with:
submodules: true
- uses: jwlawson/actions-setup-cmake@v1.12
- name: Build ${{matrix.backend}}
run: |
# patch assimp
patch test/third_party/assimp/code/CMakeLists.txt < assimp.diff
git apply thrust.diff
mkdir build
cd build
Expand Down Expand Up @@ -91,8 +89,6 @@ jobs:
- name: Build WASM
run: |
source ./emsdk/emsdk_env.sh
# patch assimp
patch test/third_party/assimp/code/CMakeLists.txt < assimp.diff
git apply thrust.diff
mkdir build
cd build
Expand Down Expand Up @@ -123,9 +119,6 @@ jobs:
with:
submodules: true
- uses: jwlawson/actions-setup-cmake@v1.12
- name: Patch assimp
shell: bash
run: patch test/third_party/assimp/code/CMakeLists.txt < assimp.diff
- uses: ilammy/msvc-dev-cmd@v1
- name: Install CUDA
if: matrix.backend == 'CUDA'
Expand Down
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
[submodule "third_party/assimp"]
path = test/third_party/assimp
url = https://github.com/assimp/assimp
[submodule "third_party/thrust"]
path = src/third_party/thrust
url = https://github.com/NVIDIA/thrust
Expand Down
17 changes: 0 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,8 @@ option(PYBIND11_FINDPYTHON on)
option(BUILD_TEST_CGAL off)

option(BUILD_SHARED_LIBS off)
set(ASSIMP_INC_DIR
${PROJECT_SOURCE_DIR}/test/third_party/assimp/include
${CMAKE_BINARY_DIR}/test/third_party/assimp/include)
set(GLM_INC_DIR ${PROJECT_SOURCE_DIR}/src/third_party/glm)
set(PYBIND11_DIR ${PROJECT_SOURCE_DIR}/bindings/python/third_party/pybind11)

option(ASSIMP_FAST_BUILD "build ASSIMP just for tests" ON)

if(ASSIMP_FAST_BUILD)
option(ASSIMP_INSTALL FALSE)
option(ASSIMP_BUILD_ALL_IMPORTERS_BY_DEFAULT FALSE)
option(ASSIMP_BUILD_ALL_EXPORTERS_BY_DEFAULT FALSE)

foreach(FMT OBJ;PLY;STL;GLTF)
set(ASSIMP_BUILD_${FMT}_IMPORTER TRUE)
set(ASSIMP_BUILD_${FMT}_EXPORTER TRUE)
endforeach()
endif()

set(THRUST_INC_DIR ${PROJECT_SOURCE_DIR}/src/third_party/thrust)

if(MANIFOLD_USE_CUDA)
Expand Down
16 changes: 0 additions & 16 deletions assimp.diff

This file was deleted.

4 changes: 1 addition & 3 deletions flake.nix
8000
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"manifold-${parallel-backend}";
version = "beta";
src = self;
patches = [ ./assimp.diff ./thrust.diff ];
patches = [ ./thrust.diff ];
nativeBuildInputs = (with pkgs; [ cmake (python39.withPackages(ps: with ps; [meshio])) ]) ++ build-tools ++
(if cuda-support then with pkgs.cudaPackages; [ cuda_nvcc cuda_cudart cuda_cccl pkgs.addOpenGLRunpath ] else [ ]);
cmakeFlags = [
Expand All @@ -42,7 +42,6 @@
installPhase = ''
mkdir -p $out
cp src/manifold/libmanifold.a $out/
cp test/meshIO/libmeshIO.a $out/
cp extras/perfTest $out
cp bindings/python/pymanifold* $out
'';
Expand Down Expand Up @@ -92,7 +91,6 @@
name = "manifold-js";
version = "beta";
src = self;
patches = [ ./assimp.diff ];
nativeBuildInputs = (with pkgs; [ cmake python39 ]);
buildInputs = [ pkgs.nodejs ];
configurePhase = ''
Expand Down
2 changes: 1 addition & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
project(manifold_test)

add_subdirectory(third_party)
add_subdirectory(meshIO)

enable_testing()

Expand All @@ -24,6 +23,7 @@ add_executable(${PROJECT_NAME} ${SOURCE_FILES})
target_link_libraries(${PROJECT_NAME} polygon GTest::GTest manifold samples samplesGPU)

if(MANIFOLD_EXPORT)
add_subdirectory(meshIO)
target_link_libraries(${PROJECT_NAME} meshIO)
target_compile_options(${PROJECT_NAME} PUBLIC -DMANIFOLD_EXPORT)
endif()
Expand Down
4 changes: 2 additions & 2 deletions test/meshIO/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -17,7 +17,7 @@ project(meshIO)
add_library(${PROJECT_NAME} src/meshIO.cpp)

target_include_directories(${PROJECT_NAME}
PUBLIC ${PROJECT_SOURCE_DIR}/include ${ASSIMP_INC_DIR}
PUBLIC ${PROJECT_SOURCE_DIR}/include
)

target_link_libraries(${PROJECT_NAME}
Expand Down
8 changes: 5 additions & 3 deletions test/meshIO/src/meshIO.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
#include <iostream>

#include "assimp/Exporter.hpp"
#include "assimp/GltfMaterial.h"
#include "assimp/Importer.hpp"
#include "assimp/pbrmaterial.h"
#include "assimp/postprocess.h"
#include "assimp/scene.h"
#include "optional_assert.h"
Expand Down Expand Up @@ -126,8 +126,10 @@ void ExportMesh(const std::string& filename, const Mesh& mesh,
scene->mMaterials[0] = new aiMaterial();

aiMaterial* material = scene->mMaterials[0];
material->AddProperty(&options.mat.roughness, 1, AI_MATKEY_ROUGHNESS_FACTOR);
material->AddProperty(&options.mat.metalness, 1, AI_MATKEY_METALLIC_FACTOR);
material->AddProperty(&options.mat.roughness, 1,
AI_MATKEY_GLTF_PBRMETALLICROUGHNESS_ROUGHNESS_FACTOR);
material->AddProperty(&options.mat.metalness, 1,
AI_MATKEY_GLTF_PBRMETALLICROUGHNESS_METALLIC_FACTOR);
const glm::vec4& color = options.mat.color;
aiColor4D baseColor(color.r, color.g, color.b, color.a);
material->AddProperty(&baseColor, 1, AI_MATKEY_COLOR_DIFFUSE);
Expand Down
9 changes: 1 addition & 8 deletions test/third_party/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,14 @@
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

############################################################################
# BUILD ASSIMP LIBRARY #
############################################################################
option(ASSIMP_BUILD_ASSIMP_TOOLS off)
option(ASSIMP_BUILD_TESTS off)
add_subdirectory(assimp)

# ###########################################################################
# Build Google Test #
# ###########################################################################
Expand Down
1 change: 0 additions & 1 deletion test/third_party/assimp
Submodule assimp deleted from 19f2a6
0