Skip to content

Commit

Permalink
Replace /MT flag with MSVC_RUNTIME_LIBRARY=MultiThreaded when buildin…
Browse files Browse the repository at this point in the history
…g for windows (#894)

Motivation:

We should use the CMAKE specific flag when building

Modifications:

Replace /MT with MSVC_RUNTIME_LIBRARY=MultiThreaded

Result:

Cleanup of build
  • Loading branch information
normanmaurer authored Oct 28, 2024
1 parent 3ff115c commit 1339812
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions boringssl-static/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,10 @@
<if>
<equals arg1="${os.detected.name}" arg2="windows" />
<then>
<!-- On Windows, build with /MT for static linking -->
<property name="cmakeAsmFlags" value="" />
<property name="cmakeCFlags" value="/MT" />
<property name="cmakeCFlags" value="" />
<!-- Disable one warning to be able to build on windows -->
<property name="cmakeCxxFlags" value="/MT /wd4091" />
<property name="cmakeCxxFlags" value="/wd4091" />
</then>
<elseif>
<equals arg1="${os.detected.name}" arg2="linux" />
Expand All @@ -233,6 +232,7 @@
<exec executable="cmake" failonerror="true" dir="${boringsslBuildDir}" resolveexecutable="true">
<arg value="-DCMAKE_BUILD_TYPE=Release" />
<arg value="-DCMAKE_POSITION_INDEPENDENT_CODE=TRUE" />
<arg value="-DMSVC_RUNTIME_LIBRARY=MultiThread=MultiThreaded" />
<arg value="-DCMAKE_C_COMPILER=clang" />
<arg value="-DCMAKE_CXX_COMPILER=clang++" />
<arg value="-DFIPS=1" />
Expand Down Expand Up @@ -498,11 +498,10 @@
<if>
<equals arg1="${os.detected.name}" arg2="windows" />
<then>
<!-- On Windows, build with /MT for static linking -->
<property name="cmakeAsmFlags" value="" />
<property name="cmakeCFlags" value="/MT" />
<property name="cmakeCFlags" value="" />
<!-- Disable one warning to be able to build on windows -->
<property name="cmakeCxxFlags" value="/MT /wd4091" />
<property name="cmakeCxxFlags" value="/wd4091" />
</then>
<elseif>
<equals arg1="${os.detected.name}" arg2="linux" />
Expand All @@ -523,6 +522,7 @@
</if>
<exec executable="cmake" failonerror="true" dir="${boringsslHome}" resolveexecutable="true">
<arg value="-DCMAKE_POSITION_INDEPENDENT_CODE=TRUE" />
<arg value="-DMSVC_RUNTIME_LIBRARY=MultiThread=MultiThreaded" />
<arg value="-DCMAKE_BUILD_TYPE=Release" />
<arg value="-DCMAKE_ASM_FLAGS_RELEASE=${cmakeAsmFlags}" />
<arg value="-DCMAKE_C_FLAGS_RELEASE=${cmakeCFlags}" />
Expand Down Expand Up @@ -842,11 +842,10 @@
<if>
<equals arg1="${os.detected.name}" arg2="windows" />
<then>
<!-- On Windows, build with /MT for static linking -->
<property name="cmakeAsmFlags" value="" />
<property name="cmakeCFlags" value="/MT" />
<property name="cmakeCFlags" value="" />
<!-- Disable one warning to be able to build on windows -->
<property name="cmakeCxxFlags" value="/MT /wd4091" />
<property name="cmakeCxxFlags" value="/wd4091" />
</then>
<elseif>
<equals arg1="${os.detected.name}" arg2="linux" />
Expand All @@ -867,6 +866,7 @@
</if>
<exec executable="cmake" failonerror="true" dir="${boringsslHome}" resolveexecutable="true">
<arg value="-DCMAKE_POSITION_INDEPENDENT_CODE=TRUE" />
<arg value="-DMSVC_RUNTIME_LIBRARY=MultiThread=MultiThreaded" />
<arg value="-DCMAKE_BUILD_TYPE=Release" />
<arg value="-DCMAKE_ASM_FLAGS_RELEASE=${cmakeAsmFlags}" />
<arg value="-DCMAKE_C_FLAGS_RELEASE=${cmakeCFlags}" />
Expand Down Expand Up @@ -1300,6 +1300,7 @@
<mkdir dir="${boringsslHome}" />
<exec executable="cmake" failonerror="true" dir="${boringsslHome}" resolveexecutable="true">
<arg value="-DCMAKE_POSITION_INDEPENDENT_CODE=TRUE" />
<arg value="-DMSVC_RUNTIME_LIBRARY=MultiThread=MultiThreaded" />
<arg value="-DCMAKE_BUILD_TYPE=Release" />
<arg value="-DCMAKE_ASM_FLAGS_RELEASE=${cmakeAsmFlags}" />
<arg value="-DCMAKE_C_FLAGS_RELEASE=${cmakeCFlags}" />
Expand Down Expand Up @@ -1547,6 +1548,7 @@
<mkdir dir="${boringsslHome}" />
<exec executable="cmake" failonerror="true" dir="${boringsslHome}" resolveexecutable="true">
<arg value="-DCMAKE_POSITION_INDEPENDENT_CODE=TRUE" />
<arg value="-DMSVC_RUNTIME_LIBRARY=MultiThread=MultiThreaded" />
<arg value="-DCMAKE_BUILD_TYPE=Release" />
<arg value="-DCMAKE_ASM_FLAGS_RELEASE=${cmakeAsmFlags}" />
<arg value="-DCMAKE_C_FLAGS_RELEASE=${cmakeCFlags}" />
Expand Down

0 comments on commit 1339812

Please sign in to comment.