[opus] Opus cmake build

Marcus Asteborg xnorpx at outlook.com
Thu Apr 11 17:17:01 UTC 2019


Hi Christian Adam,

Thanks for pointing this out, I made the necessary changes to account for this.

So the behavior is as follows:

  *
If no CMAKE_BUILD_TYPE is set and no CFLAGS are set it will default to Release. i.e ( cmake .. )
  *
If a developer want full control then use export CFLAGS in leave CMAKE_BUILD_TYPE empty.
  *
If a developer want to test CFLAGS in combination with CMAKE_BUILD_TYPE one has to specify CMAKE_BUILD_TYPE and export the CFLAGS

https://github.com/xiph/opus/pull/118
[https://avatars0.githubusercontent.com/u/8365509?s=400&v=4]<https://github.com/xiph/opus/pull/118>

CMake - If CMAKE_BUILD_TYPE is empty and CFlags are set then only use… by xnorpx · Pull Request #118 · xiph/opus<https://github.com/xiph/opus/pull/118>
CMake - If CMAKE_BUILD_TYPE is empty and CFlags are set then only use CFlags. If None are set then use CMAKE_BUILD_TYPE by Release by default.
github.com

//Marcus

________________________________
From: Cristian Adam <cristian.adam at gmail.com>
Sent: Thursday, April 11, 2019 00:30
To: Marcus Asteborg
Cc: Mark Harris; opus at xiph.org
Subject: Re: [opus] Opus cmake build

On Wed, Apr 10, 2019 at 5:30 PM Marcus Asteborg <xnorpx at outlook.com<mailto:xnorpx at outlook.com>> wrote:
Hi Mark,

Thanks for the feedback.

By default CMake is building the static library in debug, to get other things one has to explicit turn it on.


Hi,

By default CMake uses the "empty" build, which is used in combination with the environment variables CFLAGS and CXXFLAGS.

This build type is targeted at Linux distributions which want to use the same compiler flags for multiple packages.

If you want to change the default build type to something else when CMAKE_BUILD_TYPE is empty, make sure that you do that when $ENV{CFLAGS} and $ENV{CXXFLAGS} are not set.

There is a blog entry at Kitware https://blog.kitware.com/cmake-and-the-default-build-type/<https://nam04.safelinks.protection.outlook.com/?url=https%3A%2F%2Fblog.kitware.com%2Fcmake-and-the-default-build-type%2F&data=02%7C01%7C%7C0fdff823fe65421696db08d6be4f8a76%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636905646161553123&sdata=dcGdrZYlPvnZ1x9Rgvj8%2BxbKkEn1HP9xOCnoMYlqIco%3D&reserved=0> on this topic. Unfortunately it doesn't address the  CFLAGS, CXXFLAGS issue. I guess one can combine the both and have an optimal solution.

Cheers,
Cristian.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xiph.org/pipermail/opus/attachments/20190411/4fd16178/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-CMake-If-CMAKE_BUILD_TYPE-is-empty-and-CFlags-are-se.patch
Type: application/octet-stream
Size: 2612 bytes
Desc: 0001-CMake-If-CMAKE_BUILD_TYPE-is-empty-and-CFlags-are-se.patch
URL: <http://lists.xiph.org/pipermail/opus/attachments/20190411/4fd16178/attachment.obj>


More information about the opus mailing list