compling spring on windows using cygwin with mingw

compling spring on windows using cygwin with mingw

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
Super Mario
Posts: 823
Joined: 21 Oct 2008, 02:54

compling spring on windows using cygwin with mingw

Post by Super Mario »

I did some modification to the cmake file in the spring folder so that it includes the mingw32 libraries when compiling with cygwin.
Here some things to note: FIND_PACKAGE works differently for cygwin (doesn't seemed to find the zib for instance even though I manged to hook the mingwlib files, it's looking at the default unix locaiton, even though I'm using the mingw32 libaries). I can't use the default compiler as it the binary requires the dll that comes with cygwin in order to run it properly( it thinks that it doesn't have c11 support, due to missing flags, but it does nevertheless), so I have to use the mingw that comes with it,(The 64mingw package comes with the 32 version btw).

So the question is, that should I edit other cmake files to use the mingwlib when using cygwin or I doing this the hard way?

Edit: Clarification
Attachments
CMakeLists.txt
(18.69 KiB) Downloaded 4 times
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: compling spring on windows using cygwin with mingw

Post by abma »

afaik there are differences when using cygwin with the vars WIN32/MINGW32/UNIX in comparison when using windows command shell / cmake / ... and because of that some cmake scripts don't work / detect wrong paths. afaik there are some bug reports related to cmake / cygwin, see the bugtracker of cmake.org.

why do you want to use cygwin?

the attached file doesn't claryfy anything, you should show a diff...
Super Mario
Posts: 823
Joined: 21 Oct 2008, 02:54

Re: compling spring on windows using cygwin with mingw

Post by Super Mario »

abma wrote:afaik there are differences when using cygwin with the vars WIN32/MINGW32/UNIX in comparison when using windows command shell / cmake / ... and because of that some cmake scripts don't work / detect wrong paths. afaik there are some bug reports related to cmake / cygwin, see the bugtracker of cmake.org.

why do you want to use cygwin?

the attached file doesn't claryfy anything, you should show a diff...
I want use cygwin, because it comes with the mingw64 tool chain as one of it's packages and the fact that ninja uses them for configuring. I notice that you include the ninja.exe file in one of your projects, is it any different to the one that I'm using (pre-build exe that has used msvc for compiling)?

I replace

Code: Select all

(UNIX AND NOT MINGW)
with

Code: Select all

(UNIX AND NOT MINGW AND NOT CYGWIN)
as it treat cygwin the same thing as unix if I don't specify it.
Super Mario
Posts: 823
Joined: 21 Oct 2008, 02:54

Re: compling spring on windows using cygwin with mingw

Post by Super Mario »

I even try to configure with msvc 12 edition and even then it couldn't find the zib and glew libraries as well, even though I had the msvc libaires in the folder. I'm using cmake 3.10 edition.

This is just pure weird.
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: compling spring on windows using cygwin with mingw

Post by abma »

its "zlib". you should use https://github.com/spring/mingwlibs

can you provide full output of "cmake ." please?

cmake 3.1.0 is untested, maybe a "downgrade" solves it.
Super Mario
Posts: 823
Joined: 21 Oct 2008, 02:54

Re: compling spring on windows using cygwin with mingw

Post by Super Mario »

abma wrote:its "zlib". you should use https://github.com/spring/mingwlibs
Here's the thing, I am using it, it doesn't seemed to find it somehow.
can you provide full output of "cmake ." please?
Done
Attachments
CMakeOutput.log
(33.28 KiB) Downloaded 8 times
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: compling spring on windows using cygwin with mingw

Post by abma »

hmm, thats not what i meant. full output of cmake when run in the spring source dir: i.e. the command you used to configure to create the ninja build file.
abma
Spring Developer
Posts: 3798
Joined: 01 Jun 2009, 00:08

Re: compling spring on windows using cygwin with mingw

Post by abma »

latest commit in the release branch contains a fix for cmake 3.1.0:

https://github.com/spring/spring/commit ... 1782c1bb9c
Super Mario
Posts: 823
Joined: 21 Oct 2008, 02:54

Re: compling spring on windows using cygwin with mingw

Post by Super Mario »

Still got the same error

Code: Select all

CMake Error at C:/cmake/share/cmake-3.1/Modules/FindPackageHandleStandardArgs.cmake:138 (message):
  Could NOT find ZLIB (missing: ZLIB_LIBRARY) (found version "1.2.7")
Call Stack (most recent call first):
  C:/cmake/share/cmake-3.1/Modules/FindPackageHandleStandardArgs.cmake:374 (_FPHSA_FAILURE_MESSAGE)
  C:/cmake/share/cmake-3.1/Modules/FindZLIB.cmake:110 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  rts/lib/minizip/CMakeLists.txt:20 (FIND_PACKAGE)

Edit: this is plan ridiculous, I am not going to download linux just to configure spring dev with cmake, just so that I can start messing around with it. The fact that I can't even configure with visual studio shows how badly tested it is on the platform.
lamer
Posts: 153
Joined: 08 Mar 2014, 23:13

Re: compling spring on windows using cygwin with mingw

Post by lamer »

I don't know about windows but on linux/osx i'm able to provide additional flags for cmake, like

Code: Select all

cmake . -DGLEW_INCLUDE_DIR=/some/dir -DZLIB_LIBRARY=/some/zlib/
User avatar
Silentwings
Posts: 3720
Joined: 25 Oct 2008, 00:23

Re: compling spring on windows using cygwin with mingw

Post by Silentwings »

If you want to compile Spring on windows, you'll need to put in some serious work to use VS/MSVC, and even if you eventually managed to compile, it probably won't sync.

Much easier is to get the mingw compiler specified on the wiki, use it with codeblocks, then use cmake to generate a codeblocks project file. That way you have a reasonable IDE to edit/compile in and your compilation is identical to doing it "by hand" a la wiki. (And afaik this will also work on linux.)
User avatar
smoth
Posts: 22309
Joined: 13 Jan 2005, 00:46

Re: compling spring on windows using cygwin with mingw

Post by smoth »

Silentwings wrote:it probably won't sync.
do we know why this is?
User avatar
Silentwings
Posts: 3720
Joined: 25 Oct 2008, 00:23

Re: compling spring on windows using cygwin with mingw

Post by Silentwings »

I don't know in detail, but that's what I've always heard. I would guess that streflop can only guarantee syncing floating point when the same compiler is used.
Super Mario
Posts: 823
Joined: 21 Oct 2008, 02:54

Re: compling spring on windows using cygwin with mingw

Post by Super Mario »

Yes, I have already compile with mingw64 64 bit version with some edits to the cmake file. (Passing the -m32 flag with -fpremmsive btw)
Edit: btw abma if you guys planing to start creating new mingw libraries for the 64 bit version, I want in.
Post Reply

Return to “Engine”