Skip to content

Commit 90fc877

Browse files
authored
libCppInterOp: build v0.1.7 (#11045)
- update source to test compiler-research/CppInterOp#553 - remove wasm link flags in the cmake patch
1 parent d67183b commit 90fc877

File tree

2 files changed

+22
-26
lines changed

2 files changed

+22
-26
lines changed

L/libCppInterOp/build_tarballs.jl

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ include(joinpath(YGGDRASIL_DIR, "fancy_toys.jl"))
88
include(joinpath(YGGDRASIL_DIR, "platforms", "llvm.jl"))
99

1010
name = "libCppInterOp"
11-
version = v"0.1.6"
11+
version = v"0.1.7"
1212

1313
llvm_versions = [v"18.1.7"]
1414

1515
# Collection of sources required to complete build
1616
sources = [
17-
GitSource("https://github.com/compiler-research/CppInterOp.git", "a22df968590709eb2d3957fb6c88feb61639621e"),
17+
GitSource("https://github.com/compiler-research/CppInterOp.git", "da58066ca29649145b25b5fc0e22d8aee57e356a"),
1818
DirectorySource("./bundled")
1919
]
2020

@@ -24,7 +24,6 @@ cd $WORKSPACE/srcdir/CppInterOp/
2424
atomic_patch -p1 ../patches/cmake.patch
2525
mkdir build && cd build
2626
cmake .. -DCMAKE_INSTALL_PREFIX=$prefix -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} \
27-
-DBUILD_SHARED_LIBS=ON \
2827
-DLLVM_DIR=${prefix}/lib/cmake/llvm \
2928
-DClang_DIR=${prefix}/lib/cmake/clang \
3029
-DCMAKE_BUILD_TYPE=Release

L/libCppInterOp/bundled/patches/cmake.patch

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
From 2e0203168dcaf52b443949db4725da638f93c9c5 Mon Sep 17 00:00:00 2001
1+
From d83f17d31e1cf0c6d6453f754d19c4e8956a8fbb Mon Sep 17 00:00:00 2001
22
From: Gnimuc <[email protected]>
33
Date: Tue, 25 Mar 2025 12:21:31 +0900
44
Subject: [PATCH] Rewrite CMake build scripts
55

66
---
7-
CMakeLists.txt | 578 +++--------------------
7+
CMakeLists.txt | 577 +++--------------------
88
include/CMakeLists.txt | 1 +
99
include/clang-c/CMakeLists.txt | 1 +
1010
include/clang/CMakeLists.txt | 1 +
1111
include/clang/Interpreter/CMakeLists.txt | 1 +
1212
lib/Interpreter/CMakeLists.txt | 157 +-----
13-
6 files changed, 79 insertions(+), 660 deletions(-)
13+
6 files changed, 76 insertions(+), 662 deletions(-)
1414
create mode 100644 include/CMakeLists.txt
1515
create mode 100644 include/clang-c/CMakeLists.txt
1616
create mode 100644 include/clang/CMakeLists.txt
1717
create mode 100644 include/clang/Interpreter/CMakeLists.txt
1818

1919
diff --git a/CMakeLists.txt b/CMakeLists.txt
20-
index cb0c588..c4571d8 100644
20+
index 5cf3707..61e01b0 100644
2121
--- a/CMakeLists.txt
2222
+++ b/CMakeLists.txt
23-
@@ -1,523 +1,77 @@
23+
@@ -1,523 +1,72 @@
2424
-cmake_minimum_required(VERSION 3.13)
2525
+cmake_minimum_required(VERSION 3.21)
2626

@@ -274,9 +274,9 @@ index cb0c588..c4571d8 100644
274274
- message(fatal "LLVM/CppInterOp requires c++14 or later")
275275
- endif()
276276
- endif()
277-
-
277+
-
278278
- ## Find supported Cling
279-
-
279+
-
280280
- if (CPPINTEROP_USE_CLING)
281281
- if (NOT Cling_FOUND AND DEFINED Cling_DIR)
282282
- find_package(Cling REQUIRED CONFIG ${cling_extra_hints} NO_DEFAULT_PATH)
@@ -310,7 +310,10 @@ index cb0c588..c4571d8 100644
310310

311311
- # In case this was a path to a build folder of llvm still try to find AddLLVM
312312
- list(APPEND CMAKE_MODULE_PATH "${LLVM_DIR}")
313-
-
313+
+find_package(Clang REQUIRED CONFIG)
314+
+message(STATUS "Found Clang ${Clang_PACKAGE_VERSION}")
315+
+message(STATUS "Using ClangConfig.cmake in: ${Clang_DIR}")
316+
314317
- # Fix bug in some AddLLVM.cmake implementation (-rpath "" problem)
315318
- set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX})
316319
-
@@ -530,7 +533,7 @@ index cb0c588..c4571d8 100644
530533
- set(MSVC_EXPORTLIST ${MSVC_EXPORTLIST} ??3@YAXPAX0@Z ??_V@YAXPAX0@Z)
531534
- endif()
532535
-
533-
- if(MSVC_VERSION GREATER_EQUAL 1936)
536+
- if(MSVC_VERSION GREATER_EQUAL 1936 AND NOT (CMAKE_C_COMPILER MATCHES "aarch64|arm"))
534537
- set(MSVC_EXPORTLIST ${MSVC_EXPORTLIST}
535538
- __std_find_trivial_1
536539
- __std_find_trivial_2
@@ -542,10 +545,11 @@ index cb0c588..c4571d8 100644
542545
-foreach(sym ${MSVC_EXPORTLIST})
543546
- set(MSVC_EXPORTS "${MSVC_EXPORTS} /EXPORT:${sym}")
544547
-endforeach(sym ${MSVC_EXPORTLIST})
545-
+find_package(Clang REQUIRED CONFIG)
546-
+message(STATUS "Found Clang ${Clang_PACKAGE_VERSION}")
547-
+message(STATUS "Using ClangConfig.cmake in: ${Clang_DIR}")
548-
548+
-
549+
-endif()
550+
-
551+
-if (CPPINTEROP_INCLUDE_DOCS)
552+
- add_subdirectory(docs)
549553
+add_library(CppInterOp SHARED)
550554
+add_subdirectory(lib)
551555
+add_subdirectory(include)
@@ -575,13 +579,6 @@ index cb0c588..c4571d8 100644
575579
+
576580
+target_link_libraries(CppInterOp PUBLIC LLVM clang-cpp)
577581
+
578-
+if(UNIX AND NOT APPLE AND NOT CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
579-
+ target_link_options(CppInterOp PUBLIC -Wl,--export=__clang_Interpreter_SetValueNoAlloc)
580-
+ target_link_options(CppInterOp PUBLIC -Wl,--export=__clang_Interpreter_SetValueWithAlloc)
581-
endif()
582-
583-
-if (CPPINTEROP_INCLUDE_DOCS)
584-
- add_subdirectory(docs)
585582
+# Install CompilationDatabase
586583
+set_target_properties(CppInterOp PROPERTIES EXPORT_COMPILE_COMMANDS true)
587584
+set(ccmds_json ${CMAKE_CURRENT_BINARY_DIR}/compile_commands.json)
@@ -643,7 +640,7 @@ index 0000000..c6c9939
643640
+target_sources(CppInterOp PRIVATE ${CMAKE_CURRENT_LIST_DIR}/CppInterOp.h)
644641
\ No newline at end of file
645642
diff --git a/lib/Interpreter/CMakeLists.txt b/lib/Interpreter/CMakeLists.txt
646-
index 7568f7f..4205ada 100644
643+
index eccfc39..4205ada 100644
647644
--- a/lib/Interpreter/CMakeLists.txt
648645
+++ b/lib/Interpreter/CMakeLists.txt
649646
@@ -1,148 +1,9 @@
@@ -763,12 +760,12 @@ index 7568f7f..4205ada 100644
763760
-
764761
-
765762
-if(EMSCRIPTEN)
766-
- # FIXME: When dynamically linking the Emscripten shared library to the
763+
- # FIXME: When dynamically linking the Emscripten shared library to the
767764
- # unit tests main_module you get errors due to undefined symbols. The reading of the file
768765
- # below into a SYMBOLS_LIST variable is a temporary workaround that exports the undefined
769766
- # symbols from the shared library, until it can be determined why they are not being exported already.
770767
- file(READ "${CMAKE_SOURCE_DIR}/lib/Interpreter/exports.ld" SYMBOLS_LIST)
771-
-
768+
-
772769
- # Replace newlines with spaces
773770
- string(REPLACE "\n" " " SYMBOLS_LIST "${SYMBOLS_LIST}")
774771
-

0 commit comments

Comments
 (0)