File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,7 +10,23 @@ elseif(WIN32)
1010 set (SYSTEM_LIBS ntdll ws2_32)
1111endif ()
1212
13- set (TARGET_PATH "${CMAKE_SOURCE_DIR} /../target" )
13+ if (CMAKE_CROSSCOMPILING AND NOT DEFINED RUST_TARGET)
14+ if (WIN32 AND MINGW AND CMAKE_SIZEOF_VOID_P EQUAL 8)
15+ set (RUST_TARGET "x86_64-pc-windows-gnu" )
16+ elseif (WIN32 AND MINGW AND CMAKE_SIZEOF_VOID_P EQUAL 4)
17+ set (RUST_TARGET "i686-pc-windows-gnu" )
18+ else ()
19+ message (FATAL_ERROR "Cross-compiling without RUST_TARGET set, and an appropriate value could not be set automatically!" )
20+ endif ()
21+ endif ()
22+
23+ if (DEFINED RUST_TARGET)
24+ message (STATUS "Building for Rust target ${RUST_TARGET} " )
25+ set (TARGET_PATH "${PROJECT_SOURCE_DIR} /../target/${RUST_TARGET} " )
26+ else ()
27+ set (TARGET_PATH "${PROJECT_SOURCE_DIR} /../target" )
28+ endif ()
29+
1430set (LIBLOADORDER_FFI_LIB_NAME "${CMAKE_STATIC_LIBRARY_PREFIX} loadorder_ffi${CMAKE_STATIC_LIBRARY_SUFFIX} " )
1531
1632add_library (libloadorder_ffi INTERFACE )
You can’t perform that action at this time.
0 commit comments