Browse Source

Suppress GNU flag -fPIC on Windows

Commit "Modernize GNU compiler info on Windows" (2009-12-02) reorganized
GNU flags on Windows but let -fPIC slip through for compilation of
objects in shared libraries.  While this flag is valid on most GNU
compiler platforms we need to suppress it in Windows-GNU.cmake just as
we already do in CYGWIN-GNU.cmake.
Brad King 15 years ago
parent
commit
4eba05de42
1 changed files with 2 additions and 0 deletions
  1. 2 0
      Modules/Platform/Windows-GNU.cmake

+ 2 - 0
Modules/Platform/Windows-GNU.cmake

@@ -67,6 +67,8 @@ macro(__windows_compiler_gnu lang)
     endforeach(type)
   endif()
 
+  set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "") # No -fPIC on Windows
+
   # Binary link rules.
   set(CMAKE_${lang}_CREATE_SHARED_MODULE
     "<CMAKE_${lang}_COMPILER> <CMAKE_SHARED_MODULE_${lang}_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS> -o <TARGET> ${CMAKE_GNULD_IMAGE_VERSION} <OBJECTS> <LINK_LIBRARIES>")