summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2007-03-22 13:45:25 (GMT)
committerBrad King <brad.king@kitware.com>2007-03-22 13:45:25 (GMT)
commit5a32aa5919bd9dab272748c0e0ea12fbcd36436b (patch)
treeb4b0d2c70b896a8c95c91c88112ec2b3bb9d987d /Modules
parent187816c9371e49769c02481ea46491b2d7e22d66 (diff)
downloadCMake-5a32aa5919bd9dab272748c0e0ea12fbcd36436b.zip
CMake-5a32aa5919bd9dab272748c0e0ea12fbcd36436b.tar.gz
CMake-5a32aa5919bd9dab272748c0e0ea12fbcd36436b.tar.bz2
ENH: Added target property ENABLE_EXPORTS for executable targets. It enables the executables for linking by loadable modules that import symbols from the executable. This finishes the executable import library support mentioned in bug #4210.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/Platform/Windows-bcc32.cmake20
-rw-r--r--Modules/Platform/Windows-wcl386.cmake11
2 files changed, 22 insertions, 9 deletions
diff --git a/Modules/Platform/Windows-bcc32.cmake b/Modules/Platform/Windows-bcc32.cmake
index 82fa064..382bf2d 100644
--- a/Modules/Platform/Windows-bcc32.cmake
+++ b/Modules/Platform/Windows-bcc32.cmake
@@ -26,6 +26,11 @@ SET(CMAKE_FIND_LIBRARY_SUFFIXES "-bcc.lib" ".lib")
# Borland cannot handle + in the file name, so mangle object file name
SET (CMAKE_MANGLE_OBJECT_FILE_NAMES "ON")
+# Create an import library for another target.
+SET(CMAKE_CXX_CREATE_IMPORT_LIBRARY
+ "implib -c -w <TARGET_IMPLIB> <TARGET>"
+ )
+
# Create a C++ module library.
SET(CMAKE_CXX_CREATE_SHARED_MODULE
"<CMAKE_CXX_COMPILER> ${CMAKE_START_TEMP_FILE}-e<TARGET> -tWD <LINK_FLAGS> -tWR <LINK_LIBRARIES> <OBJECTS>${CMAKE_END_TEMP_FILE}"
@@ -33,9 +38,12 @@ SET(CMAKE_CXX_CREATE_SHARED_MODULE
# Create a C++ shared library.
# First create a module and then its import library.
-SET(CMAKE_CXX_CREATE_SHARED_LIBRARY ${CMAKE_CXX_CREATE_SHARED_MODULE}
- "implib -c -w <TARGET_IMPLIB> <TARGET>"
- )
+SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
+ ${CMAKE_CXX_CREATE_SHARED_MODULE}
+ ${CMAKE_CXX_CREATE_IMPORT_LIBRARY})
+
+# Create an import library for another target.
+SET(CMAKE_C_CREATE_IMPORT_LIBRARY ${CMAKE_CXX_CREATE_IMPORT_LIBRARY})
# Create a C module library.
SET(CMAKE_C_CREATE_SHARED_MODULE
@@ -44,9 +52,9 @@ SET(CMAKE_C_CREATE_SHARED_MODULE
# Create a C shared library.
# First create a module and then its import library.
-SET(CMAKE_C_CREATE_SHARED_LIBRARY ${CMAKE_C_CREATE_SHARED_MODULE}
- "implib -c -w <TARGET_IMPLIB> <TARGET>"
- )
+SET(CMAKE_C_CREATE_SHARED_LIBRARY
+ ${CMAKE_C_CREATE_SHARED_MODULE}
+ ${CMAKE_C_CREATE_IMPORT_LIBRARY})
# create a C++ static library
SET(CMAKE_CXX_CREATE_STATIC_LIBRARY "tlib ${CMAKE_START_TEMP_FILE}/p512 <LINK_FLAGS> /a <TARGET_QUOTED> <OBJECTS_QUOTED>${CMAKE_END_TEMP_FILE}")
diff --git a/Modules/Platform/Windows-wcl386.cmake b/Modules/Platform/Windows-wcl386.cmake
index f56e148..acec459 100644
--- a/Modules/Platform/Windows-wcl386.cmake
+++ b/Modules/Platform/Windows-wcl386.cmake
@@ -25,6 +25,10 @@ SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-br -bm -ot -dNDEBUG")
SET (CMAKE_C_STANDARD_LIBRARIES_INIT "library clbrdll.lib library plbrdll.lib library kernel32.lib library user32.lib library gdi32.lib library winspool.lib library comdlg32.lib library advapi32.lib library shell32.lib library ole32.lib library oleaut32.lib library uuid.lib library odbc32.lib library odbccp32.lib")
SET (CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}")
+SET(CMAKE_C_CREATE_IMPORT_LIBRARY
+ "wlib -q -n -b <TARGET_IMPLIB> +<TARGET>")
+SET(CMAKE_CXX_CREATE_IMPORT_LIBRARY ${CMAKE_C_CREATE_IMPORT_LIBRARY})
+
SET(CMAKE_C_LINK_EXECUTABLE
"wlink ${CMAKE_START_TEMP_FILE} ${CMAKE_WLINK_QUIET} name <TARGET> option caseexact file {<OBJECTS>} <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
@@ -39,9 +43,10 @@ SET(CMAKE_C_COMPILE_OBJECT
"<CMAKE_C_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_WCL_QUIET} <FLAGS> -dWIN32 -fo<OBJECT> -c -cc <SOURCE>${CMAKE_END_TEMP_FILE}")
SET(CMAKE_CXX_CREATE_SHARED_MODULE
- "wlink ${CMAKE_START_TEMP_FILE} system nt_dll ${CMAKE_WLINK_QUIET} name <TARGET> option caseexact file {<OBJECTS>} <LINK_LIBRARIES>")
-SET(CMAKE_CXX_CREATE_SHARED_LIBRARY ${CMAKE_CXX_CREATE_SHARED_MODULE}
- "wlib -q -n -b <TARGET_IMPLIB> +<TARGET> ${CMAKE_END_TEMP_FILE}")
+ "wlink ${CMAKE_START_TEMP_FILE} system nt_dll ${CMAKE_WLINK_QUIET} name <TARGET> option caseexact file {<OBJECTS>} <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
+SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
+ ${CMAKE_CXX_CREATE_SHARED_MODULE}
+ ${CMAKE_CXX_CREATE_IMPORT_LIBRARY})
# create a C shared library
SET(CMAKE_C_CREATE_SHARED_LIBRARY ${CMAKE_CXX_CREATE_SHARED_LIBRARY})