Devolutions / Devolutions/CMakeRust

Windows build fails (using MinGW toolchain)

Open
#11 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
CMake
Stars
175
Forks
30
PR merge metrics
No merged PRs in 30d

Description

I am getting a build error, from CLion using the MinGW toolchain, on Windows only. Builds on Mac without issues.

```
mingw32-make.exe[2]: *** No rule to make target 'my-lib/x86_64-pc-windows-msvc/debug/libmy_lib.a', needed by '/my-app.exe'. Stop.
mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:96: /CMakeFiles/APP.dir/all] Error 2
```

It seems to be looking for a `libmy_lib.a`, when what is generated is `my_lib.lib`.

I have a top level `CMakeLists.txt`:
```cmake
cmake_minimum_required(VERSION 3.14)
project(app)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")

enable_language(Rust)
include(CMakeCargo)

include_directories("include")

add_subdirectory("my-app")
add_subdirectory("my-lib")

target_link_libraries(APP PRIVATE
my_lib
$<$:ws2_32>
$<$:userenv>
)

```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.