Discussion:
[LyX/2.2-staging] Objective-C compililation support with cmake and C++11
Vincent van Ravesteijn
2014-04-18 14:11:09 UTC
Permalink
Objective-C compililation support with cmake and C++11
Sun, 9 Mar 2014 07:29:27 +0000 (08:29 +0100)
Fri, 21 Mar 2014 01:18:09 +0000 (02:18 +0100)
commit f115a12bf6c83de566e551dbed7735f894327017
tree e963b5ca7d55ee52466580068f84d7c71c7776ec tree | snapshot
parent e83606c98a3ba2b1bdc5134e37f0f841d1b9a222 commit | diff
Objective-C compililation support with cmake and C++11
This fixes an issue whe compiling with C++11 flags on: The
objective-C clang compiler produces an error. This patch waits
avoid including specific C++ flags and uses LYX_CPP_SPECIFIC_FLAGS
to store the confliciting flags (for the moment, just C++11).
Isn't the attached patch much nicer than

http://git.lyx.org/?p=lyx.git;a=commitdiff;h=f115a12bf6c83de566e551dbed7735f894327017

The previous commit is postponing to add the --std=gnucxx11 compiler
option in a fragile way until all objective c files were processed.
Instead, can't it be done like this, and only override the option for
the few objective-c files ?

Vincent
Benjamin Piwowarski
2014-04-18 14:33:33 UTC
Permalink
Objective-C compililation support with cmake and C++11
Sun, 9 Mar 2014 07:29:27 +0000 (08:29 +0100)
Fri, 21 Mar 2014 01:18:09 +0000 (02:18 +0100)
commit f115a12bf6c83de566e551dbed7735f894327017
tree e963b5ca7d55ee52466580068f84d7c71c7776ec tree | snapshot
parent e83606c98a3ba2b1bdc5134e37f0f841d1b9a222 commit | diff
Objective-C compililation support with cmake and C++11
This fixes an issue whe compiling with C++11 flags on: The
objective-C clang compiler produces an error. This patch waits
avoid including specific C++ flags and uses LYX_CPP_SPECIFIC_FLAGS
to store the confliciting flags (for the moment, just C++11).
Isn't the attached patch much nicer than

http://git.lyx.org/?p=lyx.git;a=commitdiff;h=f115a12bf6c83de566e551dbed7735f894327017

The previous commit is postponing to add the --std=gnucxx11 compiler option in a fragile way until all objective c files were processed. Instead, can't it be done like this, and only override the option for the few objective-c files ?

Unfortunately, the attached patch does not resolve the problem. The --std=c++11 is not a valid objective-c flag (at least for clang, which is now the default in OS X). 

The problem is that it is very hard to override the options for the objective-c compiler since there is no distinction between objective-C and C/C++ flags in cmake. We would need to clear all the flags (loosing all the debug options, or having to recreate them), and then set them again; I then think the option of having some specific C++ flags is the easiest.
 
Benjamin
Vincent van Ravesteijn
2014-04-18 16:27:26 UTC
Permalink
Post by Benjamin Piwowarski
Post by Vincent van Ravesteijn
Objective-C compililation support with cmake and C++11
Sun, 9 Mar 2014 07:29:27 +0000 (08:29 +0100)
Fri, 21 Mar 2014 01:18:09 +0000 (02:18 +0100)
commit f115a12bf6c83de566e551dbed7735f894327017
tree e963b5ca7d55ee52466580068f84d7c71c7776ec tree | snapshot
parent e83606c98a3ba2b1bdc5134e37f0f841d1b9a222 commit | diff
Objective-C compililation support with cmake and C++11
This fixes an issue whe compiling with C++11 flags on: The
objective-C clang compiler produces an error. This patch waits
avoid including specific C++ flags and uses LYX_CPP_SPECIFIC_FLAGS
to store the confliciting flags (for the moment, just C++11).
Isn't the attached patch much nicer than
http://git.lyx.org/?p=lyx.git;a=commitdiff;h=f115a12bf6c83de566e551dbed7735f894327017
Post by Benjamin Piwowarski
Post by Vincent van Ravesteijn
The previous commit is postponing to add the --std=gnucxx11 compiler
option in a fragile way until all objective c files were processed.
Instead, can't it be done like this, and only override the option for the
few objective-c files ?
Post by Benjamin Piwowarski
Post by Vincent van Ravesteijn
________________________________
Unfortunately, the attached patch does not resolve the problem. The
--std=c++11 is not a valid objective-c flag (at least for clang, which is
now the default in OS X).
Well, the -ansi flag (or its -std=... equivalent) overrides the -std=c++11
flag. Why doesn't that work ?

Vincent
Benjamin Piwowarski
2014-04-22 07:31:40 UTC
Permalink
My commit was finally included in the master branch. Unless somebody objects, I will undo it and apply Vincent patch which is cleaner. 

Benjamin
Post by Benjamin Piwowarski
Post by Vincent van Ravesteijn
Objective-C compililation support with cmake and C++11
Sun, 9 Mar 2014 07:29:27 +0000 (08:29 +0100)
Fri, 21 Mar 2014 01:18:09 +0000 (02:18 +0100)
commit f115a12bf6c83de566e551dbed7735f894327017
tree e963b5ca7d55ee52466580068f84d7c71c7776ec tree | snapshot
parent e83606c98a3ba2b1bdc5134e37f0f841d1b9a222 commit | diff
Objective-C compililation support with cmake and C++11
This fixes an issue whe compiling with C++11 flags on: The
objective-C clang compiler produces an error. This patch waits
avoid including specific C++ flags and uses LYX_CPP_SPECIFIC_FLAGS
to store the confliciting flags (for the moment, just C++11).
Isn't the attached patch much nicer than
http://git.lyx.org/?p=lyx.git;a=commitdiff;h=f115a12bf6c83de566e551dbed7735f894327017
The previous commit is postponing to add the --std=gnucxx11 compiler option in a fragile way until all objective c files were processed. Instead, can't it be done like this, and only override the option for the few objective-c files ?
________________________________
Unfortunately, the attached patch does not resolve the problem. The --std=c++11 is not a valid objective-c flag (at least for clang, which is now the default in OS X). 
Well, the -ansi flag (or its -std=... equivalent) overrides the -std=c++11 flag. Why doesn't that work ?

Vincent
Richard Heck
2014-04-22 14:07:01 UTC
Permalink
Post by Benjamin Piwowarski
My commit was finally included in the master branch. Unless somebody
objects, I will undo it and apply Vincent patch which is cleaner.
Yes, I just merged everything mindlessly, so go ahead.

Richard
Post by Benjamin Piwowarski
Benjamin
Post by Vincent van Ravesteijn
Post by Benjamin Piwowarski
Post by Vincent van Ravesteijn
Objective-C compililation support with cmake and C++11
Sun, 9 Mar 2014 07:29:27 +0000 (08:29 +0100)
Fri, 21 Mar 2014 01:18:09 +0000 (02:18 +0100)
commit f115a12bf6c83de566e551dbed7735f894327017
tree e963b5ca7d55ee52466580068f84d7c71c7776ec tree | snapshot
parent e83606c98a3ba2b1bdc5134e37f0f841d1b9a222 commit | diff
Objective-C compililation support with cmake and C++11
This fixes an issue whe compiling with C++11 flags on: The
objective-C clang compiler produces an error. This patch waits
avoid including specific C++ flags and uses LYX_CPP_SPECIFIC_FLAGS
to store the confliciting flags (for the moment, just C++11).
Isn't the attached patch much nicer than
http://git.lyx.org/?p=lyx.git;a=commitdiff;h=f115a12bf6c83de566e551dbed7735f894327017
Post by Benjamin Piwowarski
Post by Vincent van Ravesteijn
The previous commit is postponing to add the --std=gnucxx11
compiler option in a fragile way until all objective c files were
processed. Instead, can't it be done like this, and only override the
option for the few objective-c files ?
Post by Benjamin Piwowarski
Post by Vincent van Ravesteijn
________________________________
Unfortunately, the attached patch does not resolve the problem. The
--std=c++11 is not a valid objective-c flag (at least for clang,
which is now the default in OS X).
Well, the -ansi flag (or its -std=... equivalent) overrides the
-std=c++11 flag. Why doesn't that work ?
Vincent
Loading...