Re: Review Request 114897: Make KDE_ENABLE_EXCEPTIONS a list

2014-01-21 Thread Alex Merry

---
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/114897/
---

(Updated Jan. 21, 2014, 6:14 p.m.)


Status
--

This change has been discarded.


Review request for Build System, Extra Cmake Modules, KDE Frameworks, and 
Stephen Kelly.


Repository: extra-cmake-modules


Description
---

Make KDE_ENABLE_EXCEPTIONS a list

When KDE_ENABLE_EXCEPTIONS contains two arguments, they are currently a
single string containing those space-separated arguments.  It can thus
be used as
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${KDE_ENABLE_EXCEPTIONS})
However, the proper way to set compile flags these days is to use
add_compile_options, as in
add_compile_options(${KDE_ENABLE_EXCEPTIONS})
which requires KDE_ENABLE_EXCEPTIONS to be a list.

Note that this change means that setting CMAKE_CXX_FLAGS like above NO
LONGER WORKS (as you will get the argument
-fexceptions;-UQT_NO_EXCEPTIONS added for GCC and Clang).


Diffs
-

  kde-modules/KDECompilerSettings.cmake 
cd93e519dea4917a6c09df02bb32254f468c2861 

Diff: https://git.reviewboard.kde.org/r/114897/diff/


Testing
---

ThreadWeaver compiles under GCC on Linux if (and only if) I change the 
src/CMakeLists.txt file to use add_compile_options instead of setting 
CMAKE_CXX_FLAGS.


Thanks,

Alex Merry

___
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel


Re: Review Request 114897: Make KDE_ENABLE_EXCEPTIONS a list

2014-01-19 Thread Alex Merry

---
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/114897/
---

(Updated Jan. 19, 2014, 1:20 p.m.)


Review request for Build System, Extra Cmake Modules, KDE Frameworks, and 
Stephen Kelly.


Changes
---

Added extracmakemodules group.


Repository: extra-cmake-modules


Description
---

Make KDE_ENABLE_EXCEPTIONS a list

When KDE_ENABLE_EXCEPTIONS contains two arguments, they are currently a
single string containing those space-separated arguments.  It can thus
be used as
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${KDE_ENABLE_EXCEPTIONS})
However, the proper way to set compile flags these days is to use
add_compile_options, as in
add_compile_options(${KDE_ENABLE_EXCEPTIONS})
which requires KDE_ENABLE_EXCEPTIONS to be a list.

Note that this change means that setting CMAKE_CXX_FLAGS like above NO
LONGER WORKS (as you will get the argument
-fexceptions;-UQT_NO_EXCEPTIONS added for GCC and Clang).


Diffs
-

  kde-modules/KDECompilerSettings.cmake 
cd93e519dea4917a6c09df02bb32254f468c2861 

Diff: https://git.reviewboard.kde.org/r/114897/diff/


Testing
---

ThreadWeaver compiles under GCC on Linux if (and only if) I change the 
src/CMakeLists.txt file to use add_compile_options instead of setting 
CMAKE_CXX_FLAGS.


Thanks,

Alex Merry

___
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel


Review Request 114897: Make KDE_ENABLE_EXCEPTIONS a list

2014-01-07 Thread Alex Merry

---
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/114897/
---

Review request for Build System, KDE Frameworks and Stephen Kelly.


Repository: extra-cmake-modules


Description
---

Make KDE_ENABLE_EXCEPTIONS a list

When KDE_ENABLE_EXCEPTIONS contains two arguments, they are currently a
single string containing those space-separated arguments.  It can thus
be used as
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${KDE_ENABLE_EXCEPTIONS})
However, the proper way to set compile flags these days is to use
add_compile_options, as in
add_compile_options(${KDE_ENABLE_EXCEPTIONS})
which requires KDE_ENABLE_EXCEPTIONS to be a list.

Note that this change means that setting CMAKE_CXX_FLAGS like above NO
LONGER WORKS (as you will get the argument
-fexceptions;-UQT_NO_EXCEPTIONS added for GCC and Clang).


Diffs
-

  kde-modules/KDECompilerSettings.cmake 
72824e166d03dcc2d089814dc121f08ba998974a 

Diff: https://git.reviewboard.kde.org/r/114897/diff/


Testing
---

ThreadWeaver compiles under GCC on Linux if (and only if) I change the 
src/CMakeLists.txt file to use add_compile_options instead of setting 
CMAKE_CXX_FLAGS.


Thanks,

Alex Merry

___
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel


Re: Review Request 114897: Make KDE_ENABLE_EXCEPTIONS a list

2014-01-07 Thread Stephen Kelly

---
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/114897/#review46984
---


Why is -UQT_NO_EXCEPTIONS needed?

- Stephen Kelly


On Jan. 7, 2014, 4:52 p.m., Alex Merry wrote:
 
 ---
 This is an automatically generated e-mail. To reply, visit:
 https://git.reviewboard.kde.org/r/114897/
 ---
 
 (Updated Jan. 7, 2014, 4:52 p.m.)
 
 
 Review request for Build System, KDE Frameworks and Stephen Kelly.
 
 
 Repository: extra-cmake-modules
 
 
 Description
 ---
 
 Make KDE_ENABLE_EXCEPTIONS a list
 
 When KDE_ENABLE_EXCEPTIONS contains two arguments, they are currently a
 single string containing those space-separated arguments.  It can thus
 be used as
 set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${KDE_ENABLE_EXCEPTIONS})
 However, the proper way to set compile flags these days is to use
 add_compile_options, as in
 add_compile_options(${KDE_ENABLE_EXCEPTIONS})
 which requires KDE_ENABLE_EXCEPTIONS to be a list.
 
 Note that this change means that setting CMAKE_CXX_FLAGS like above NO
 LONGER WORKS (as you will get the argument
 -fexceptions;-UQT_NO_EXCEPTIONS added for GCC and Clang).
 
 
 Diffs
 -
 
   kde-modules/KDECompilerSettings.cmake 
 72824e166d03dcc2d089814dc121f08ba998974a 
 
 Diff: https://git.reviewboard.kde.org/r/114897/diff/
 
 
 Testing
 ---
 
 ThreadWeaver compiles under GCC on Linux if (and only if) I change the 
 src/CMakeLists.txt file to use add_compile_options instead of setting 
 CMAKE_CXX_FLAGS.
 
 
 Thanks,
 
 Alex Merry
 


___
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel


Re: Review Request 114897: Make KDE_ENABLE_EXCEPTIONS a list

2014-01-07 Thread Alex Merry


 On Jan. 7, 2014, 4:55 p.m., Stephen Kelly wrote:
  Why is -UQT_NO_EXCEPTIONS needed?

Hrm.  After some investigation: I'm not entirely sure.  The simplest answer is 
that's what qmake does - defines QT_NO_EXCEPTIONS exactly when exceptions are 
disabled (note that exceptions are disabled by default for Qt itself, but 
enabled by default for all other code, including tests in Qt and applications 
using qmake as their build system).

You would have thought that enabling this only for the headers in Qt (but not 
for the library itself) would be dangerous - for example, QException is 
declared, but its methods will not be defined if Qt was not compiled with 
exception support.

As far as I can see, the only useful behaviour you get from making 
QT_NO_EXCEPTIONS match the compiler flags, rather than Qt's compilation flags, 
is that you can get QVERIFY_EXCEPTION_THROWN from QTest even when Qt was 
compiled without exceptions.  But in other regards, I think there is the 
potential for some weird behaviour if QT_NO_EXCEPTIONS does not match how Qt 
was compiled.


- Alex


---
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/114897/#review46984
---


On Jan. 7, 2014, 4:52 p.m., Alex Merry wrote:
 
 ---
 This is an automatically generated e-mail. To reply, visit:
 https://git.reviewboard.kde.org/r/114897/
 ---
 
 (Updated Jan. 7, 2014, 4:52 p.m.)
 
 
 Review request for Build System, KDE Frameworks and Stephen Kelly.
 
 
 Repository: extra-cmake-modules
 
 
 Description
 ---
 
 Make KDE_ENABLE_EXCEPTIONS a list
 
 When KDE_ENABLE_EXCEPTIONS contains two arguments, they are currently a
 single string containing those space-separated arguments.  It can thus
 be used as
 set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${KDE_ENABLE_EXCEPTIONS})
 However, the proper way to set compile flags these days is to use
 add_compile_options, as in
 add_compile_options(${KDE_ENABLE_EXCEPTIONS})
 which requires KDE_ENABLE_EXCEPTIONS to be a list.
 
 Note that this change means that setting CMAKE_CXX_FLAGS like above NO
 LONGER WORKS (as you will get the argument
 -fexceptions;-UQT_NO_EXCEPTIONS added for GCC and Clang).
 
 
 Diffs
 -
 
   kde-modules/KDECompilerSettings.cmake 
 72824e166d03dcc2d089814dc121f08ba998974a 
 
 Diff: https://git.reviewboard.kde.org/r/114897/diff/
 
 
 Testing
 ---
 
 ThreadWeaver compiles under GCC on Linux if (and only if) I change the 
 src/CMakeLists.txt file to use add_compile_options instead of setting 
 CMAKE_CXX_FLAGS.
 
 
 Thanks,
 
 Alex Merry
 


___
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel


Re: Review Request 114897: Make KDE_ENABLE_EXCEPTIONS a list

2014-01-07 Thread Alex Merry


 On Jan. 7, 2014, 4:55 p.m., Stephen Kelly wrote:
  Why is -UQT_NO_EXCEPTIONS needed?
 
 Alex Merry wrote:
 Hrm.  After some investigation: I'm not entirely sure.  The simplest 
 answer is that's what qmake does - defines QT_NO_EXCEPTIONS exactly when 
 exceptions are disabled (note that exceptions are disabled by default for Qt 
 itself, but enabled by default for all other code, including tests in Qt and 
 applications using qmake as their build system).
 
 You would have thought that enabling this only for the headers in Qt (but 
 not for the library itself) would be dangerous - for example, QException is 
 declared, but its methods will not be defined if Qt was not compiled with 
 exception support.
 
 As far as I can see, the only useful behaviour you get from making 
 QT_NO_EXCEPTIONS match the compiler flags, rather than Qt's compilation 
 flags, is that you can get QVERIFY_EXCEPTION_THROWN from QTest even when Qt 
 was compiled without exceptions.  But in other regards, I think there is the 
 potential for some weird behaviour if QT_NO_EXCEPTIONS does not match how Qt 
 was compiled.

All I get out of git log, incidentally, is a commit message from Helio saying 
Need to undefine macro if we force exceptions. Thanks to Andreas Pakulat


- Alex


---
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/114897/#review46984
---


On Jan. 7, 2014, 4:52 p.m., Alex Merry wrote:
 
 ---
 This is an automatically generated e-mail. To reply, visit:
 https://git.reviewboard.kde.org/r/114897/
 ---
 
 (Updated Jan. 7, 2014, 4:52 p.m.)
 
 
 Review request for Build System, KDE Frameworks and Stephen Kelly.
 
 
 Repository: extra-cmake-modules
 
 
 Description
 ---
 
 Make KDE_ENABLE_EXCEPTIONS a list
 
 When KDE_ENABLE_EXCEPTIONS contains two arguments, they are currently a
 single string containing those space-separated arguments.  It can thus
 be used as
 set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${KDE_ENABLE_EXCEPTIONS})
 However, the proper way to set compile flags these days is to use
 add_compile_options, as in
 add_compile_options(${KDE_ENABLE_EXCEPTIONS})
 which requires KDE_ENABLE_EXCEPTIONS to be a list.
 
 Note that this change means that setting CMAKE_CXX_FLAGS like above NO
 LONGER WORKS (as you will get the argument
 -fexceptions;-UQT_NO_EXCEPTIONS added for GCC and Clang).
 
 
 Diffs
 -
 
   kde-modules/KDECompilerSettings.cmake 
 72824e166d03dcc2d089814dc121f08ba998974a 
 
 Diff: https://git.reviewboard.kde.org/r/114897/diff/
 
 
 Testing
 ---
 
 ThreadWeaver compiles under GCC on Linux if (and only if) I change the 
 src/CMakeLists.txt file to use add_compile_options instead of setting 
 CMAKE_CXX_FLAGS.
 
 
 Thanks,
 
 Alex Merry
 


___
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel


Re: Review Request 114897: Make KDE_ENABLE_EXCEPTIONS a list

2014-01-07 Thread Alex Merry
On 07/01/14 18:00, Stephen Kelly wrote:
 Alex Merry wrote:
 
 Hrm.  After some investigation: I'm not entirely sure.  The simplest
 answer is that's what qmake does
 
 Please tell me you noticed that I asked about -U, not -D ...

Yes.  qmake actually doesn't use -U directly; it simply sets
-DQT_NO_EXCEPTIONS if you do CONFIG+=exceptions_off, and does not set it
otherwise.  -U is something of a hack to override -DQT_NO_EXCEPTIONS
that we set by default.

I'm not certain what the right thing to do here is.  Arguably, we
should always set -DQT_NO_EXCEPTIONS (at least for frameworks) so that
we can be sure they build when Qt has exceptions disabled.

Either way, I'm really not convinced qmake does the right thing, as I
think QT_NO_EXCEPTIONS should really be defined if and only if the Qt
library itself was compiled with exceptions disabled.

Alex

___
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel


Re: Review Request 114897: Make KDE_ENABLE_EXCEPTIONS a list

2014-01-07 Thread Alex Merry

---
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/114897/
---

(Updated Jan. 7, 2014, 7:58 p.m.)


Review request for Build System, KDE Frameworks and Stephen Kelly.


Changes
---

Rebase against latest master.


Repository: extra-cmake-modules


Description
---

Make KDE_ENABLE_EXCEPTIONS a list

When KDE_ENABLE_EXCEPTIONS contains two arguments, they are currently a
single string containing those space-separated arguments.  It can thus
be used as
set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} ${KDE_ENABLE_EXCEPTIONS})
However, the proper way to set compile flags these days is to use
add_compile_options, as in
add_compile_options(${KDE_ENABLE_EXCEPTIONS})
which requires KDE_ENABLE_EXCEPTIONS to be a list.

Note that this change means that setting CMAKE_CXX_FLAGS like above NO
LONGER WORKS (as you will get the argument
-fexceptions;-UQT_NO_EXCEPTIONS added for GCC and Clang).


Diffs (updated)
-

  kde-modules/KDECompilerSettings.cmake 
cd93e519dea4917a6c09df02bb32254f468c2861 

Diff: https://git.reviewboard.kde.org/r/114897/diff/


Testing
---

ThreadWeaver compiles under GCC on Linux if (and only if) I change the 
src/CMakeLists.txt file to use add_compile_options instead of setting 
CMAKE_CXX_FLAGS.


Thanks,

Alex Merry

___
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel


Re: Review Request 114897: Make KDE_ENABLE_EXCEPTIONS a list

2014-01-07 Thread Stephen Kelly
Alex Merry wrote:

 On 07/01/14 18:00, Stephen Kelly wrote:
 Alex Merry wrote:
 
 Hrm.  After some investigation: I'm not entirely sure.  The simplest
 answer is that's what qmake does
 
 Please tell me you noticed that I asked about -U, not -D ...
 
 Yes.  qmake actually doesn't use -U directly; 

Right. So the -U, at least, is not what qmake does.

 it simply sets
 -DQT_NO_EXCEPTIONS if you do CONFIG+=exceptions_off, and does not set it
 otherwise.  -U is something of a hack to override -DQT_NO_EXCEPTIONS
 that we set by default.

Indeed. I'm skeptical about setting -DQT_NO_EXCEPTIONS by default.

 
 I'm not certain what the right thing to do here is.  Arguably, we
 should always set -DQT_NO_EXCEPTIONS (at least for frameworks) so that
 we can be sure they build when Qt has exceptions disabled.

Are you sure?

 Either way, I'm really not convinced qmake does the right thing, as I
 think QT_NO_EXCEPTIONS should really be defined if and only if the Qt
 library itself was compiled with exceptions disabled.

That information can be conveyed from the Qt CMake config files if needed, 
or an installed header file if that's how the Qt list wants to do it. No 
problem.

Thanks,

Steve.


___
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel


Re: Review Request 114897: Make KDE_ENABLE_EXCEPTIONS a list

2014-01-07 Thread Alex Merry
On 07/01/14 22:34, Stephen Kelly wrote:
 Alex Merry wrote:
 
 On 07/01/14 18:00, Stephen Kelly wrote:
 Alex Merry wrote:

 Hrm.  After some investigation: I'm not entirely sure.  The simplest
 answer is that's what qmake does

 Please tell me you noticed that I asked about -U, not -D ...

 Yes.  qmake actually doesn't use -U directly; 
 
 Right. So the -U, at least, is not what qmake does.

No, but the effect should be the same.

 I'm not certain what the right thing to do here is.  Arguably, we
 should always set -DQT_NO_EXCEPTIONS (at least for frameworks) so that
 we can be sure they build when Qt has exceptions disabled.
 
 Are you sure?

No.

 Either way, I'm really not convinced qmake does the right thing, as I
 think QT_NO_EXCEPTIONS should really be defined if and only if the Qt
 library itself was compiled with exceptions disabled.
 
 That information can be conveyed from the Qt CMake config files if needed, 
 or an installed header file if that's how the Qt list wants to do it. No 
 problem.

I'm inclined to say we should not touch QT_NO_EXCEPTIONS at all (which
makes it undefined by default except on GCC with -fno-exceptions, where
I believe it should get set in qglobal.h), and maybe push for a
discussion in the Qt Project about whether it should be set to match how
Qt was built (in qmake and Qt5CoreConfig.cmake, or in an installed
header file).

Alex



___
Kde-frameworks-devel mailing list
Kde-frameworks-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-frameworks-devel