diff --git a/Makefile.package b/Makefile.package index b06d06d57..5493499f0 100644 --- a/Makefile.package +++ b/Makefile.package @@ -41,9 +41,11 @@ BUILD_LAYOUT := ${PROJECT_ROOT}/.conan-layout.ini BUILD_POLICY := missing # Normally, you should set this in your profile, but if you just want to build -# the package in debug mode once, you can do it this way. +# the package in debug mode once, you can do it this way, although it will +# only apply to local builds. # # This can be one of: None, Debug, Release, RelWithDebInfo, MinSizeRel +BUILD_TYPE := RelWithDebInfo DEBUG_BUILD_TYPE := Debug PACKAGE_NAME := $(shell sed -rn 's/.*name\s*=\s*"([^"]+)"$$/\1/p' ${SOURCE_CONANFILE}) @@ -101,6 +103,7 @@ help: echo " SOURCE_DIR: ${SOURCE_DIR}" echo " BUILD_DIR: ${BUILD_DIR}" echo " BUILD_POLICY: ${BUILD_POLICY}" + echo " BUILD_TYPE: ${BUILD_TYPE}" echo " CONAN_OPTIONS: ${CONAN_OPTIONS}" echo echo "Package information:" @@ -176,7 +179,9 @@ package: # # See: https://docs.conan.io/en/latest/mastering/policies.html # - conan create . ${PACKAGE_CHANNEL} --build=${BUILD_POLICY} --build=${PACKAGE_NAME} ${CONAN_OPTIONS} + conan create . ${PACKAGE_CHANNEL} \ + --build=${BUILD_POLICY} --build=${PACKAGE_NAME} \ + ${CONAN_OPTIONS} package-all: # Build the package in Conan cache unconditionally. @@ -184,7 +189,9 @@ package-all: # Conan will retrieve and build all dependencies unconditionally. # Note that this cannot be called if the package is currently in editable mode. # - conan create . ${PACKAGE_CHANNEL} --build ${CONAN_OPTIONS} + conan create . ${PACKAGE_CHANNEL} \ + --build \ + ${CONAN_OPTIONS} package-outdated: # Build the package in Conan cache if it is outdated. @@ -193,18 +200,9 @@ package-outdated: # Rebuilds will occur if package info has changed or a hash of the source # code changes. Timestamps are not taken into account. # - conan create . ${PACKAGE_CHANNEL} --build=outdated ${CONAN_OPTIONS} - -package-debug: - # Build the package in Conan cache unconditionally in debug mode. - # - # Conan will retrieve and build all dependencies based on the build policy. - # Note that this cannot be called if the package is currently in editable mode. - # - # See: https://docs.conan.io/en/latest/mastering/policies.html - # See: https://docs.conan.io/en/latest/using_packages/debugging.html - # - conan create . ${PACKAGE_CHANNEL} -s build_type=${DEBUG_BUILD_TYPE} --build=${BUILD_POLICY} --build=${PACKAGE_NAME} ${CONAN_OPTIONS} + conan create . ${PACKAGE_CHANNEL} \ + --build=outdated \ + ${CONAN_OPTIONS} purge: # Remove all instances of this package in the Conan cache. @@ -277,7 +275,10 @@ ${BUILD_CONANINFO}: ${SOURCE_CONANFILE} # Install package dependencies and prepare in-source build. # mkdir -p ${BUILD_DIR} - conan install . --install-folder=${BUILD_DIR} --build=${BUILD_POLICY} ${CONAN_OPTIONS} + conan install . --install-folder=${BUILD_DIR} \ + -s ${PACKAGE_NAME}:build_type=${BUILD_TYPE} \ + --build=${BUILD_POLICY} \ + ${CONAN_OPTIONS} touch ${BUILD_CONANINFO} ${BUILD_CMAKECACHE}: ${BUILD_CONANINFO} ${SOURCE_CMAKELISTS}