From: Cenkron Date: Fri, 12 Jan 2018 19:05:29 +0000 (-0600) Subject: mxe/msys2: Use -DCMAKE_BUILD_TYPE in favor of a patch. X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=682d505b8b7d354c7b0dc1bd719a4f43e0f566c7;p=sigrok-util.git mxe/msys2: Use -DCMAKE_BUILD_TYPE in favor of a patch. Direct cmake to apply the -mwindows linker switch based on a cmake command line argument rather than by using a patch file. The command line argument is -DCMAKE_BUILD_TYPE=xxxxx and applies the linker switch only to WIN32 builds that are not Debug. --- diff --git a/cross-compile/mingw/pv_mwindows.patch b/cross-compile/mingw/pv_mwindows.patch deleted file mode 100644 index 65cd770..0000000 --- a/cross-compile/mingw/pv_mwindows.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 80e90e9..d1a564f 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -398,11 +398,6 @@ endif() - - target_link_libraries(${PROJECT_NAME} ${PULSEVIEW_LINK_LIBS}) - --if(WIN32) -- # Pass -mwindows so that no "DOS box" opens when PulseView is started. -- set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "-mwindows") --endif() -- - #=============================================================================== - #= Installation - #------------------------------------------------------------------------------- diff --git a/cross-compile/mingw/sigrok-cross-mingw b/cross-compile/mingw/sigrok-cross-mingw index c6d95d3..bae165f 100755 --- a/cross-compile/mingw/sigrok-cross-mingw +++ b/cross-compile/mingw/sigrok-cross-mingw @@ -74,7 +74,9 @@ fi if [ $DEBUG = 1 ]; then # CFLAGS/CXXFLAGS contains "-g" per default for autotools projects. - CM="$CM -DCMAKE_BUILD_TYPE=Debug" + BUILD_TYPE="Debug" +else + BUILD_TYPE="Release" fi # Remove build directory contents (if any) and create a new build dir. @@ -213,11 +215,12 @@ cd .. $GIT_CLONE $REPO_BASE/pulseview cd pulseview cp ../../FileAssociation.nsh contrib -if [ $DEBUG = 1 ]; then - # Allow a "DOS box" to open on Windows, it'll contain logging output. - patch -p1 < ../../pv_mwindows.patch -fi -$CMAKE -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX -DDISABLE_WERROR=y -DENABLE_TESTS=y . +$CMAKE \ + -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX \ + -DCMAKE_BUILD_TYPE=$BUILD_TYPE \ + -DDISABLE_WERROR=y \ + -DENABLE_TESTS=y + . make $PARALLEL $V if [ $DEBUG = 1 ]; then make install $V diff --git a/cross-compile/msys2/sigrok-native-msys2 b/cross-compile/msys2/sigrok-native-msys2 index 1e7f9fd..e8b3746 100755 --- a/cross-compile/msys2/sigrok-native-msys2 +++ b/cross-compile/msys2/sigrok-native-msys2 @@ -46,6 +46,12 @@ VER_SIGROK_FIRMWARE_FX2LAFW=0.1.3 # ----------------------------------------------------------------------------- +if [ $DEBUG = 1 ]; then + BUILD_TYPE="Debug" +else + BUILD_TYPE="Release" +fi + P="$PREFIX/lib/pkgconfig" C="$C --prefix=$PREFIX" L="--disable-shared --enable-static" @@ -162,10 +168,15 @@ $GIT_CLONE $REPO_BASE/pulseview cd pulseview mkdir build cd build -PKG_CONFIG_PATH=$P $SB cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX -DDISABLE_WERROR=y -DENABLE_TESTS=n .. +PKG_CONFIG_PATH=$P $SB cmake \ + -G "Unix Makefiles" \ + -DCMAKE_INSTALL_PREFIX:PATH=$PREFIX \ + -DCMAKE_BUILD_TYPE=$BUILD_TYPE \ + -DDISABLE_WERROR=y \ + -DENABLE_TESTS=n + .. $SB make $PARALLEL $V make install $V # $SB make test $V # TODO # makensis -DHOME=$HOME contrib/pulseview_cross.nsi # TODO cd ../.. -