Skip to content

Commit

Permalink
Build: Make mingw build scripts paths independent of wdir
Browse files Browse the repository at this point in the history
  • Loading branch information
lukas-w committed Feb 21, 2016
1 parent 2c91392 commit 40af068
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cmake/build_mingw32.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ if [ "$1" = "-qt5" ] ; then
CMAKE_OPTS="-DWANT_QT5=ON -DCMAKE_PREFIX_PATH=$MINGW $CMAKE_OPTS"
fi

cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/modules/Win32Toolchain.cmake -DCMAKE_MODULE_PATH=`pwd`/../cmake/modules/ $CMAKE_OPTS

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cmake $DIR/.. -DCMAKE_TOOLCHAIN_FILE=$DIR/../cmake/modules/Win32Toolchain.cmake -DCMAKE_MODULE_PATH=$DIR/../cmake/modules/ $CMAKE_OPTS
4 changes: 2 additions & 2 deletions cmake/build_mingw64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ if [ "$1" = "-qt5" ] ; then
CMAKE_OPTS="-DWANT_QT5=ON -DCMAKE_PREFIX_PATH=$MINGW $CMAKE_OPTS"
fi

cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/modules/Win64Toolchain.cmake -DCMAKE_MODULE_PATH=`pwd`/../cmake/modules/ $CMAKE_OPTS

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cmake $DIR/.. -DCMAKE_TOOLCHAIN_FILE=$DIR/../cmake/modules/Win64Toolchain.cmake -DCMAKE_MODULE_PATH=$DIR/../cmake/modules/ $CMAKE_OPTS

9 comments on commit 40af068

@tresf
Copy link
Member

@tresf tresf commented on 40af068 Feb 22, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lukas-w this throws the following error on my machine...

../cmake/build_mingw64.sh: 17: ../cmake/build_mingw64.sh: Bad substitution

I believe you've used bash syntax in an sh file.

@lukas-w
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, yes I did. Most system have bash as their default shell, including Ubuntu I believe. What shell are you using? Do you have bash available (if so, a proper shebang would fix it)?

@tresf
Copy link
Member

@tresf tresf commented on 40af068 Feb 22, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, yes I did. Most system have bash as their default shell, including Ubuntu I believe.

Correct, every Ubuntu I've used has bash as default.

What shell are you using?

Bash.

Do you have bash available

Always.

(if so, a proper shebang would fix it)?

Likely. 😉

@tresf
Copy link
Member

@tresf tresf commented on 40af068 Feb 22, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a task to fix this too... 🔥 #2201 (comment)

@lukas-w
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:neckbeard: So what's sh on your system then?

@tresf
Copy link
Member

@tresf tresf commented on 40af068 Feb 22, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lukas-w
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So, the default shell on newer Ubuntus is actually dash, isn't it?

Edit: Ah, as https://wiki.ubuntu.com/DashAsBinSh explains, Ubuntu's default "system shell" is dash, while the default "login shell" is bash.

@lukas-w
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed shebang to bash in 13125c6.

@tresf
Copy link
Member

@tresf tresf commented on 40af068 Feb 22, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Will remember and use the env technique moving forward as well.

Please sign in to comment.