Resync
[CMakeLuaTailorHgBridge.git] / CMakeLua / Modules / Platform / Windows-gcc.cmake
blob73c10c1355980460cdce746d84d7ed2806e8b507
1 SET(CMAKE_LINK_LIBRARY_SUFFIX "")  
2 SET(CMAKE_STATIC_LIBRARY_PREFIX "lib")
3 SET(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
4 SET(CMAKE_SHARED_LIBRARY_PREFIX "lib")          # lib
5 SET(CMAKE_SHARED_LIBRARY_SUFFIX ".dll")          # .so
6 SET(CMAKE_SHARED_MODULE_PREFIX "lib")          # lib
7 SET(CMAKE_SHARED_MODULE_SUFFIX ".dll")          # .so
8 SET(CMAKE_IMPORT_LIBRARY_PREFIX "lib")
9 SET(CMAKE_IMPORT_LIBRARY_SUFFIX ".dll.a")
10 SET(CMAKE_EXECUTABLE_SUFFIX ".exe")          # .exe
11 SET(CMAKE_DL_LIBS "")
12 SET(CMAKE_SHARED_LIBRARY_C_FLAGS "")            # -pic 
13 SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "")            # -pic 
14 SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")       # -shared
15 SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")         # +s, flag for exe link to use shared lib
16 SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "")       # -rpath
17 SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP "")   # : or empty
19 SET(CMAKE_SHARED_MODULE_C_FLAGS "${CMAKE_SHARED_LIBRARY_C_FLAGS}")               # -pic 
20 SET(CMAKE_SHARED_MODULE_CXX_FLAGS 
21   "${CMAKE_SHARED_LIBRARY_CXX_FLAGS}")           # -pic 
22 SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS 
23   "${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}") # -shared
24 SET(CMAKE_LIBRARY_PATH_FLAG "-L")
25 SET(CMAKE_LINK_LIBRARY_FLAG "-l")
26 SET(CMAKE_EXTRA_LINK_EXTENSIONS ".lib") # MinGW can also link to a MS .lib
27 SET(CMAKE_CREATE_WIN32_EXE  "-mwindows")
29 IF(MINGW)
30   SET(CMAKE_FIND_LIBRARY_PREFIXES "lib" "")
31   SET(CMAKE_FIND_LIBRARY_SUFFIXES ".dll" ".dll.a" ".a" ".lib")
32   SET (CMAKE_C_STANDARD_LIBRARIES_INIT "-lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32")
33   SET(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}")
34 ENDIF(MINGW)
36 SET(CMAKE_GNULD_IMAGE_VERSION
37   "-Wl,--major-image-version,<TARGET_VERSION_MAJOR>,--minor-image-version,<TARGET_VERSION_MINOR>")
39 SET(CMAKE_C_CREATE_SHARED_MODULE
40   "<CMAKE_C_COMPILER> <CMAKE_SHARED_MODULE_C_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_MODULE_CREATE_C_FLAGS> -o <TARGET> ${CMAKE_GNULD_IMAGE_VERSION} <OBJECTS> <LINK_LIBRARIES>")
41 SET(CMAKE_CXX_CREATE_SHARED_MODULE
42   "<CMAKE_CXX_COMPILER> <CMAKE_SHARED_MODULE_CXX_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS> -o <TARGET> ${CMAKE_GNULD_IMAGE_VERSION} <OBJECTS> <LINK_LIBRARIES>")
44 SET(CMAKE_C_CREATE_SHARED_LIBRARY
45   "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> -o <TARGET> -Wl,--out-implib,<TARGET_IMPLIB> ${CMAKE_GNULD_IMAGE_VERSION} <OBJECTS> <LINK_LIBRARIES>")
46 SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
47   "<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> -o <TARGET> -Wl,--out-implib,<TARGET_IMPLIB> ${CMAKE_GNULD_IMAGE_VERSION} <OBJECTS> <LINK_LIBRARIES>")
49 SET(CMAKE_C_LINK_EXECUTABLE
50   "<CMAKE_C_COMPILER> <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS>  -o <TARGET> -Wl,--out-implib,<TARGET_IMPLIB> ${CMAKE_GNULD_IMAGE_VERSION} <LINK_LIBRARIES>")
51 SET(CMAKE_CXX_LINK_EXECUTABLE
52   "<CMAKE_CXX_COMPILER>  <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS>  -o <TARGET> -Wl,--out-implib,<TARGET_IMPLIB> ${CMAKE_GNULD_IMAGE_VERSION} <LINK_LIBRARIES>")
54 # Initialize C link type selection flags.  These flags are used when
55 # building a shared library, shared module, or executable that links
56 # to other libraries to select whether to use the static or shared
57 # versions of the libraries.
58 IF(MSYS OR MINGW)
59   FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
60     SET(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
61     SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
62   ENDFOREACH(type)
63 ENDIF(MSYS OR MINGW)
65 # Create archiving rules to support large object file lists for static
66 # libraries.
67 IF(MSYS OR MINGW)
68   SET(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>")
69   SET(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> r  <TARGET> <LINK_FLAGS> <OBJECTS>")
70   SET(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
71   SET(CMAKE_CXX_ARCHIVE_CREATE ${CMAKE_C_ARCHIVE_CREATE})
72   SET(CMAKE_CXX_ARCHIVE_APPEND ${CMAKE_C_ARCHIVE_APPEND})
73   SET(CMAKE_CXX_ARCHIVE_FINISH ${CMAKE_C_ARCHIVE_FINISH})
74 ENDIF(MSYS OR MINGW)