[x265] [PATCH v2 6/6] CMake: Statically link libstdc++ when STATIC_LINK_CRT=ON
Mahesh Pittala
mahesh at multicorewareinc.com
Thu Nov 7 10:40:25 UTC 2024
Pushed 6 patches to the master and release4.1 branches.
On Wed, Nov 6, 2024 at 9:07 PM Hari Limaye <hari.limaye at arm.com> wrote:
> Add -static-libstdc++ when compiling with STATIC_LINK_CRT=ON.
> ---
> source/CMakeLists.txt | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
> index 5c1ae2359..310683909 100755
> --- a/source/CMakeLists.txt
> +++ b/source/CMakeLists.txt
> @@ -28,7 +28,7 @@ include(CheckCXXSourceCompiles)
> option(FPROFILE_GENERATE "Compile executable to generate usage data" OFF)
> option(FPROFILE_USE "Compile executable using generated usage data" OFF)
> option(NATIVE_BUILD "Target the build CPU" OFF)
> -option(STATIC_LINK_CRT "Statically link C runtime for release builds" OFF)
> +option(STATIC_LINK_CRT "Statically link C and C++ runtimes for release
> builds" OFF)
> mark_as_advanced(FPROFILE_USE FPROFILE_GENERATE NATIVE_BUILD)
> # X265_BUILD must be incremented each time the public API is changed
> set(X265_BUILD 213)
> @@ -446,7 +446,7 @@ int main() { return 0; }")
> endif(FPROFILE_USE)
> if(STATIC_LINK_CRT)
> add_definitions(-static)
> - list(APPEND LINKER_OPTIONS "-static-libgcc")
> + list(APPEND LINKER_OPTIONS "-static-libgcc -static-libstdc++")
> endif(STATIC_LINK_CRT)
> check_cxx_compiler_flag(-Wno-strict-overflow
> CC_HAS_NO_STRICT_OVERFLOW)
> check_cxx_compiler_flag(-Wno-narrowing CC_HAS_NO_NARROWING)
> --
> 2.42.1
>
> _______________________________________________
> x265-devel mailing list
> x265-devel at videolan.org
> https://mailman.videolan.org/listinfo/x265-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/x265-devel/attachments/20241107/70277996/attachment.htm>
More information about the x265-devel
mailing list