-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Labels
A-linkageArea: linker issues, dylib, cdylib, shared libraries, soArea: linker issues, dylib, cdylib, shared libraries, so
Description
Desired Use
Something like this would allow complete control of the build using only a cross platform cmake script:
build_unix = ["cmake $CARGO_ROOT", "make"]
bulid_windows = ["cmake -G "MinGW Makefiles" $CARGO_ROOT", "mingw32-make"]
- support for platform specific build commands For native builds pass additional build variables in the environment #553
- allow the variables to be used in the build command (would need a new $CARGO_ROOT variable)
- set the current working directory to the $OUT_DIR when invoking the build commands to contain all cmake build files/directories there
Current Use
I am using cmake to check system dependencies and bootstrap/install the required c libraries but have to do something like the following:
[package]
build = "./build.sh"
...#!/bin/bash
ROOT=$PWD
cd $OUT_DIR
cmake -DCMAKE_BUILD_TYPE=release $ROOT
CMAKE_RET=$?
if [ $CMAKE_RET -ne 0 ]; then
exit $CMAKE_RET
fi
make
MAKE_RET=$?
if [ $MAKE_RET -ne 0 ]; then
exit $MAKE_RET
fi
cp $OUT_DIR/lib/* $OUT_DIR
exit $?- save off the root directory and change into $OUT_DIR
- cargo does not expose the profile being built so in this case release is always used For native builds pass additional build variables in the environment #553
- cmake will perform the installs for me using $OUT_DIR as the prefix, however this puts my libs in $OUT_DIR/lib (they are managed via externalproject_add so I cannot easily alter the install hierarchy)
- manually move the libs into $OUT_DIR because the -L cannot be altered Let Cargo packages modify the state of the build environment for other (non dependent) packages. #95 (comment) (this could also be done by the cmake wrapper script)
Metadata
Metadata
Assignees
Labels
A-linkageArea: linker issues, dylib, cdylib, shared libraries, soArea: linker issues, dylib, cdylib, shared libraries, so