diff options
author | Brad King <brad.king@kitware.com> | 2009-12-02 14:52:00 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2009-12-02 14:52:00 (GMT) |
commit | e28c16b482ace7a27ddd9c3680ce942ca83a9f38 (patch) | |
tree | f2f47fe778e7535335d5ee800c32bf22d42cb97f /Modules/Platform/CYGWIN-GNU.cmake | |
parent | f3cd66577f3ed061123b1145f557eb28b80520dd (diff) | |
download | CMake-e28c16b482ace7a27ddd9c3680ce942ca83a9f38.zip CMake-e28c16b482ace7a27ddd9c3680ce942ca83a9f38.tar.gz CMake-e28c16b482ace7a27ddd9c3680ce942ca83a9f38.tar.bz2 |
Split GNU compiler information files
This moves GNU compiler flags into new-style modules
Compiler/GNU-<lang>.cmake
Platform/<os>-GNU-<lang>.cmake
We use language-independent helper modules
Compiler/GNU.cmake
Platform/<os>-GNU.cmake
to define macros consolidating the information.
Diffstat (limited to 'Modules/Platform/CYGWIN-GNU.cmake')
-rw-r--r-- | Modules/Platform/CYGWIN-GNU.cmake | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/Modules/Platform/CYGWIN-GNU.cmake b/Modules/Platform/CYGWIN-GNU.cmake new file mode 100644 index 0000000..5ca6697 --- /dev/null +++ b/Modules/Platform/CYGWIN-GNU.cmake @@ -0,0 +1,51 @@ + +#============================================================================= +# Copyright 2002-2009 Kitware, Inc. +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distributed this file outside of CMake, substitute the full +# License text for the above reference.) + +# This module is shared by multiple languages; use include blocker. +if(__CYGWIN_COMPILER_GNU) + return() +endif() +set(__CYGWIN_COMPILER_GNU 1) + +set(CMAKE_DL_LIBS "-lgdi32" ) +set(CMAKE_EXE_LINKER_FLAGS_INIT "-Wl,--enable-auto-import") +set(CMAKE_CREATE_WIN32_EXE "-mwindows") + +set(CMAKE_GNULD_IMAGE_VERSION + "-Wl,--major-image-version,<TARGET_VERSION_MAJOR>,--minor-image-version,<TARGET_VERSION_MINOR>") + +macro(__cygwin_compiler_gnu lang) + # Binary link rules. + set(CMAKE_${lang}_CREATE_SHARED_MODULE + "<CMAKE_${lang}_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_MODULE_${lang}_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS> -o <TARGET> ${CMAKE_GNULD_IMAGE_VERSION} <OBJECTS> <LINK_LIBRARIES>") + set(CMAKE_${lang}_CREATE_SHARED_LIBRARY + "<CMAKE_${lang}_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_${lang}_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS> -o <TARGET> -Wl,--out-implib,<TARGET_IMPLIB> ${CMAKE_GNULD_IMAGE_VERSION} <OBJECTS> <LINK_LIBRARIES>") + set(CMAKE_${lang}_LINK_EXECUTABLE + "<CMAKE_${lang}_COMPILER> <FLAGS> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> -Wl,--out-implib,<TARGET_IMPLIB> ${CMAKE_GNULD_IMAGE_VERSION} <LINK_LIBRARIES>") + + set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "") # No -fPIC on cygwin + + # Initialize C link type selection flags. These flags are used when + # building a shared library, shared module, or executable that links + # to other libraries to select whether to use the static or shared + # versions of the libraries. + FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE) + SET(CMAKE_${type}_LINK_STATIC_${lang}_FLAGS "-Wl,-Bstatic") + SET(CMAKE_${type}_LINK_DYNAMIC_${lang}_FLAGS "-Wl,-Bdynamic") + ENDFOREACH(type) + + # To simulate UNIX shared libs we export/import all DLL symbols. + set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS} -Wl,--export-all-symbols -Wl,--enable-auto-import") + set(CMAKE_SHARED_MODULE_CREATE_${lang}_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS}") +endmacro() |