Devolutions / Devolutions/CMakeRust

Linking broken on Linux x86-64?

Đang mở
#13 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
CMake
Star
175
Fork
30
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

The included example `hello` binary seems to be disabled. After enabling it...:

```
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 52419eb..d033346 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,6 +7,7 @@ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
enable_language(Rust)
include(CMakeCargo)

+add_subdirectory(hello)
add_subdirectory(hello_world)
add_subdirectory(crates)
```

an object file is generated but no linked executable:
```
$ find build/hello
build/hello
build/hello/Makefile
build/hello/CMakeFiles
build/hello/CMakeFiles/hello.dir
build/hello/CMakeFiles/hello.dir/link.txt
build/hello/CMakeFiles/hello.dir/flags.make
build/hello/CMakeFiles/hello.dir/hello.rs.o
build/hello/CMakeFiles/hello.dir/depend.internal
build/hello/CMakeFiles/hello.dir/cmake_clean.cmake
build/hello/CMakeFiles/hello.dir/build.make
build/hello/CMakeFiles/hello.dir/DependInfo.cmake
build/hello/CMakeFiles/hello.dir/progress.make
build/hello/CMakeFiles/hello.dir/depend.make
build/hello/CMakeFiles/CMakeDirectoryInformation.cmake
build/hello/CMakeFiles/progress.marks
build/hello/cmake_install.cmake
```

It looks like the link step is just echoing some commands. Am I missing something?

```
CMakeRust/build/hello$ make VERBOSE=1
cd /home/jnewsome/src/CMakeRust/build && /usr/bin/cmake -H/home/jnewsome/src/CMakeRust -B/home/jnewsome/src/CMakeRust/build --check-build-system CMakeFiles/Makefile.cmake 0
cd /home/jnewsome/src/CMakeRust/build && /usr/bin/cmake -E cmake_progress_start /home/jnewsome/src/CMakeRust/build/CMakeFiles /home/jnewsome/src/CMakeRust/build/hello/CMakeFiles/progress.marks
cd /home/jnewsome/src/CMakeRust/build && make -f CMakeFiles/Makefile2 hello/all
make[1]: Entering directory '/home/jnewsome/src/CMakeRust/build'
make -f hello/CMakeFiles/hello.dir/build.make hello/CMakeFiles/hello.dir/depend
make[2]: Entering directory '/home/jnewsome/src/CMakeRust/build'
cd /home/jnewsome/src/CMakeRust/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/jnewsome/src/CMakeRust /home/jnewsome/src/CMakeRust/hello /home/jnewsome/src/CMakeRust/build /home/jnewsome/src/CMakeRust/build/hello /home/jnewsome/src/CMakeRust/build/hello/CMakeFiles/hello.dir/DependInfo.cmake --color=
make[2]: Leaving directory '/home/jnewsome/src/CMakeRust/build'
make -f hello/CMakeFiles/hello.dir/build.make hello/CMakeFiles/hello.dir/build
make[2]: Entering directory '/home/jnewsome/src/CMakeRust/build'
[ 50%] Building Rust object hello/CMakeFiles/hello.dir/hello.rs.o
cd /home/jnewsome/src/CMakeRust/build/hello && echo "CMAKE_Rust_COMPILE_OBJECT"
CMAKE_Rust_COMPILE_OBJECT
cd /home/jnewsome/src/CMakeRust/build/hello && echo "TARGET: hello TARGET_BASE: hello OBJECT: CMakeFiles/hello.dir/hello.rs.o OBJECTS: OBJECTS OBJECT_DIR: CMakeFiles/hello.dir SOURCE: /home/jnewsome/src/CMakeRust/hello/hello.rs SOURCES: SOURCES LINK_LIBRARIES: LINK_LIBRARIES FLAGS: LINK_FLAGS: LINK_FLAGS "
TARGET: hello TARGET_BASE: hello OBJECT: CMakeFiles/hello.dir/hello.rs.o OBJECTS: OBJECTS OBJECT_DIR: CMakeFiles/hello.dir SOURCE: /home/jnewsome/src/CMakeRust/hello/hello.rs SOURCES: SOURCES LINK_LIBRARIES: LINK_LIBRARIES FLAGS: LINK_FLAGS: LINK_FLAGS
cd /home/jnewsome/src/CMakeRust/build/hello && /home/jnewsome/.cargo/bin/rustc --emit obj /home/jnewsome/src/CMakeRust/hello/hello.rs -o CMakeFiles/hello.dir/hello.rs.o
[100%] Linking Rust executable hello
cd /home/jnewsome/src/CMakeRust/build/hello && /usr/bin/cmake -E cmake_link_script CMakeFiles/hello.dir/link.txt --verbose=1
echo "CMAKE_Rust_LINK_EXECUTABLE"
CMAKE_Rust_LINK_EXECUTABLE
echo "TARGET: hello TARGET_BASE: hello OBJECT: OBJECT OBJECTS: CMakeFiles/hello.dir/hello.rs.o OBJECT_DIR: CMakeFiles/hello.dir SOURCE: SOURCE SOURCES: SOURCES LINK_LIBRARIES: FLAGS: LINK_FLAGS: "
TARGET: hello TARGET_BASE: hello OBJECT: OBJECT OBJECTS: CMakeFiles/hello.dir/hello.rs.o OBJECT_DIR: CMakeFiles/hello.dir SOURCE: SOURCE SOURCES: SOURCES LINK_LIBRARIES: FLAGS: LINK_FLAGS:
make[2]: Leaving directory '/home/jnewsome/src/CMakeRust/build'
[100%] Built target hello
make[1]: Leaving directory '/home/jnewsome/src/CMakeRust/build'
/usr/bin/cmake -E cmake_progress_start /home/jnewsome/src/CMakeRust/build/CMakeFiles 0
```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.