summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorKen Martin <ken.martin@kitware.com>2003-08-05 13:55:20 (GMT)
committerKen Martin <ken.martin@kitware.com>2003-08-05 13:55:20 (GMT)
commitdfcd4f21541f2981f53ca6f1ae15da2f88a223f7 (patch)
tree70974fbb6c25fb7c05d2200834c45c3b9671fd1c /Modules
parent5ffb75bc6c18b05e28d88d8b17e0a19750c34a22 (diff)
downloadCMake-dfcd4f21541f2981f53ca6f1ae15da2f88a223f7.zip
CMake-dfcd4f21541f2981f53ca6f1ae15da2f88a223f7.tar.gz
CMake-dfcd4f21541f2981f53ca6f1ae15da2f88a223f7.tar.bz2
added test for whether pdbtype should be used for nmake
Diffstat (limited to 'Modules')
-rw-r--r--Modules/CMakeTestNMakeCLVersion.c2
-rw-r--r--Modules/Platform/Windows-cl.cmake25
2 files changed, 25 insertions, 2 deletions
diff --git a/Modules/CMakeTestNMakeCLVersion.c b/Modules/CMakeTestNMakeCLVersion.c
new file mode 100644
index 0000000..3cece2a
--- /dev/null
+++ b/Modules/CMakeTestNMakeCLVersion.c
@@ -0,0 +1,2 @@
+VERSION=_MSC_VER
+
diff --git a/Modules/Platform/Windows-cl.cmake b/Modules/Platform/Windows-cl.cmake
index 6ea9322..fa246b8 100644
--- a/Modules/Platform/Windows-cl.cmake
+++ b/Modules/Platform/Windows-cl.cmake
@@ -77,12 +77,33 @@ IF(CMAKE_GENERATOR MATCHES "Visual Studio 7")
SET (CMAKE_NOT_USING_CONFIG_FLAGS 1)
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7")
+# does the compiler support pdbtype
+SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE 1)
+IF(CMAKE_GENERATOR MATCHES "NMake Makefiles")
+ EXEC_PROGRAM(${CMAKE_CXX_COMPILER}
+ ARGS /nologo -EP ${CMAKE_ROOT}/Modules/CMakeTestNMakeCLVersion.c
+ OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT
+ RETURN_VALUE CMAKE_COMPILER_RETURN
+ )
+ IF(NOT CMAKE_COMPILER_RETURN)
+ IF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*VERSION=1[3-9][0-9][0-9].*" )
+ SET(CMAKE_COMPILER_SUPPORTS_PDBTYPE 0)
+ ENDIF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*VERSION=1[3-9][0-9][0-9].*" )
+ ENDIF(NOT CMAKE_COMPILER_RETURN)
+ENDIF(CMAKE_GENERATOR MATCHES "NMake Makefiles")
+
# executable linker flags
SET (CMAKE_LINK_DEF_FILE_FLAG "/DEF:")
SET (CMAKE_EXE_LINKER_FLAGS_INIT "/STACK:10000000 /machine:I386 /INCREMENTAL:YES")
-SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug /pdbtype:sept")
-SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug /pdbtype:sept")
+IF (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
+ SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug /pdbtype:sept")
+ SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug /pdbtype:sept")
+ELSE (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
+ SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug")
+ SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug")
+ENDIF (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
+
SET (CMAKE_SHARED_LINKER_FLAGS_INIT ${CMAKE_EXE_LINKER_FLAGS_INIT})
SET (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT})
SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT})