project-navigation
Personal tools

Author Topic: Using cmake to setup build env  (Read 35693 times)

Offline hwoarangmy

  • Rookie
  • ***
  • Posts: 84
    • View Profile
Re: Using cmake to setup build env
« Reply #30 on: September 17, 2015, 10:14:24 pm »
I've had a look but it might be more complicated than expected. From what I've seen, some compiler flags are used in the common files (at least COMPILE_MAP/COMPILE_UFO but also some more that I don't know like PARANOID)...

Offline hwoarangmy

  • Rookie
  • ***
  • Posts: 84
    • View Profile
Re: Using cmake to setup build env
« Reply #31 on: September 17, 2015, 10:44:41 pm »
Note that one solution could be to separate in the common folder the files that requires some flags and the files that can be safely compiled and linked. We could do that separation in the makefile and compile the common files that need the flags twice. But that would mean that if someone adds COMPILE_UFO in a common source that did not had it, the project will fail with a linker error and it won't be straihtforward to find where the error comes from.
I guess the best would be to split the common folder and make clear that the first part is for common not flagged code and that the second if for COMPILE_UFO/COMPILE_MAP. But I'm not sure the compile time gained is worth it (because it makes a strong link between source files architecture and the flags allowed to be used).

WDYT ?

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Using cmake to setup build env
« Reply #32 on: September 19, 2015, 11:10:01 am »
I've added appveyor and travis-ci build support on github. Please check it out at the readme of the project at https://github.com/ufoai/ufoai/ (the badges)

the files might need some tweaks in .travis.yml and appveyor.yml in the ufoai git root.

Offline hwoarangmy

  • Rookie
  • ***
  • Posts: 84
    • View Profile
Re: Using cmake to setup build env
« Reply #33 on: September 20, 2015, 11:07:39 am »
I'm not used to travis or appveyor but in travis, it seems like cmake is not used (we can see the error comes from not finding ufo2map not being found).

In appveyor, cmake is used but dependencies are not found. Have you uploaded them ? The easiest (if possible) would be to upload the dependencies in the bundle (link in this thread) and set the UFOAI_DEPS variable.

EDIT: In any case, I'm interested in this kind of build systems for another open source project I'm involved in (Open Dungeons if you want to know) and I will take the opportunity to have a look.
« Last Edit: September 20, 2015, 11:09:23 am by hwoarangmy »

Offline hwoarangmy

  • Rookie
  • ***
  • Posts: 84
    • View Profile
Re: Using cmake to setup build env
« Reply #34 on: September 21, 2015, 12:43:56 am »
I could setup appveyor to compile UFOAI. If there somewhere where I can upload the deps ? For my tests, I've used a private server to host the file but it would be good to use some UFOAI storage ^^
Note that I just need the deps I've uploaded in this thread available somewhere. If someone could upload it and post the link here, it will be enough.

I will go for a PR as soon as I know where to download the deps from.

Offline DarkRain

  • Project Coder
  • Captain
  • ***
  • Posts: 746
    • View Profile
Re: Using cmake to setup build env
« Reply #35 on: September 26, 2015, 09:34:46 pm »
So, I'm guessing that the silence here means no one besides Mattn has the right to upload files to our server...

Offline hwoarangmy

  • Rookie
  • ***
  • Posts: 84
    • View Profile
Re: Using cmake to setup build env
« Reply #36 on: September 26, 2015, 10:26:26 pm »
He uploaded the file today on sourceforge. link:
https://sourceforge.net/projects/ufoai/files/UFO_AI%202.x/2.5/ufoai-deps.zip/download

I'm currently checking there is no problem and I will create a PR when it is done

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Using cmake to setup build env
« Reply #37 on: September 27, 2015, 08:29:34 am »
DarkRainX and ShipIt: you now have all the needed rights, too. Sorry that it took so long.

Offline hwoarangmy

  • Rookie
  • ***
  • Posts: 84
    • View Profile
Re: Using cmake to setup build env
« Reply #38 on: September 27, 2015, 06:41:01 pm »
Compilation is fixed with appVeyor and Travis ^^
Travis PR is released

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Using cmake to setup build env
« Reply #39 on: September 27, 2015, 08:10:47 pm »
very nice. Someone should maybe configure it in a way that build reports are send to the ufoai irc channel

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Using cmake to setup build env
« Reply #40 on: September 27, 2015, 08:13:25 pm »
oh.. btw. I've also prepared the travis build config to build for osx. But as ufoai needs brew stuff installed, someone who knows osx better should check that out, install all the deps and request osx build support activation for travis. Then all the major platforms are build.

Offline hwoarangmy

  • Rookie
  • ***
  • Posts: 84
    • View Profile
Re: Using cmake to setup build env
« Reply #41 on: September 27, 2015, 11:55:59 pm »
Note that I've never used OSX. The cmake build is likely to fail as I did nearly nothing about it.

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: Using cmake to setup build env
« Reply #42 on: September 28, 2015, 07:37:21 pm »
That's exactly why travis ci is so cool - i don't have a mac, too - but building a cmake based project for macosx and ios.

Offline hwoarangmy

  • Rookie
  • ***
  • Posts: 84
    • View Profile
Re: Using cmake to setup build env
« Reply #43 on: September 28, 2015, 10:35:21 pm »
I've just created a PR with MinGW build with appVeyor (with MinGW, I've activated Radiant build)

Note that I've tried to activate unit tests but for some reason, I get no output with appVeyor. The tests are launched but nothing happens. It seems to work well on Travis (but some tests fail).

Offline DarkRain

  • Project Coder
  • Captain
  • ***
  • Posts: 746
    • View Profile
Re: Using cmake to setup build env
« Reply #44 on: September 30, 2015, 08:36:01 pm »
That's something with SDL command line applications I think, on windows they output to stdout.txt and stderr.txt instead, there ought to be a way to make it output to the console but I can't remember it.