Browse Source

Merge branch 'NP-637_conan_v2_wasm'

pull/24/head
Jelle Spijker 1 year ago
parent
commit
1ca62939a7
  1. 30
      extensions/generators/npm.py
  2. 10
      profiles/cura.jinja
  3. 4
      profiles/cura_build.jinja
  4. 11
      profiles/cura_clang.jinja
  5. 3
      profiles/cura_wasm.jinja

30
extensions/generators/npm.py

@ -0,0 +1,30 @@
import json
from conan import ConanFile
from conan.errors import ConanException
from conan.tools.files import copy, save
from pathlib import Path
class npm:
def __init__(self, conanfile: ConanFile):
self._conanfile = conanfile
def generate(self):
if self._conanfile.settings.os != "Emscripten":
self._conanfile.output.error("Can only deploy to NPM when build for Emscripten")
raise ConanException("Can only deploy to NPM when build for Emscripten")
root_package = [dep for dep in self._conanfile.dependencies.direct_host.values()][0]
# Copy the *.js and *.d.ts
copy(self._conanfile, "*.js", src=root_package.package_folder, dst=self._conanfile.generators_folder)
copy(self._conanfile, "*.d.ts", src=root_package.package_folder, dst=self._conanfile.generators_folder)
# Create the package.json
save(self._conanfile, str(Path(self._conanfile.generators_folder, "package.json")),
json.dumps(root_package.conf_info.get(f"user.{root_package.ref.name.lower()}:package_json")))
# Create the .npmrc file
save(self._conanfile, str(Path(self._conanfile.generators_folder, ".npmrc")),
"//npm.pkg.github.com/:_authToken=${GITHUB_TOKEN}\n@ultimaker:registry=https://npm.pkg.github.com\nalways-auth=true")

10
profiles/cura.jinja

@ -1,5 +1,13 @@
include(default) include(default)
[replace_requires]
{% if platform.system() == 'Linux' %}
# FIXME: once gRPC is updated to 1.67.0 or higher
# Using 255.10 or higher https://github.com/conan-io/conan-center-index/issues/24889
# https://github.com/conan-io/conan-center-index/blob/879e140d9438ab491aceea766d0cf0ae3595dae8/recipes/grpc/all/conanfile.py#L122
libsystemd/*: libsystemd/[>=255.10]
{% endif %}
[settings] [settings]
compiler.cppstd=17 compiler.cppstd=17
curaengine*:compiler.cppstd=20 curaengine*:compiler.cppstd=20
@ -9,7 +17,7 @@ curaengine_grpc_definitions*:compiler.cppstd=20
scripta*:compiler.cppstd=20 scripta*:compiler.cppstd=20
umspatial*:compiler.cppstd=20 umspatial*:compiler.cppstd=20
dulcificum*:compiler.cppstd=20 dulcificum*:compiler.cppstd=20
curator*:compiler.cppstd=20 curator/*:compiler.cppstd=20
[options] [options]
asio-grpc/*:local_allocator=recycling_allocator asio-grpc/*:local_allocator=recycling_allocator

4
profiles/cura_build.jinja

@ -2,3 +2,7 @@ include(default)
[settings] [settings]
compiler.cppstd=17 compiler.cppstd=17
curator/*:compiler.cppstd=20
[conf]
tools.build:skip_test=True

11
profiles/cura_clang.jinja

@ -1,13 +1,10 @@
include(cura.jinja) include(cura.jinja)
{% set compiler, version, compiler_exe = detect_api.detect_clang_compiler(compiler_exe="clang") %}
[tool_requires]
[settings] [settings]
compiler=clang compiler={{ compiler }}
compiler.version=18 compiler.version={{ version.major }}
compiler.libcxx=libstdc++11 compiler.libcxx=libstdc++11
[options]
[conf] [conf]
tools.build:compiler_executables={"c":"clang", "cpp":"clang++"} tools.build:compiler_executables={"c":"{{ compiler_exe }}", "cpp":"{{ compiler_exe }}++"}

3
profiles/cura_wasm.jinja

@ -10,10 +10,13 @@ arch=wasm
[conf] [conf]
tools.build:skip_test=True tools.build:skip_test=True
tools.cmake.cmake_layout:build_folder_vars=['settings.os']
user.curator:printers=['ultimaker_sketch','ultimaker_sketch_large','ultimaker_sketch_sprint','ultimaker_method']
[options] [options]
curaengine/*:enable_plugins=False curaengine/*:enable_plugins=False
curaengine/*:enable_arcus=False curaengine/*:enable_arcus=False
curator/*:with_cura_resources=True curator/*:with_cura_resources=True
curator/*:disable_logging=True curator/*:disable_logging=True
dulcificum/*:with_python_bindings=False
libzip/*:crypto=False libzip/*:crypto=False

Loading…
Cancel
Save