Patch: Use cmake FindThreads module in GG

Programmers discuss here anything related to FreeOrion programming. Primarily for the developers to discuss.

Moderator: Committer

Post Reply
Message
Author
User avatar
adrian_broher
Programmer
Posts: 1156
Joined: Fri Mar 01, 2013 9:52 am
Location: Germany

Patch: Use cmake FindThreads module in GG

#1 Post by adrian_broher »

Hello fo-devs,

the attached patch removes the custom written platform specific link flags selection for threads and replaces it with a cmake find_package call utilizing the FindThreads cmake module.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Patch: Use cmake FindThreads module in GG

#2 Post by Geoff the Medio »

I'll need feedback from people who regularly compile on Linux or OSX to address this...

User avatar
Vezzra
Release Manager, Design
Posts: 6102
Joined: Wed Nov 16, 2011 12:56 pm
Location: Sol III

Re: Patch: Use cmake FindThreads module in GG

#3 Post by Vezzra »

I don't use cmake to build FO on OSX, so I can't help you with that, sorry...

User avatar
Dilvish
AI Lead and Programmer Emeritus
Posts: 4768
Joined: Sat Sep 22, 2012 6:25 pm

Re: Patch: Use cmake FindThreads module in GG

#4 Post by Dilvish »

This worked fine for me on Ubuntu Linux
If I provided any code, scripts or other content here, it's released under GPL 2.0 and CC-BY-SA 3.0

User avatar
adrian_broher
Programmer
Posts: 1156
Joined: Fri Mar 01, 2013 9:52 am
Location: Germany

Re: Patch: Use cmake FindThreads module in GG

#5 Post by adrian_broher »

The attached patch fixes the initial population of the cmake cache. The previous version didn't set the BUILD_MULTI_THREADED option early enough to add the pthread library to the linker options for the initial cmake cache population.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Patch: Use cmake FindThreads module in GG

#6 Post by Geoff the Medio »

Is that a replacement for the previous patch?

User avatar
adrian_broher
Programmer
Posts: 1156
Joined: Fri Mar 01, 2013 9:52 am
Location: Germany

Re: Patch: Use cmake FindThreads module in GG

#7 Post by adrian_broher »

Geoff the Medio wrote:Is that a replacement for the previous patch?
No, it's an additional patch. Should I have created a new thread for that?

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13603
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: Patch: Use cmake FindThreads module in GG

#8 Post by Geoff the Medio »

Should I have created a new thread for that?
No, it's fine. I just wanted to clarify.

Post Reply