Skip to content

Commit c9d7360

Browse files
authored
Merge pull request #819 from mcbarton/main
Add CppInterOp recipe
2 parents 5ec548d + eecf7f0 commit c9d7360

File tree

5 files changed

+140
-0
lines changed

5 files changed

+140
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
BSD-3-Clause license
2+
Copyright (c) 2015-2022, conda-forge contributors
3+
All rights reserved.
4+
5+
Redistribution and use in source and binary forms, with or without
6+
modification, are permitted provided that the following conditions are met:
7+
8+
1. Redistributions of source code must retain the above copyright notice,
9+
this list of conditions and the following disclaimer.
10+
2. Redistributions in binary form must reproduce the above copyright
11+
notice, this list of conditions and the following disclaimer in the
12+
documentation and/or other materials provided with the distribution.
13+
3. Neither the name of the copyright holder nor the names of its
14+
contributors may be used to endorse or promote products derived from
15+
this software without specific prior written permission.
16+
17+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20+
ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR
21+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25+
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26+
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
27+
DAMAGE.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
mkdir build
2+
cd build
3+
4+
export CMAKE_PREFIX_PATH=$PREFIX
5+
export CMAKE_SYSTEM_PREFIX_PATH=$PREFIX
6+
7+
# Configure step
8+
emcmake cmake -DCMAKE_BUILD_TYPE=Release \
9+
-DUSE_CLING=OFF \
10+
-DUSE_REPL=ON \
11+
-DCMAKE_PREFIX_PATH=$PREFIX \
12+
-DLLVM_DIR=$PREFIX \
13+
-DClang_DIR=$PREFIX \
14+
-DBUILD_SHARED_LIBS=ON \
15+
-DCMAKE_INSTALL_PREFIX=$PREFIX \
16+
-DCMAKE_FIND_ROOT_PATH_MODE_PACKAGE=ON \
17+
../
18+
19+
# Build step
20+
EMCC_CFLAGS='-sERROR_ON_UNDEFINED_SYMBOLS=0' emmake make -j1
21+
22+
# Install step
23+
emmake make install
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
From 3069b953dd1303eb4bd1171a8f5c5501ecdafc29 Mon Sep 17 00:00:00 2001
2+
From: Vassil Vassilev <[email protected]>
3+
Date: Sun, 3 Mar 2024 20:32:15 +0000
4+
Subject: [PATCH] [cmake] Work around a bug in the llvm config.
5+
6+
In short we use variables which require including `GNUInstallDirs` but we are
7+
expecting somebody else to include it for us.
8+
9+
See llvm/llvm-project#83802
10+
---
11+
CMakeLists.txt | 2 ++
12+
1 file changed, 2 insertions(+)
13+
14+
diff --git a/CMakeLists.txt b/CMakeLists.txt
15+
index 548e535..f4efb0e 100644
16+
--- a/CMakeLists.txt
17+
+++ b/CMakeLists.txt
18+
@@ -1,5 +1,7 @@
19+
cmake_minimum_required(VERSION 3.13)
20+
21+
+include(GNUInstallDirs)
22+
+
23+
set(CMAKE_MODULE_PATH
24+
${CMAKE_MODULE_PATH}
25+
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
26+
--
27+
2.37.1 (Apple Git-137.1)
28+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/CMakeLists.txt b/CMakeLists.txt
2+
index d8b340a..d4e066b 100644
3+
--- a/CMakeLists.txt
4+
+++ b/CMakeLists.txt
5+
@@ -326,7 +326,7 @@ configure_file(
6+
${CMAKE_CURRENT_SOURCE_DIR}/cmake/CppInterOp/CppInterOpConfigVersion.cmake.in
7+
${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/CppInterOp/CppInterOpConfigVersion.cmake
8+
@ONLY)
9+
-install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/CppInterOp
10+
+install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib/cmake/CppInterOp/
11+
DESTINATION lib/cmake/CppInterOp
12+
FILES_MATCHING
13+
PATTERN "*.cmake"
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
context:
2+
version: 1.2.0
3+
4+
package:
5+
name: cppinterop
6+
version: '{{ version }}'
7+
8+
source:
9+
url: https://github.com/compiler-research/CppInterOp/archive/refs/tags/v{{ version }}.tar.gz
10+
sha256: b3cf25f500624fe12ffc40f858a04c46daea808298e64d924b594eb35ca1c806
11+
patches:
12+
- patches/cppinterop/0001-cmake-Work-around-a-bug-in-the-llvm-config.patch
13+
- patches/cppinterop/0002-cmake-Fix-install-folder.patch
14+
15+
build:
16+
number: 0
17+
18+
requirements:
19+
build:
20+
- '{{ compiler("cxx") }}'
21+
- cmake
22+
- make # [unix]
23+
host:
24+
- llvm
25+
26+
about:
27+
home: https://github.com/compiler-research/CppInterOp
28+
license: Apache-2.0 WITH LLVM-exception
29+
license_family: Apache
30+
license_file: LICENSE.TXT
31+
summary: |
32+
The CppInterOp library provides a minimalist approach for other languages
33+
to interoperate with C++ entities.
34+
description: |
35+
CppInterOp exposes API from Clang and LLVM in a backward compatibe way.
36+
The API support downstream tools that utilize interactive C++ by using
37+
the compiler as a service. That is, embed Clang and LLVM as a libraries
38+
in their codebases. The API are designed to be minimalistic and aid
39+
non-trivial tasks such as language interoperability on the fly. In such
40+
scenarios CppInterOp can be used to provide the necessary introspection
41+
information to the other side helping the language cross talk.
42+
doc_url: https://cppinterop.readthedocs.io/en/{{ version }}
43+
dev_url: https://cppinterop.readthedocs.io/en/{{ version }}/DevelopersDocumentation.html
44+
45+
extra:
46+
recipe-maintainers:
47+
- alexander-penev
48+
- vgvassilev
49+
- mcbarton

0 commit comments

Comments
 (0)