[Openvpn-devel,4/5] CMake: Add /Brepro to MSVC link options

Message ID 20230620135310.94455-5-frank@lichtenheld.com
State Accepted
Headers show
Series Switch to CMake for Windows builds | expand

Commit Message

Frank Lichtenheld June 20, 2023, 1:53 p.m. UTC
So that we get reproducible builds.

Change-Id: Iffdd3ac5f266cc7d592ab678afc14c122acbb351
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
---
 CMakeLists.txt | 1 +
 1 file changed, 1 insertion(+)

Comments

Lev Stipakov June 27, 2023, 7:59 a.m. UTC | #1
Hi,

Interesting that MSFT hasn't been able to document this flag for almost 4 years:

https://developercommunity.visualstudio.com/t/document-brepro-flag/731265

I checked that the flag is indeed passed to the linker command line but haven't
tested that binaries are indeed identical.

Acked-by: Lev Stipakov <lstipakov@gmail.com>


ti 20. kesäk. 2023 klo 16.54 Frank Lichtenheld (frank@lichtenheld.com)
kirjoitti:
>
> So that we get reproducible builds.
>
> Change-Id: Iffdd3ac5f266cc7d592ab678afc14c122acbb351
> Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
> ---
>  CMakeLists.txt | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/CMakeLists.txt b/CMakeLists.txt
> index bdbc87b8..3cbba5a3 100644
> --- a/CMakeLists.txt
> +++ b/CMakeLists.txt
> @@ -56,6 +56,7 @@ if (MSVC)
>          "$<$<CONFIG:Release>:/Zi>"
>          )
>      add_link_options(
> +        /Brepro
>          "$<$<CONFIG:Release>:/LTCG:incremental>"
>          "$<$<CONFIG:Release>:/DEBUG:FULL>"
>          "$<$<CONFIG:Release>:/OPT:REF>"
> --
> 2.34.1
>
>
>
> _______________________________________________
> Openvpn-devel mailing list
> Openvpn-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/openvpn-devel
Gert Doering June 27, 2023, 8:32 p.m. UTC | #2
Whatever this does, it only affecst Windows builds, and both GHA and
Lev agree that it still works...

Your patch has been applied to the master branch.

commit 5e94e8de4bfaf6637124947a3489710b591e5e26
Author: Frank Lichtenheld
Date:   Tue Jun 20 15:53:09 2023 +0200

     CMake: Add /Brepro to MSVC link options

     Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
     Acked-by: Lev Stipakov <lstipakov@gmail.com>
     Message-Id: <20230620135310.94455-5-frank@lichtenheld.com>
     URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg26757.html
     Signed-off-by: Gert Doering <gert@greenie.muc.de>


--
kind regards,

Gert Doering

Patch

diff --git a/CMakeLists.txt b/CMakeLists.txt
index bdbc87b8..3cbba5a3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -56,6 +56,7 @@  if (MSVC)
         "$<$<CONFIG:Release>:/Zi>"
         )
     add_link_options(
+        /Brepro
         "$<$<CONFIG:Release>:/LTCG:incremental>"
         "$<$<CONFIG:Release>:/DEBUG:FULL>"
         "$<$<CONFIG:Release>:/OPT:REF>"