Skip to content

Commit 4cb2bef

Browse files
committed
tooling: Add BUILD_TYPE argument to Makefile
1 parent dd14422 commit 4cb2bef

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

Makefile.package

+17-16
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,11 @@ BUILD_LAYOUT := ${PROJECT_ROOT}/.conan-layout.ini
4141
BUILD_POLICY := missing
4242

4343
# Normally, you should set this in your profile, but if you just want to build
44-
# the package in debug mode once, you can do it this way.
44+
# the package in debug mode once, you can do it this way, although it will
45+
# only apply to local builds.
4546
#
4647
# This can be one of: None, Debug, Release, RelWithDebInfo, MinSizeRel
48+
BUILD_TYPE := RelWithDebInfo
4749
DEBUG_BUILD_TYPE := Debug
4850

4951
PACKAGE_NAME := $(shell sed -rn 's/.*name\s*=\s*"([^"]+)"$$/\1/p' ${SOURCE_CONANFILE})
@@ -101,6 +103,7 @@ help:
101103
echo " SOURCE_DIR: ${SOURCE_DIR}"
102104
echo " BUILD_DIR: ${BUILD_DIR}"
103105
echo " BUILD_POLICY: ${BUILD_POLICY}"
106+
echo " BUILD_TYPE: ${BUILD_TYPE}"
104107
echo " CONAN_OPTIONS: ${CONAN_OPTIONS}"
105108
echo
106109
echo "Package information:"
@@ -176,15 +179,19 @@ package:
176179
#
177180
# See: https://docs.conan.io/en/latest/mastering/policies.html
178181
#
179-
conan create . ${PACKAGE_CHANNEL} --build=${BUILD_POLICY} --build=${PACKAGE_NAME} ${CONAN_OPTIONS}
182+
conan create . ${PACKAGE_CHANNEL} \
183+
--build=${BUILD_POLICY} --build=${PACKAGE_NAME} \
184+
${CONAN_OPTIONS}
180185

181186
package-all:
182187
# Build the package in Conan cache unconditionally.
183188
#
184189
# Conan will retrieve and build all dependencies unconditionally.
185190
# Note that this cannot be called if the package is currently in editable mode.
186191
#
187-
conan create . ${PACKAGE_CHANNEL} --build ${CONAN_OPTIONS}
192+
conan create . ${PACKAGE_CHANNEL} \
193+
--build \
194+
${CONAN_OPTIONS}
188195

189196
package-outdated:
190197
# Build the package in Conan cache if it is outdated.
@@ -193,18 +200,9 @@ package-outdated:
193200
# Rebuilds will occur if package info has changed or a hash of the source
194201
# code changes. Timestamps are not taken into account.
195202
#
196-
conan create . ${PACKAGE_CHANNEL} --build=outdated ${CONAN_OPTIONS}
197-
198-
package-debug:
199-
# Build the package in Conan cache unconditionally in debug mode.
200-
#
201-
# Conan will retrieve and build all dependencies based on the build policy.
202-
# Note that this cannot be called if the package is currently in editable mode.
203-
#
204-
# See: https://docs.conan.io/en/latest/mastering/policies.html
205-
# See: https://docs.conan.io/en/latest/using_packages/debugging.html
206-
#
207-
conan create . ${PACKAGE_CHANNEL} -s build_type=${DEBUG_BUILD_TYPE} --build=${BUILD_POLICY} --build=${PACKAGE_NAME} ${CONAN_OPTIONS}
203+
conan create . ${PACKAGE_CHANNEL} \
204+
--build=outdated \
205+
${CONAN_OPTIONS}
208206

209207
purge:
210208
# Remove all instances of this package in the Conan cache.
@@ -277,7 +275,10 @@ ${BUILD_CONANINFO}: ${SOURCE_CONANFILE}
277275
# Install package dependencies and prepare in-source build.
278276
#
279277
mkdir -p ${BUILD_DIR}
280-
conan install . --install-folder=${BUILD_DIR} --build=${BUILD_POLICY} ${CONAN_OPTIONS}
278+
conan install . --install-folder=${BUILD_DIR} \
279+
-s ${PACKAGE_NAME}:build_type=${BUILD_TYPE} \
280+
--build=${BUILD_POLICY} \
281+
${CONAN_OPTIONS}
281282
touch ${BUILD_CONANINFO}
282283

283284
${BUILD_CMAKECACHE}: ${BUILD_CONANINFO} ${SOURCE_CMAKELISTS}

0 commit comments

Comments
 (0)