Skip to content

Commit

Permalink
bootstrap: embed manifest only when targeting windows (#384)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kojoley authored May 21, 2024
1 parent fe69c24 commit 0c9c980
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
13 changes: 10 additions & 3 deletions src/engine/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -506,9 +506,16 @@ mod_version.cpp \
if test_true ${B2_DEBUG_OPT} ; then B2_CXXFLAGS="${B2_CXXFLAGS_DEBUG}"
else B2_CXXFLAGS="${B2_CXXFLAGS_RELEASE} -DNDEBUG"
fi
if [ -z "$B2_DONT_EMBED_MANIFEST" ] && [ -x "$(command -v windres)" ] ; then
B2_CXXFLAGS="${B2_CXXFLAGS} -Wl,res.o"
( B2_VERBOSE_OPT=${TRUE} echo_run windres --input res.rc --output res.o )
if [ -z "$B2_DONT_EMBED_MANIFEST" ] ; then
case "$(${B2_CXX} ${B2_CXXFLAGS} -dumpmachine 2>/dev/null)" in
*-windows*|*-mingw*|*-msys*|*-cygnus*|*-cygwin*)
WINDRES="$(${B2_CXX} ${B2_CXXFLAGS} -print-prog-name=windres 2>/dev/null)"
;;
esac
if [ -n "${WINDRES}" ] ; then
B2_CXXFLAGS="${B2_CXXFLAGS} -Wl,res.o"
( B2_VERBOSE_OPT=${TRUE} echo_run ${WINDRES} --input res.rc --output res.o )
fi
fi
( B2_VERBOSE_OPT=${TRUE} echo_run ${B2_CXX} ${B2_CXXFLAGS} ${B2_SOURCES} -o b2 )
}
Expand Down
5 changes: 3 additions & 2 deletions src/engine/config_toolset.bat
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,8 @@ goto :eof

:Embed_Minafest_Via_Windres
if not defined B2_DONT_EMBED_MANIFEST (
where windres >NUL 2>NUL
if errorlevel 1 ( call; ) else ( set "B2_CXX=windres --input res.rc --output res.o && %B2_CXX% -Wl,res.o" )
for /f %%i in ('%B2_CXX% --print-prog-name=windres 2^>NUL') do (
set "B2_CXX="%%i" --input res.rc --output res.o && %B2_CXX% -Wl,res.o"
)
)
goto :eof

0 comments on commit 0c9c980

Please sign in to comment.