mirror of
https://github.com/Kitware/CMake.git
synced 2026-11-06 05:16:58 +00:00
31 lines
827 B
CMake
31 lines
827 B
CMake
cmake_minimum_required(VERSION 4.2)
|
|
|
|
set(CMAKE_EXPERIMENTAL_RUST "628f8f9f-d7dc-4a06-9aaf-d4ede4426ddf")
|
|
|
|
project(RustMix LANGUAGES C CXX Rust)
|
|
|
|
add_library(rs_staticlib STATIC rs_staticlib.rs)
|
|
add_library(rs_cdylib SHARED rs_cdylib.rs)
|
|
add_library(rs_rlib OBJECT rs_rlib.rs)
|
|
|
|
add_library(c_static STATIC c_static.c)
|
|
add_library(c_shared SHARED c_shared.c)
|
|
add_library(c_obj OBJECT c_obj.c)
|
|
|
|
add_library(cpp_shared SHARED cpp_shared.cpp)
|
|
# Note: trying to link a C++ object file or static library into the Rust
|
|
# executable currently fails with errors related to missing symbols from
|
|
# libstdc++, while libstdc++ is present on the linker command line.
|
|
|
|
add_executable(RustMix main.rs)
|
|
target_link_libraries(
|
|
RustMix
|
|
rs_staticlib
|
|
rs_cdylib
|
|
rs_rlib
|
|
c_static
|
|
c_shared
|
|
c_obj
|
|
cpp_shared
|
|
)
|