[libcamera-devel,v2] build: Add 'std=c++11' cpp compiler flag

Message ID 1544625145-8021-1-git-send-email-jacopo@jmondi.org
State Accepted
Headers show
Series
  • [libcamera-devel,v2] build: Add 'std=c++11' cpp compiler flag
Related show

Commit Message

Jacopo Mondi Dec. 12, 2018, 2:32 p.m. UTC
Building the current master branch fails with:
./src/libcamera/include/log.h:25:34:
   error: defaulted and deleted functions only available with -std=c++11 \
   or -std=gnu++11 [-Werror]
   LogMessage(const LogMessage&) = delete;

Fix this by adding the 'std=c++11' compiler argument for to the list of
cpp build flags.

Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
---
v2 -> v1:
- As suggested by Kieran, add 'std=c++11' argument to the global
  cpp_arguments variable

---
 meson.build | 1 +
 1 file changed, 1 insertion(+)

--
2.7.4

Comments

Laurent Pinchart Dec. 12, 2018, 6:30 p.m. UTC | #1
Hi Jacopo,

Thank you for the patch.

On Wednesday, 12 December 2018 16:32:25 EET Jacopo Mondi wrote:
> Building the current master branch fails with:
> ./src/libcamera/include/log.h:25:34:
>    error: defaulted and deleted functions only available with -std=c++11 \
>    or -std=gnu++11 [-Werror]
>    LogMessage(const LogMessage&) = delete;
> 
> Fix this by adding the 'std=c++11' compiler argument for to the list of
> cpp build flags.

You may want to add compiler information to the commit message.

> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
> v2 -> v1:
> - As suggested by Kieran, add 'std=c++11' argument to the global
>   cpp_arguments variable

Don't forget to remove this before pushing.

> ---
>  meson.build | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/meson.build b/meson.build
> index 2fdb166..7b6e2fe 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -17,6 +17,7 @@ common_arguments = [
> 
>  c_arguments = common_arguments
>  cpp_arguments = common_arguments
> +cpp_arguments += '-std=c++11'
> 
>  add_project_arguments(c_arguments, language: 'c')
>  add_project_arguments(cpp_arguments, language: 'cpp')

Patch

diff --git a/meson.build b/meson.build
index 2fdb166..7b6e2fe 100644
--- a/meson.build
+++ b/meson.build
@@ -17,6 +17,7 @@  common_arguments = [

 c_arguments = common_arguments
 cpp_arguments = common_arguments
+cpp_arguments += '-std=c++11'

 add_project_arguments(c_arguments, language: 'c')
 add_project_arguments(cpp_arguments, language: 'cpp')