[cmake-developers] Adding logic to CMake for -fPIE and -fPIC

Brad King brad.king at kitware.com
Fri Jun 8 08:22:09 EDT 2012


On 06/08/2012 04:50 AM, Stephen Kelly wrote:
> I still have an error with Watcom that I don't know how to fix, which I 
> think is the last error on this topic:
> 
> http://open.cdash.org/testDetails.php?test=148809149&build=2343558
> 
> My guess was that the CMAKE_CXX_COMPILE_OPTIONS_DLL flag is not being 
> populated or used, though I don't see why.
> 
> Can someone with access to that box debug it a bit please?

The compiler flags are fine.  This compiler just doesn't export
inline class members from DLLs, it appears.  Use the patch below.

-Brad

diff --git a/Tests/PositionIndependentTargets/pic_lib.cpp b/Tests/PositionIndependentTargets/pic_lib.cpp
index ec351b4..b8b25a3 100644
--- a/Tests/PositionIndependentTargets/pic_lib.cpp
+++ b/Tests/PositionIndependentTargets/pic_lib.cpp
@@ -3,8 +3,10 @@

 class PIC_TEST_EXPORT Dummy
 {
-  int dummy()
-  {
-    return 0;
-  }
+  int dummy();
 };
+
+int Dummy::dummy()
+{
+  return 0;
+}



More information about the cmake-developers mailing list