Skip to content
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
27 changes: 27 additions & 0 deletions recipes/recipes_emscripten/cppinterop/LICENSE.TXT
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
BSD-3-Clause license
Copyright (c) 2015-2022, conda-forge contributors
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
DAMAGE.
23 changes: 23 additions & 0 deletions recipes/recipes_emscripten/cppinterop/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
mkdir build
cd build

export CMAKE_PREFIX_PATH=$PREFIX
export CMAKE_SYSTEM_PREFIX_PATH=$PREFIX

# Configure step
emcmake cmake -DCMAKE_BUILD_TYPE=Release \
-DUSE_CLING=OFF \
-DUSE_REPL=ON \
-DCMAKE_PREFIX_PATH=$PREFIX \
-DLLVM_DIR=$PREFIX \
-DClang_DIR=$PREFIX \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \
../

# Build step
EMCC_CFLAGS='-sERROR_ON_UNDEFINED_SYMBOLS=0' emmake make -j1

# Install step
emmake make install
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
From 3069b953dd1303eb4bd1171a8f5c5501ecdafc29 Mon Sep 17 00:00:00 2001
From: Vassil Vassilev <[email protected]>
Date: Sun, 3 Mar 2024 20:32:15 +0000
Subject: [PATCH] [cmake] Work around a bug in the llvm config.

In short we use variables which require including `GNUInstallDirs` but we are
expecting somebody else to include it for us.

See llvm/llvm-project#83802
---
CMakeLists.txt | 2 ++
1 file changed, 2 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 548e535..f4efb0e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,7 @@
cmake_minimum_required(VERSION 3.13)

+include(GNUInstallDirs)
+
set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
--
2.37.1 (Apple Git-137.1)

Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d8b340a..d4e066b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -326,7 +326,7 @@ configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/cmake/CppInterOp/CppInterOpConfigVersion.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/CppInterOp/CppInterOpConfigVersion.cmake
@ONLY)
-install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/CppInterOp
+install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/CppInterOp/
DESTINATION lib/cmake/CppInterOp
FILES_MATCHING
PATTERN "*.cmake"
49 changes: 49 additions & 0 deletions recipes/recipes_emscripten/cppinterop/recipe.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
context:
version: 1.2.0

package:
name: cppinterop
version: '{{ version }}'

source:
url: https://github.com/compiler-research/CppInterOp/archive/refs/tags/v{{ version }}.tar.gz
sha256: b3cf25f500624fe12ffc40f858a04c46daea808298e64d924b594eb35ca1c806
patches:
- patches/cppinterop/0001-cmake-Work-around-a-bug-in-the-llvm-config.patch
- patches/cppinterop/0002-cmake-Fix-install-folder.patch

build:
number: 0

requirements:
build:
- '{{ compiler("cxx") }}'
- cmake
- make # [unix]
host:
- llvm

about:
home: https://github.com/compiler-research/CppInterOp
license: Apache-2.0 WITH LLVM-exception
license_family: Apache
license_file: LICENSE.TXT
summary: |
The CppInterOp library provides a minimalist approach for other languages
to interoperate with C++ entities.
description: |
CppInterOp exposes API from Clang and LLVM in a backward compatibe way.
The API support downstream tools that utilize interactive C++ by using
the compiler as a service. That is, embed Clang and LLVM as a libraries
in their codebases. The API are designed to be minimalistic and aid
non-trivial tasks such as language interoperability on the fly. In such
scenarios CppInterOp can be used to provide the necessary introspection
information to the other side helping the language cross talk.
doc_url: https://cppinterop.readthedocs.io/en/{{ version }}
dev_url: https://cppinterop.readthedocs.io/en/{{ version }}/DevelopersDocumentation.html

extra:
recipe-maintainers:
- alexander-penev
- vgvassilev
- mcbarton