1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-30 23:15:39 +00:00

Fix the /bigobj issue and some script cleanup

Surprisingly specific problem I must say, 32-bit vs2015 unity builds
This commit is contained in:
Alexander "Ace" Olofsson 2016-08-28 23:23:44 +02:00
parent aa28166f2e
commit d781846f53
2 changed files with 51 additions and 37 deletions

View file

@ -118,7 +118,7 @@ run_cmd() {
if [ $RET -ne 0 ]; then if [ $RET -ne 0 ]; then
if [ -z $APPVEYOR ]; then if [ -z $APPVEYOR ]; then
echo "Command $CMD failed, output can be found in `real_pwd`/output.log" echo "Command $CMD failed, output can be found in $(real_pwd)/output.log"
else else
echo echo
echo "Command $CMD failed;" echo "Command $CMD failed;"
@ -198,7 +198,7 @@ add_osg_dlls() {
} }
if [ -z $PLATFORM ]; then if [ -z $PLATFORM ]; then
PLATFORM=`uname -m` PLATFORM="$(uname -m)"
fi fi
if [ -z $CONFIGURATION ]; then if [ -z $CONFIGURATION ]; then
@ -283,7 +283,7 @@ echo
mkdir -p deps mkdir -p deps
cd deps cd deps
DEPS="`pwd`" DEPS="$(pwd)"
if [ -z $SKIP_DOWNLOAD ]; then if [ -z $SKIP_DOWNLOAD ]; then
echo "Downloading dependency packages." echo "Downloading dependency packages."
@ -358,7 +358,7 @@ fi
mkdir -p "${BUILD_DIR}/deps" mkdir -p "${BUILD_DIR}/deps"
cd "${BUILD_DIR}/deps" cd "${BUILD_DIR}/deps"
DEPS_INSTALL=`pwd` DEPS_INSTALL="$(pwd)"
cd $DEPS cd $DEPS
echo echo
@ -402,7 +402,7 @@ fi
BOOST_SDK="c:/Libraries/boost_1_60_0" BOOST_SDK="c:/Libraries/boost_1_60_0"
fi fi
add_cmake_opts -DBOOST_ROOT="$BOOST_SDK" \ add_cmake_opts -DBOOST_ROOT="$BOOST_SDK" \
-DBOOST_LIBRARYDIR="$BOOST_SDK/lib${BITS}-msvc-${MSVC_VER}.0" -DBOOST_LIBRARYDIR="${BOOST_SDK}/lib${BITS}-msvc-${MSVC_VER}.0"
echo Done. echo Done.
fi fi
@ -416,7 +416,7 @@ printf "Bullet 2.83.7... "
cd $DEPS_INSTALL cd $DEPS_INSTALL
if [ -d Bullet ]; then if [ -d Bullet ]; then
printf "Exists. (No version checking) " printf -- "Exists. (No version checking) "
elif [ -z $SKIP_EXTRACT ]; then elif [ -z $SKIP_EXTRACT ]; then
rm -rf Bullet rm -rf Bullet
eval 7z x -y "${DEPS}/Bullet-2.83.7-msvc${MSVC_YEAR}-win${BITS}.7z" $STRIP eval 7z x -y "${DEPS}/Bullet-2.83.7-msvc${MSVC_YEAR}-win${BITS}.7z" $STRIP
@ -503,8 +503,8 @@ printf "OpenAL-Soft 1.17.2... "
OPENAL_SDK="$(real_pwd)/openal-soft-1.17.2-bin" OPENAL_SDK="$(real_pwd)/openal-soft-1.17.2-bin"
add_cmake_opts -DOPENAL_INCLUDE_DIR="$OPENAL_SDK/include/AL" \ add_cmake_opts -DOPENAL_INCLUDE_DIR="${OPENAL_SDK}/include/AL" \
-DOPENAL_LIBRARY="$OPENAL_SDK/libs/Win$BITS/OpenAL32.lib" -DOPENAL_LIBRARY="${OPENAL_SD}K/libs/Win${BITS}/OpenAL32.lib"
echo Done. echo Done.
} }
@ -538,10 +538,11 @@ printf "OSG 3.4.0-scrawl... "
SUFFIX="" SUFFIX=""
fi fi
add_runtime_dlls "$(pwd)/OSG/bin/"{OpenThreads,zlib}${SUFFIX}.dll \ add_runtime_dlls "$(pwd)/OSG/bin/"{OpenThreads,zlib,libpng*}${SUFFIX}.dll \
"$(pwd)/OSG/bin/osg"{,Animation,DB,FX,GA,Particle,Text,Util,Viewer}${SUFFIX}.dll "$(pwd)/OSG/bin/osg"{,Animation,DB,FX,GA,Particle,Text,Util,Viewer}${SUFFIX}.dll
add_osg_dlls "$(pwd)/OSG/bin/osgPlugins-3.4.0/osgdb_"{bmp,dds,jpeg,png,tga}${SUFFIX}.dll add_osg_dlls "$(pwd)/OSG/bin/osgPlugins-3.4.0/osgdb_"{bmp,dds,jpeg,osg,png,tga}${SUFFIX}.dll
add_osg_dlls "$(pwd)/OSG/bin/osgPlugins-3.4.0/osgdb_serializers_osg"{,animation,fx,ga,particle,text,util,viewer}${SUFFIX}.dll
echo Done. echo Done.
} }
@ -575,34 +576,36 @@ fi
sed -i "s|INSTALL_DIR|$(real_pwd)/Qt|" qt-install.qs sed -i "s|INSTALL_DIR|$(real_pwd)/Qt|" qt-install.qs
sed -i "s/qt.VERSION.winBITS_msvcYEAR/qt.57.win${BITS}_msvc${MSVC_YEAR}${SUFFIX}/" qt-install.qs sed -i "s/qt.VERSION.winBITS_msvcYEAR/qt.57.win${BITS}_msvc${MSVC_YEAR}${SUFFIX}/" qt-install.qs
printf "(Installation might take a while) " printf -- "(Installation might take a while) "
"${DEPS}/qt-5.7.0-msvc${MSVC_YEAR}-win${BITS}.exe" --script qt-install.qs --silent "${DEPS}/qt-5.7.0-msvc${MSVC_YEAR}-win${BITS}.exe" --script qt-install.qs --silent
mv qt-install.qs Qt/ mv qt-install.qs Qt/
echo Done. echo Done.
printf " Cleaning up extraneous data... " printf " Cleaning up extraneous data... "
rm -r "$(real_pwd)/Qt/"{Docs,Examples,Tools,vcredist,MaintenanceTool.*} rm -r "$(real_pwd)/Qt/"{Docs,Examples,Tools,vcredist,"MaintenanceTool.*"}
fi fi
cd $QT_SDK cd $QT_SDK
add_cmake_opts -DDESIRED_QT_VERSION=5 \ add_cmake_opts -DDESIRED_QT_VERSION=5 \
-DQT_QMAKE_EXECUTABLE="$QT_SDK/bin/qmake.exe" \ -DQT_QMAKE_EXECUTABLE="${QT_SDK}/bin/qmake.exe" \
-DCMAKE_PREFIX_PATH="$QT_SDK" -DCMAKE_PREFIX_PATH="$QT_SDK"
if [ $CONFIGURATION == "Debug" ]; then if [ $CONFIGURATION == "Debug" ]; then
SUFFIX="d" SUFFIX="d"
else
SUFFIX=""
fi fi
add_runtime_dlls "$(pwd)/bin/Qt5"{Core,Gui,Network,OpenGL}$SUFFIX.dll add_runtime_dlls "$(pwd)/bin/Qt5"{Core,Gui,Network,OpenGL,Widgets}${SUFFIX}.dll
echo Done. echo Done.
else else
QT_SDK="C:/Qt/5.7/msvc${MSVC_YEAR}${SUFFIX}" QT_SDK="C:/Qt/5.7/msvc${MSVC_YEAR}${SUFFIX}"
add_cmake_opts -DDESIRED_QT_VERSION=5 \ add_cmake_opts -DDESIRED_QT_VERSION=5 \
-DQT_QMAKE_EXECUTABLE="$QT_SDK/bin/qmake.exe" \ -DQT_QMAKE_EXECUTABLE="${QT_SDK}/bin/qmake.exe" \
-DCMAKE_PREFIX_PATH="$QT_SDK" -DCMAKE_PREFIX_PATH="$QT_SDK"
echo Done. echo Done.
@ -678,6 +681,25 @@ if [ ! -z $CI ]; then
esac esac
fi fi
# NOTE: Disable this when/if we want to run test cases
if [ -z $CI ]; then
echo "- Copying Runtime DLLs..."
mkdir -p $BUILD_CONFIG
for DLL in $RUNTIME_DLLS; do
echo " $(basename $DLL)."
cp "$DLL" $BUILD_CONFIG/
done
echo
echo "- OSG Plugin DLLs..."
mkdir -p $BUILD_CONFIG/osgPlugins-3.4.0
for DLL in $OSG_PLUGINS; do
echo " $(basename $DLL)."
cp "$DLL" $BUILD_CONFIG/osgPlugins-3.4.0
done
echo
fi
if [ -z $VERBOSE ]; then if [ -z $VERBOSE ]; then
printf -- "- Configuring... " printf -- "- Configuring... "
else else
@ -695,26 +717,8 @@ if [ -z $VERBOSE ]; then
fi fi
fi fi
echo
# NOTE: Disable this when/if we want to run test cases
if [ -z $CI ]; then if [ -z $CI ]; then
echo "- Copying Runtime DLLs..."
mkdir -p $BUILD_CONFIG
for DLL in $RUNTIME_DLLS; do
echo " `basename $DLL`."
cp "$DLL" $BUILD_CONFIG/
done
echo "- OSG Plugin DLLs..."
mkdir -p $BUILD_CONFIG/osgPlugins-3.4.0
for DLL in $OSG_PLUGINS; do
echo " `basename $DLL`."
cp "$DLL" $BUILD_CONFIG/osgPlugins-3.4.0
done
echo
echo "- Copying Runtime Resources/Config Files" echo "- Copying Runtime Resources/Config Files"
echo " gamecontrollerdb.txt" echo " gamecontrollerdb.txt"
cp gamecontrollerdb.txt $BUILD_CONFIG/gamecontrollerdb.txt cp gamecontrollerdb.txt $BUILD_CONFIG/gamecontrollerdb.txt
echo " openmw.cfg" echo " openmw.cfg"
@ -725,6 +729,7 @@ if [ -z $CI ]; then
cp settings-default.cfg $BUILD_CONFIG/settings-default.cfg cp settings-default.cfg $BUILD_CONFIG/settings-default.cfg
echo " resources/" echo " resources/"
cp -r resources $BUILD_CONFIG/resources cp -r resources $BUILD_CONFIG/resources
echo
fi fi
exit $RET exit $RET

View file

@ -599,7 +599,6 @@ if (WIN32)
# They're unneeded and sometimes completely retarded warnings that /Wall enables # They're unneeded and sometimes completely retarded warnings that /Wall enables
# Not going to bother commenting them as they tend to warn on every standard library file # Not going to bother commenting them as they tend to warn on every standard library file
4061 4263 4264 4266 4350 4371 4435 4514 4548 4571 4610 4619 4623 4625 4626 4628 4640 4668 4710 4711 4820 4826 4917 4946 4061 4263 4264 4266 4350 4371 4435 4514 4548 4571 4610 4619 4623 4625 4626 4628 4640 4668 4710 4711 4820 4826 4917 4946
5026 5027
# Warnings that are thrown on standard libraries and not OpenMW # Warnings that are thrown on standard libraries and not OpenMW
4347 # Non-template function with same name and parameter count as template function 4347 # Non-template function with same name and parameter count as template function
@ -616,7 +615,6 @@ if (WIN32)
# caused by boost # caused by boost
4191 # 'type cast' : unsafe conversion (1.56, thread_primitives.hpp, normally off) 4191 # 'type cast' : unsafe conversion (1.56, thread_primitives.hpp, normally off)
5031 # #pragma warning(pop): likely mismatch, popping warning state pushed in different file (config_begin.hpp, config_end.hpp)
# caused by MyGUI # caused by MyGUI
4275 # non dll-interface class 'std::exception' used as base for dll-interface class 'MyGUI::Exception' 4275 # non dll-interface class 'std::exception' used as base for dll-interface class 'MyGUI::Exception'
@ -642,6 +640,12 @@ if (WIN32)
4800 # Boolean optimization warning, e.g. myBool = (myInt != 0) instead of myBool = myInt 4800 # Boolean optimization warning, e.g. myBool = (myInt != 0) instead of myBool = myInt
) )
if (MSVC_VERSION GREATER 1800)
set(WARNINGS_DISABLE ${WARNINGS_DISABLE} 5026 5027
5031 # #pragma warning(pop): likely mismatch, popping warning state pushed in different file (config_begin.hpp, config_end.hpp)
)
endif()
foreach(d ${WARNINGS_DISABLE}) foreach(d ${WARNINGS_DISABLE})
set(WARNINGS "${WARNINGS} /wd${d}") set(WARNINGS "${WARNINGS} /wd${d}")
endforeach(d) endforeach(d)
@ -674,8 +678,13 @@ if (WIN32)
endif() endif()
if (BUILD_OPENMW) if (BUILD_OPENMW)
# Very specific issue this, only needed on 32-bit VS2015 during unity builds.
if (MSVC_VERSION GREATER 1800 AND CMAKE_SIZEOF_VOID_P EQUAL 4 AND OPENMW_UNITY_BUILD)
set_target_properties(openmw PROPERTIES COMPILE_FLAGS "${WARNINGS} ${MT_BUILD} /bigobj")
else()
set_target_properties(openmw PROPERTIES COMPILE_FLAGS "${WARNINGS} ${MT_BUILD}") set_target_properties(openmw PROPERTIES COMPILE_FLAGS "${WARNINGS} ${MT_BUILD}")
endif() endif()
endif()
if (BUILD_WIZARD) if (BUILD_WIZARD)
set_target_properties(openmw-wizard PROPERTIES COMPILE_FLAGS "${WARNINGS} ${MT_BUILD}") set_target_properties(openmw-wizard PROPERTIES COMPILE_FLAGS "${WARNINGS} ${MT_BUILD}")