Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
cookbook
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
redox-os
cookbook
Commits
c5979ec5
Commit
c5979ec5
authored
1 year ago
by
Ron Williams
Browse files
Options
Downloads
Patches
Plain Diff
add debug option and disable strip if desired
parent
ca86a9d1
No related branches found
Branches containing commit
No related tags found
1 merge request
!340
add debug option and disable strip if desired
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/bin/cook.rs
+17
-6
17 additions, 6 deletions
src/bin/cook.rs
with
17 additions
and
6 deletions
src/bin/cook.rs
+
17
−
6
View file @
c5979ec5
...
@@ -444,6 +444,16 @@ export PKG_CONFIG_PATH=
...
@@ -444,6 +444,16 @@ export PKG_CONFIG_PATH=
export PKG_CONFIG_LIBDIR="${COOKBOOK_SYSROOT}/lib/pkgconfig"
export PKG_CONFIG_LIBDIR="${COOKBOOK_SYSROOT}/lib/pkgconfig"
export PKG_CONFIG_SYSROOT_DIR="${COOKBOOK_SYSROOT}"
export PKG_CONFIG_SYSROOT_DIR="${COOKBOOK_SYSROOT}"
# To build the debug version of a Cargo program, add COOKBOOK_DEBUG=true, and
# to not strip symbols from the final package, add COOKBOOK_NOSTRIP=true to the recipe
# (or to your environment) before calling cookbook_cargo or cookbook_cargo_packages
build_type=release
if [ ! -z "${COOKBOOK_DEBUG}" ]
then
install_flags=--debug
build_type=debug
fi
# cargo template
# cargo template
COOKBOOK_CARGO="${COOKBOOK_REDOXER}"
COOKBOOK_CARGO="${COOKBOOK_REDOXER}"
function cookbook_cargo {
function cookbook_cargo {
...
@@ -452,6 +462,7 @@ function cookbook_cargo {
...
@@ -452,6 +462,7 @@ function cookbook_cargo {
--root "${COOKBOOK_STAGE}/usr" \
--root "${COOKBOOK_STAGE}/usr" \
--locked \
--locked \
--no-track \
--no-track \
${install_flags} \
"$@"
"$@"
}
}
...
@@ -463,10 +474,10 @@ function cookbook_cargo_examples {
...
@@ -463,10 +474,10 @@ function cookbook_cargo_examples {
"${COOKBOOK_CARGO}" build \
"${COOKBOOK_CARGO}" build \
--manifest-path "${COOKBOOK_SOURCE}/Cargo.toml" \
--manifest-path "${COOKBOOK_SOURCE}/Cargo.toml" \
--example "${example}" \
--example "${example}" \
--
release
--
${build_type}
mkdir -pv "${COOKBOOK_STAGE}/usr/bin"
mkdir -pv "${COOKBOOK_STAGE}/usr/bin"
cp -v \
cp -v \
"target/${TARGET}/
release
/examples/${example}" \
"target/${TARGET}/
${build_type}
/examples/${example}" \
"${COOKBOOK_STAGE}/usr/bin/${recipe}_${example}"
"${COOKBOOK_STAGE}/usr/bin/${recipe}_${example}"
done
done
}
}
...
@@ -479,10 +490,10 @@ function cookbook_cargo_packages {
...
@@ -479,10 +490,10 @@ function cookbook_cargo_packages {
"${COOKBOOK_CARGO}" build \
"${COOKBOOK_CARGO}" build \
--manifest-path "${COOKBOOK_SOURCE}/Cargo.toml" \
--manifest-path "${COOKBOOK_SOURCE}/Cargo.toml" \
--package "${package}" \
--package "${package}" \
--
release
--
${build_type}
mkdir -pv "${COOKBOOK_STAGE}/usr/bin"
mkdir -pv "${COOKBOOK_STAGE}/usr/bin"
cp -v \
cp -v \
"target/${TARGET}/
release
/${package}" \
"target/${TARGET}/
${build_type}
/${package}" \
"${COOKBOOK_STAGE}/usr/bin/${recipe}_${package}"
"${COOKBOOK_STAGE}/usr/bin/${recipe}_${package}"
done
done
}
}
...
@@ -506,12 +517,12 @@ function cookbook_configure {
...
@@ -506,12 +517,12 @@ function cookbook_configure {
let
post_script
=
r#"# Common post script
let
post_script
=
r#"# Common post script
# Strip binaries
# Strip binaries
if [ -d "${COOKBOOK_STAGE}/bin" ]
if [ -d "${COOKBOOK_STAGE}/bin" ]
&& [ -z "${COOKBOOK_NOSTRIP}" ]
then
then
find "${COOKBOOK_STAGE}/bin" -type f -exec "${TARGET}-strip" -v {} ';'
find "${COOKBOOK_STAGE}/bin" -type f -exec "${TARGET}-strip" -v {} ';'
fi
fi
if [ -d "${COOKBOOK_STAGE}/usr/bin" ]
if [ -d "${COOKBOOK_STAGE}/usr/bin" ]
&& [ -z "${COOKBOOK_NOSTRIP}" ]
then
then
find "${COOKBOOK_STAGE}/usr/bin" -type f -exec "${TARGET}-strip" -v {} ';'
find "${COOKBOOK_STAGE}/usr/bin" -type f -exec "${TARGET}-strip" -v {} ';'
fi
fi
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment