]> sigrok.org Git - sigrok-util.git/commitdiff
mxe/msys2: Use -DCMAKE_BUILD_TYPE in favor of a patch.
authorCenkron <redacted>
Fri, 12 Jan 2018 19:05:29 +0000 (13:05 -0600)
committerUwe Hermann <redacted>
Sat, 13 Jan 2018 17:10:39 +0000 (18:10 +0100)
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.

cross-compile/mingw/pv_mwindows.patch [deleted file]
cross-compile/mingw/sigrok-cross-mingw
cross-compile/msys2/sigrok-native-msys2

diff --git a/cross-compile/mingw/pv_mwindows.patch b/cross-compile/mingw/pv_mwindows.patch
deleted file mode 100644 (file)
index 65cd770..0000000
+++ /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
- #-------------------------------------------------------------------------------
index c6d95d3534340aa8614b163ada0b949b15a12bf7..bae165f0a2d4045761aaf887c236f3b03b7ed997 100755 (executable)
@@ -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
index 1e7f9fdfe1b467196da119de282e48b7fd164d96..e8b37464e6adace9f71e2c0c6030c3565088e404 100755 (executable)
@@ -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 ../..
-