Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
commit 09c06a2f457ec9557bcdf1809ecb4b50b2fb654a
Author: Amine Khaldi <amine.khaldi@reactos.org>
Date: Fri Oct 27 22:18:01 2017 +0100
[CLANG-CL] Initial commit that allows us to compile ReactOS with clang-cl.
diff --git a/sdk/cmake/Platform/Windows-MSVC.cmake b/sdk/cmake/Platform/Windows-MSVC.cmake
index dc09c7479f2..5c3912cfeab 100644
--- a/sdk/cmake/Platform/Windows-MSVC.cmake
+++ b/sdk/cmake/Platform/Windows-MSVC.cmake
@@ -193,8 +193,13 @@ else()
endif()
if (CMAKE_COMPILER_SUPPORTS_PDBTYPE)
+ if(NOT USE_CLANG_CL)
set (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug /pdbtype:sept")
set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug /pdbtype:sept ${MSVC_INCREMENTAL_YES_FLAG}")
+ else()
+ set(CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug")
+ set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug")
+ endif()
else ()
set (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug")
set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug ${MSVC_INCREMENTAL_YES_FLAG}")
commit 37e99b9f99fa96a5623519ac7e39f260b57afca3
Author: Thomas Faber <thomas.faber@reactos.org>
Date: Sun Nov 13 10:19:22 2016 +0000
[CMAKE]
- Use CMake 3.4's <INCLUDES> rule variable in addition to <FLAGS>.
CORE-12373 #resolve
svn path=/trunk/; revision=73220
diff --git a/reactos/sdk/cmake/Platform/Windows-MSVC.cmake b/reactos/sdk/cmake/Platform/Windows-MSVC.cmake
index 183f90fec1c..dc09c7479f2 100644
--- a/reactos/sdk/cmake/Platform/Windows-MSVC.cmake
+++ b/reactos/sdk/cmake/Platform/Windows-MSVC.cmake
@@ -59,7 +59,11 @@ endif()
# make sure to enable languages after setting configuration types
enable_language(RC)
+if(CMAKE_VERSION VERSION_LESS 3.4.0)
set(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
+else()
+ set(CMAKE_COMPILE_RESOURCE "rc <INCLUDES> <FLAGS> /fo<OBJECT> <SOURCE>")
+endif()
if("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
set(MSVC_IDE 1)
@@ -224,12 +228,21 @@ macro(__windows_compiler_msvc lang)
set(CMAKE_${lang}_CREATE_SHARED_MODULE ${CMAKE_${lang}_CREATE_SHARED_LIBRARY})
set(CMAKE_${lang}_CREATE_STATIC_LIBRARY "<CMAKE_LINKER> /lib ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ")
+ if(CMAKE_VERSION VERSION_LESS 3.4.0)
set(CMAKE_${lang}_COMPILE_OBJECT
"<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <FLAGS> <DEFINES> /Fo<OBJECT> /Fd<OBJECT_DIR>/ -c <SOURCE>${CMAKE_END_TEMP_FILE}")
set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE
"<CMAKE_${lang}_COMPILER> > <PREPROCESSED_SOURCE> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <FLAGS> <DEFINES> -E <SOURCE>${CMAKE_END_TEMP_FILE}")
set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE
"<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <FLAGS> <DEFINES> /FoNUL /FAs /Fa<ASSEMBLY_SOURCE> /c <SOURCE>${CMAKE_END_TEMP_FILE}")
+ else()
+ set(CMAKE_${lang}_COMPILE_OBJECT
+ "<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <INCLUDES> <FLAGS> <DEFINES> /Fo<OBJECT> /Fd<OBJECT_DIR>/ -c <SOURCE>${CMAKE_END_TEMP_FILE}")
+ set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE
+ "<CMAKE_${lang}_COMPILER> > <PREPROCESSED_SOURCE> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <INCLUDES> <FLAGS> <DEFINES> -E <SOURCE>${CMAKE_END_TEMP_FILE}")
+ set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE
+ "<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <INCLUDES> <FLAGS> <DEFINES> /FoNUL /FAs /Fa<ASSEMBLY_SOURCE> /c <SOURCE>${CMAKE_END_TEMP_FILE}")
+ endif()
set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 1)
set(CMAKE_${lang}_LINK_EXECUTABLE
commit dcf26d6a7fe6b4f3567dc4f3a34c6c55ec6a19f9
Author: Amine Khaldi <amine.khaldi@reactos.org>
Date: Sat May 23 10:32:43 2015 +0000
[CMAKE] Don't set initial flags for Release build type, let us handle them ourselves.
svn path=/trunk/; revision=67860
diff --git a/reactos/cmake/Platform/Windows-MSVC.cmake b/reactos/cmake/Platform/Windows-MSVC.cmake
index 3f32ff4e6b4..183f90fec1c 100644
--- a/reactos/cmake/Platform/Windows-MSVC.cmake
+++ b/reactos/cmake/Platform/Windows-MSVC.cmake
@@ -237,7 +237,7 @@ macro(__windows_compiler_msvc lang)
set(CMAKE_${lang}_FLAGS_INIT "")
set(CMAKE_${lang}_FLAGS_DEBUG_INIT "")
- set(CMAKE_${lang}_FLAGS_RELEASE_INIT "/MD /O2 /Ob2 /D NDEBUG")
+ set(CMAKE_${lang}_FLAGS_RELEASE_INIT "")
set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG")
set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT "/MD /O1 /Ob1 /D NDEBUG")
endmacro()
commit 1023de9cc6eb2955ea101f1f7097cefaf3604ffa
Author: Amine Khaldi <amine.khaldi@reactos.org>
Date: Wed Oct 8 17:55:55 2014 +0000
[CMAKE/MSVC]
* We don't need to set /implib, we generate our own.
svn path=/trunk/; revision=64597
diff --git a/reactos/cmake/Platform/Windows-MSVC.cmake b/reactos/cmake/Platform/Windows-MSVC.cmake
index bf73b791924..3f32ff4e6b4 100644
--- a/reactos/cmake/Platform/Windows-MSVC.cmake
+++ b/reactos/cmake/Platform/Windows-MSVC.cmake
@@ -219,7 +219,7 @@ macro(__windows_compiler_msvc lang)
set(_CMAKE_VS_LINK_DLL "<CMAKE_COMMAND> -E vs_link_dll ")
set(_CMAKE_VS_LINK_EXE "<CMAKE_COMMAND> -E vs_link_exe ")
endif()
- set(CMAKE_${lang}_CREATE_SHARED_LIBRARY "<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /dll /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <LINK_FLAGS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
+ set(CMAKE_${lang}_CREATE_SHARED_LIBRARY "<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /pdb:<TARGET_PDB> /dll /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <LINK_FLAGS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
set(CMAKE_${lang}_CREATE_SHARED_MODULE ${CMAKE_${lang}_CREATE_SHARED_LIBRARY})
set(CMAKE_${lang}_CREATE_STATIC_LIBRARY "<CMAKE_LINKER> /lib ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ")
@@ -233,7 +233,7 @@ macro(__windows_compiler_msvc lang)
set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 1)
set(CMAKE_${lang}_LINK_EXECUTABLE
- "${_CMAKE_VS_LINK_EXE}<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
+ "${_CMAKE_VS_LINK_EXE}<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /pdb:<TARGET_PDB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
set(CMAKE_${lang}_FLAGS_INIT "")
set(CMAKE_${lang}_FLAGS_DEBUG_INIT "")
commit 7872f6a066cc2ee20530d93001ae9667b0ad5895
Author: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Date: Wed Mar 26 00:49:41 2014 +0000
[CMAKE]
Improve comparison. Needs to be send upstream, AmineKhaldi :)
svn path=/trunk/; revision=62565
diff --git a/reactos/cmake/Platform/Windows-MSVC.cmake b/reactos/cmake/Platform/Windows-MSVC.cmake
index baf6ad3a3bb..bf73b791924 100644
--- a/reactos/cmake/Platform/Windows-MSVC.cmake
+++ b/reactos/cmake/Platform/Windows-MSVC.cmake
@@ -119,7 +119,7 @@ if(CMAKE_FORCE_WIN64 OR CMAKE_FORCE_IA64)
set(CMAKE_CL_64 1)
endif()
-if("${MSVC_VERSION}" GREATER 1599)
+if(MSVC_VERSION GREATER 1599)
set(MSVC_INCREMENTAL_DEFAULT ON)
endif()
commit edfeae46cf898c72846eeadf0f8b4c61013deef6
Author: Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
Date: Mon Mar 24 21:40:16 2014 +0000
[CMAKE]
- Partly update/sync Windows-MSVC.cmake with RosBE 2.1.1 : few flags "fixes". Amine, can you please check whether there are other things to sync too (maybe those WinCE things, even if it's unuseful for ROS itself, and maybe some other vs. MSVC_C_ARCHITECTURE_ID _MSVC_C_ARCHITECTURE_FAMILY flags, and so on... and with syncs of other .cmake files??)
- Remove unneeded manually setting of stack size, it is done automatically by the compiler.
- Add a "/MANIFEST:NO" switch to the linker so that (unuseful) manifest files are not automatically created and added to the host-tools, especially, because that causes some concurrent accesses failures on MSVC 2005/2008...
CORE-8023
svn path=/trunk/; revision=62560
diff --git a/reactos/cmake/Platform/Windows-MSVC.cmake b/reactos/cmake/Platform/Windows-MSVC.cmake
index 0d957237a60..baf6ad3a3bb 100644
--- a/reactos/cmake/Platform/Windows-MSVC.cmake
+++ b/reactos/cmake/Platform/Windows-MSVC.cmake
@@ -22,7 +22,7 @@ set(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:")
set(CMAKE_LINK_LIBRARY_FLAG "")
set(MSVC 1)
-# hack: if a new cmake (which uses CMAKE__LINKER) runs on an old build tree
+# hack: if a new cmake (which uses CMAKE_LINKER) runs on an old build tree
# (where link was hardcoded) and where CMAKE_LINKER isn't in the cache
# and still cmake didn't fail in CMakeFindBinUtils.cmake (because it isn't rerun)
# hardcode CMAKE_LINKER here to link, so it behaves as it did before, Alex
@@ -41,6 +41,7 @@ set(WIN32 1)
if(CMAKE_SYSTEM_NAME MATCHES "WindowsCE")
set(CMAKE_CREATE_WIN32_EXE "/subsystem:windowsce /entry:WinMainCRTStartup")
set(CMAKE_CREATE_CONSOLE_EXE "/subsystem:windowsce /entry:mainACRTStartup")
+ set(WINCE 1)
else()
set(CMAKE_CREATE_WIN32_EXE "/subsystem:windows")
set(CMAKE_CREATE_CONSOLE_EXE "/subsystem:console")
@@ -80,6 +81,7 @@ if(NOT MSVC_VERSION)
set(MSVC10)
set(MSVC11)
+ set(MSVC12)
set(MSVC60)
set(MSVC70)
set(MSVC71)
@@ -87,7 +89,9 @@ if(NOT MSVC_VERSION)
set(MSVC90)
set(CMAKE_COMPILER_2005)
set(CMAKE_COMPILER_SUPPORTS_PDBTYPE)
- if(NOT "${_compiler_version}" VERSION_LESS 17)
+ if(NOT "${_compiler_version}" VERSION_LESS 18)
+ set(MSVC12 1)
+ elseif(NOT "${_compiler_version}" VERSION_LESS 17)
set(MSVC11 1)
elseif(NOT "${_compiler_version}" VERSION_LESS 16)
set(MSVC10 1)
@@ -106,7 +110,7 @@ if(NOT MSVC_VERSION)
endif()
endif()
-if(MSVC_C_ARCHITECTURE_ID MATCHES 64)
+if(MSVC_C_ARCHITECTURE_ID MATCHES 64 OR MSVC_CXX_ARCHITECTURE_ID MATCHES 64)
set(CMAKE_CL_64 1)
else()
set(CMAKE_CL_64 0)
@@ -160,7 +164,7 @@ set(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}")
# executable linker flags
set (CMAKE_LINK_DEF_FILE_FLAG "/DEF:")
-# set the stack size and the machine type
+# set the machine type
set(_MACHINE_ARCH_FLAG ${MSVC_C_ARCHITECTURE_ID})
if(NOT _MACHINE_ARCH_FLAG)
set(_MACHINE_ARCH_FLAG ${MSVC_CXX_ARCHITECTURE_ID})
@@ -173,7 +177,7 @@ if(CMAKE_SYSTEM_NAME MATCHES "WindowsCE")
endif()
endif()
set (CMAKE_EXE_LINKER_FLAGS_INIT
- "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:10000000 /machine:${_MACHINE_ARCH_FLAG}")
+ "${CMAKE_EXE_LINKER_FLAGS_INIT} /machine:${_MACHINE_ARCH_FLAG} /MANIFEST:NO")
# add /debug and /INCREMENTAL:YES to DEBUG and RELWITHDEBINFO also add pdbtype
# on versions that support it
commit 282eceb38b70a9b4979a7829c28499c3282cacd8
Author: Amine Khaldi <amine.khaldi@reactos.org>
Date: Sat Dec 21 13:53:05 2013 +0000
[CMAKE]
* Support only debug and release configuration types (in the VS solutions).
svn path=/trunk/; revision=61317
diff --git a/reactos/cmake/Platform/Windows-MSVC.cmake b/reactos/cmake/Platform/Windows-MSVC.cmake
index 94ed324c9b1..0d957237a60 100644
--- a/reactos/cmake/Platform/Windows-MSVC.cmake
+++ b/reactos/cmake/Platform/Windows-MSVC.cmake
@@ -51,7 +51,7 @@ if(CMAKE_GENERATOR MATCHES "Visual Studio 6")
endif()
if(NOT CMAKE_NO_BUILD_TYPE AND CMAKE_GENERATOR MATCHES "Visual Studio")
set (CMAKE_NO_BUILD_TYPE 1)
- set (CMAKE_CONFIGURATION_TYPES "Debug;Release;MinSizeRel;RelWithDebInfo" CACHE STRING
+ set (CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING
"Semicolon separated list of supported configuration types, only supports Debug, Release, MinSizeRel, and RelWithDebInfo, anything else will be ignored.")
mark_as_advanced(CMAKE_CONFIGURATION_TYPES)
endif()
commit 5265acf156f26153d3edf994062cdcb2fcad9c44
Author: Amine Khaldi <amine.khaldi@reactos.org>
Date: Mon Sep 23 17:29:13 2013 +0000
[CMAKE/MSVC]
* Drop /link from executable link lines.
svn path=/trunk/; revision=60343
diff --git a/reactos/cmake/Platform/Windows-MSVC.cmake b/reactos/cmake/Platform/Windows-MSVC.cmake
index cf117c66c44..94ed324c9b1 100644
--- a/reactos/cmake/Platform/Windows-MSVC.cmake
+++ b/reactos/cmake/Platform/Windows-MSVC.cmake
@@ -227,7 +227,6 @@ macro(__windows_compiler_msvc lang)
set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE
"<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <FLAGS> <DEFINES> /FoNUL /FAs /Fa<ASSEMBLY_SOURCE> /c <SOURCE>${CMAKE_END_TEMP_FILE}")
- set(CMAKE_${lang}_COMPILER_LINKER_OPTION_FLAG_EXECUTABLE "/link")
set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 1)
set(CMAKE_${lang}_LINK_EXECUTABLE
"${_CMAKE_VS_LINK_EXE}<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
commit 66773cd55c2fea1a8916a4d251d3bf6bc0293e8a
Author: Amine Khaldi <amine.khaldi@reactos.org>
Date: Sat Apr 27 13:53:29 2013 +0000
[CMAKE]
* Don't set a default list of linked libraries, let us decide that ourselves. Fixes the recent VS build issues.
svn path=/trunk/; revision=58871
diff --git a/reactos/cmake/Platform/Windows-MSVC.cmake b/reactos/cmake/Platform/Windows-MSVC.cmake
index 7bb59fb6985..cf117c66c44 100644
--- a/reactos/cmake/Platform/Windows-MSVC.cmake
+++ b/reactos/cmake/Platform/Windows-MSVC.cmake
@@ -148,11 +148,11 @@ else()
if(MSVC_VERSION GREATER 1310)
set(_RTC1 "/RTC1")
set(_FLAGS_CXX " /GR /EHsc")
- set(CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib")
+ set(CMAKE_C_STANDARD_LIBRARIES_INIT "")
else()
set(_RTC1 "/GZ")
set(_FLAGS_CXX " /GR /GX")
- set(CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib")
+ set(CMAKE_C_STANDARD_LIBRARIES_INIT "")
endif()
endif()
commit 30d5c755b71ab93cb4e1837afaa3a579420f17ed
Author: Amine Khaldi <amine.khaldi@reactos.org>
Date: Sat Apr 13 10:37:24 2013 +0000
[CMAKE]
* Invoke the linker directly instead of through the compiler in MSVC builds.
svn path=/trunk/; revision=58735
diff --git a/reactos/cmake/Platform/Windows-MSVC.cmake b/reactos/cmake/Platform/Windows-MSVC.cmake
index 002ce9e4a9f..7bb59fb6985 100644
--- a/reactos/cmake/Platform/Windows-MSVC.cmake
+++ b/reactos/cmake/Platform/Windows-MSVC.cmake
@@ -229,7 +229,8 @@ macro(__windows_compiler_msvc lang)
set(CMAKE_${lang}_COMPILER_LINKER_OPTION_FLAG_EXECUTABLE "/link")
set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 1)
- set(CMAKE_${lang}_LINK_EXECUTABLE "${_CMAKE_VS_LINK_EXE}<CMAKE_${lang}_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> /Fe<TARGET> <OBJECTS> /link /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
+ set(CMAKE_${lang}_LINK_EXECUTABLE
+ "${_CMAKE_VS_LINK_EXE}<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
set(CMAKE_${lang}_FLAGS_INIT "")
set(CMAKE_${lang}_FLAGS_DEBUG_INIT "")
commit ba43b2590a605ccf66bd43a9dda052903aec9b3f
Author: Amine Khaldi <amine.khaldi@reactos.org>
Date: Sat Apr 6 10:09:01 2013 +0000
[CMAKE]
* Don't set the compiler and linker PDB to the same file (it's the linker's PDB that matters).
* No code changes, 12% faster msvc build.
svn path=/trunk/; revision=58685
diff --git a/reactos/cmake/Platform/Windows-MSVC.cmake b/reactos/cmake/Platform/Windows-MSVC.cmake
index 73f9eb90c3d..002ce9e4a9f 100644
--- a/reactos/cmake/Platform/Windows-MSVC.cmake
+++ b/reactos/cmake/Platform/Windows-MSVC.cmake
@@ -221,7 +221,7 @@ macro(__windows_compiler_msvc lang)
set(CMAKE_${lang}_CREATE_STATIC_LIBRARY "<CMAKE_LINKER> /lib ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ")
set(CMAKE_${lang}_COMPILE_OBJECT
- "<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <FLAGS> <DEFINES> /Fo<OBJECT> /Fd<TARGET_PDB> -c <SOURCE>${CMAKE_END_TEMP_FILE}")
+ "<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <FLAGS> <DEFINES> /Fo<OBJECT> /Fd<OBJECT_DIR>/ -c <SOURCE>${CMAKE_END_TEMP_FILE}")
set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE
"<CMAKE_${lang}_COMPILER> > <PREPROCESSED_SOURCE> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <FLAGS> <DEFINES> -E <SOURCE>${CMAKE_END_TEMP_FILE}")
set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE
@@ -229,7 +229,7 @@ macro(__windows_compiler_msvc lang)
set(CMAKE_${lang}_COMPILER_LINKER_OPTION_FLAG_EXECUTABLE "/link")
set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 1)
- set(CMAKE_${lang}_LINK_EXECUTABLE "<CMAKE_${lang}_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> /Fe<TARGET> /Fd<TARGET_PDB> <OBJECTS> /link /implib:<TARGET_IMPLIB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
+ set(CMAKE_${lang}_LINK_EXECUTABLE "${_CMAKE_VS_LINK_EXE}<CMAKE_${lang}_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> /Fe<TARGET> <OBJECTS> /link /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
set(CMAKE_${lang}_FLAGS_INIT "")
set(CMAKE_${lang}_FLAGS_DEBUG_INIT "")
commit ef56c781ba7a68230ade086bd440bc6eb539e589
Author: Amine Khaldi <amine.khaldi@reactos.org>
Date: Mon Dec 24 11:21:54 2012 +0000
[CMAKE]
* Add basic support for the new MSVC build handling that comes with the upcoming RosBE 2.1.
* This needs to be inspected further to make sure it matches our current setup.
svn path=/trunk/; revision=57990
diff --git a/reactos/cmake/Platform/Windows-MSVC.cmake b/reactos/cmake/Platform/Windows-MSVC.cmake
new file mode 100644
index 00000000000..73f9eb90c3d
--- /dev/null
+++ b/reactos/cmake/Platform/Windows-MSVC.cmake
@@ -0,0 +1,239 @@
+
+#=============================================================================
+# Copyright 2001-2012 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 distribute 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(__WINDOWS_MSVC)
+ return()
+endif()
+set(__WINDOWS_MSVC 1)
+
+set(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:")
+set(CMAKE_LINK_LIBRARY_FLAG "")
+set(MSVC 1)
+
+# hack: if a new cmake (which uses CMAKE__LINKER) runs on an old build tree
+# (where link was hardcoded) and where CMAKE_LINKER isn't in the cache
+# and still cmake didn't fail in CMakeFindBinUtils.cmake (because it isn't rerun)
+# hardcode CMAKE_LINKER here to link, so it behaves as it did before, Alex
+if(NOT DEFINED CMAKE_LINKER)
+ set(CMAKE_LINKER link)
+endif()
+
+if(CMAKE_VERBOSE_MAKEFILE)
+ set(CMAKE_CL_NOLOGO)
+else()
+ set(CMAKE_CL_NOLOGO "/nologo")
+endif()
+
+set(WIN32 1)
+
+if(CMAKE_SYSTEM_NAME MATCHES "WindowsCE")
+ set(CMAKE_CREATE_WIN32_EXE "/subsystem:windowsce /entry:WinMainCRTStartup")
+ set(CMAKE_CREATE_CONSOLE_EXE "/subsystem:windowsce /entry:mainACRTStartup")
+else()
+ set(CMAKE_CREATE_WIN32_EXE "/subsystem:windows")
+ set(CMAKE_CREATE_CONSOLE_EXE "/subsystem:console")
+endif()
+
+if(CMAKE_GENERATOR MATCHES "Visual Studio 6")
+ set (CMAKE_NO_BUILD_TYPE 1)
+endif()
+if(NOT CMAKE_NO_BUILD_TYPE AND CMAKE_GENERATOR MATCHES "Visual Studio")
+ set (CMAKE_NO_BUILD_TYPE 1)
+ set (CMAKE_CONFIGURATION_TYPES "Debug;Release;MinSizeRel;RelWithDebInfo" CACHE STRING
+ "Semicolon separated list of supported configuration types, only supports Debug, Release, MinSizeRel, and RelWithDebInfo, anything else will be ignored.")
+ mark_as_advanced(CMAKE_CONFIGURATION_TYPES)
+endif()
+
+# make sure to enable languages after setting configuration types
+enable_language(RC)
+set(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
+
+if("${CMAKE_GENERATOR}" MATCHES "Visual Studio")
+ set(MSVC_IDE 1)
+else()
+ set(MSVC_IDE 0)
+endif()
+
+if(NOT MSVC_VERSION)
+ if(CMAKE_C_COMPILER_VERSION)
+ set(_compiler_version ${CMAKE_C_COMPILER_VERSION})
+ else()
+ set(_compiler_version ${CMAKE_CXX_COMPILER_VERSION})
+ endif()
+ if("${_compiler_version}" MATCHES "^([0-9]+)\\.([0-9]+)")
+ math(EXPR MSVC_VERSION "${CMAKE_MATCH_1}*100 + ${CMAKE_MATCH_2}")
+ else()
+ message(FATAL_ERROR "MSVC compiler version not detected properly: ${_compiler_version}")
+ endif()
+
+ set(MSVC10)
+ set(MSVC11)
+ set(MSVC60)
+ set(MSVC70)
+ set(MSVC71)
+ set(MSVC80)
+ set(MSVC90)
+ set(CMAKE_COMPILER_2005)
+ set(CMAKE_COMPILER_SUPPORTS_PDBTYPE)
+ if(NOT "${_compiler_version}" VERSION_LESS 17)
+ set(MSVC11 1)
+ elseif(NOT "${_compiler_version}" VERSION_LESS 16)
+ set(MSVC10 1)
+ elseif(NOT "${_compiler_version}" VERSION_LESS 15)
+ set(MSVC90 1)
+ elseif(NOT "${_compiler_version}" VERSION_LESS 14)
+ set(MSVC80 1)
+ set(CMAKE_COMPILER_2005 1)
+ elseif(NOT "${_compiler_version}" VERSION_LESS 13.10)
+ set(MSVC71 1)
+ elseif(NOT "${_compiler_version}" VERSION_LESS 13)
+ set(MSVC70 1)
+ else()
+ set(MSVC60 1)
+ set(CMAKE_COMPILER_SUPPORTS_PDBTYPE 1)
+ endif()
+endif()
+
+if(MSVC_C_ARCHITECTURE_ID MATCHES 64)
+ set(CMAKE_CL_64 1)
+else()
+ set(CMAKE_CL_64 0)
+endif()
+if(CMAKE_FORCE_WIN64 OR CMAKE_FORCE_IA64)
+ set(CMAKE_CL_64 1)
+endif()
+
+if("${MSVC_VERSION}" GREATER 1599)
+ set(MSVC_INCREMENTAL_DEFAULT ON)
+endif()
+
+# default to Debug builds
+set(CMAKE_BUILD_TYPE_INIT Debug)
+
+if(CMAKE_SYSTEM_NAME MATCHES "WindowsCE")
+ string(TOUPPER "${MSVC_C_ARCHITECTURE_ID}" _MSVC_C_ARCHITECTURE_ID_UPPER)
+ string(TOUPPER "${MSVC_CXX_ARCHITECTURE_ID}" _MSVC_CXX_ARCHITECTURE_ID_UPPER)
+
+ if("${CMAKE_SYSTEM_VERSION}" MATCHES "^([0-9]+)\\.([0-9]+)")
+ math(EXPR _CE_VERSION "${CMAKE_MATCH_1}*100 + ${CMAKE_MATCH_2}")
+ elseif("${CMAKE_SYSTEM_VERSION}" STREQUAL "")
+ set(_CE_VERSION "500")
+ else()
+ message(FATAL_ERROR "Invalid Windows CE version: ${CMAKE_SYSTEM_VERSION}")
+ endif()
+
+ set(_PLATFORM_DEFINES "/D_WIN32_WCE=0x${_CE_VERSION} /DUNDER_CE")
+ set(_PLATFORM_DEFINES_C " /D${MSVC_C_ARCHITECTURE_ID} /D_${_MSVC_C_ARCHITECTURE_ID_UPPER}_")
+ set(_PLATFORM_DEFINES_CXX " /D${MSVC_CXX_ARCHITECTURE_ID} /D_${_MSVC_CXX_ARCHITECTURE_ID_UPPER}_")
+
+ set(_RTC1 "")
+ set(_FLAGS_CXX " /GR /EHsc")
+ set(CMAKE_C_STANDARD_LIBRARIES_INIT "coredll.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib")
+ set(CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /NODEFAULTLIB:libc.lib /NODEFAULTLIB:oldnames.lib")
+else()
+ set(_PLATFORM_DEFINES "/DWIN32")
+
+ if(MSVC_VERSION GREATER 1310)
+ set(_RTC1 "/RTC1")
+ set(_FLAGS_CXX " /GR /EHsc")
+ set(CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib")
+ else()
+ set(_RTC1 "/GZ")
+ set(_FLAGS_CXX " /GR /GX")
+ set(CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib")
+ endif()
+endif()
+
+set(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}")
+
+# executable linker flags
+set (CMAKE_LINK_DEF_FILE_FLAG "/DEF:")
+# set the stack size and the machine type
+set(_MACHINE_ARCH_FLAG ${MSVC_C_ARCHITECTURE_ID})
+if(NOT _MACHINE_ARCH_FLAG)
+ set(_MACHINE_ARCH_FLAG ${MSVC_CXX_ARCHITECTURE_ID})
+endif()
+if(CMAKE_SYSTEM_NAME MATCHES "WindowsCE")
+ if(_MACHINE_ARCH_FLAG MATCHES "ARM")
+ set(_MACHINE_ARCH_FLAG "THUMB")
+ elseif(_MACHINE_ARCH_FLAG MATCHES "SH")
+ set(_MACHINE_ARCH_FLAG "SH4")
+ endif()
+endif()
+set (CMAKE_EXE_LINKER_FLAGS_INIT
+ "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:10000000 /machine:${_MACHINE_ARCH_FLAG}")
+
+# add /debug and /INCREMENTAL:YES to DEBUG and RELWITHDEBINFO also add pdbtype
+# on versions that support it
+set( MSVC_INCREMENTAL_YES_FLAG "")
+if(NOT MSVC_INCREMENTAL_DEFAULT)
+ set( MSVC_INCREMENTAL_YES_FLAG "/INCREMENTAL:YES")
+else()
+ set( MSVC_INCREMENTAL_YES_FLAG "/INCREMENTAL" )
+endif()
+
+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 ${MSVC_INCREMENTAL_YES_FLAG}")
+else ()
+ set (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug")
+ set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug ${MSVC_INCREMENTAL_YES_FLAG}")
+endif ()
+# for release and minsize release default to no incremental linking
+set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT "/INCREMENTAL:NO")
+set(CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT "/INCREMENTAL:NO")
+
+# copy the EXE_LINKER flags to SHARED and MODULE linker flags
+# shared linker flags
+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})
+set (CMAKE_SHARED_LINKER_FLAGS_RELEASE_INIT ${CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT})
+set (CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL_INIT ${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT})
+# module linker flags
+set (CMAKE_MODULE_LINKER_FLAGS_INIT ${CMAKE_SHARED_LINKER_FLAGS_INIT})
+set (CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT})
+set (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT})
+set (CMAKE_MODULE_LINKER_FLAGS_RELEASE_INIT ${CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT})
+set (CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL_INIT ${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT})
+
+macro(__windows_compiler_msvc lang)
+ if(NOT "${CMAKE_${lang}_COMPILER_VERSION}" VERSION_LESS 14)
+ # for 2005 make sure the manifest is put in the dll with mt
+ set(_CMAKE_VS_LINK_DLL "<CMAKE_COMMAND> -E vs_link_dll ")
+ set(_CMAKE_VS_LINK_EXE "<CMAKE_COMMAND> -E vs_link_exe ")
+ endif()
+ set(CMAKE_${lang}_CREATE_SHARED_LIBRARY "<CMAKE_LINKER> ${CMAKE_CL_NOLOGO} <OBJECTS> ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /dll /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <LINK_FLAGS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
+
+ set(CMAKE_${lang}_CREATE_SHARED_MODULE ${CMAKE_${lang}_CREATE_SHARED_LIBRARY})
+ set(CMAKE_${lang}_CREATE_STATIC_LIBRARY "<CMAKE_LINKER> /lib ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ")
+
+ set(CMAKE_${lang}_COMPILE_OBJECT
+ "<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <FLAGS> <DEFINES> /Fo<OBJECT> /Fd<TARGET_PDB> -c <SOURCE>${CMAKE_END_TEMP_FILE}")
+ set(CMAKE_${lang}_CREATE_PREPROCESSED_SOURCE
+ "<CMAKE_${lang}_COMPILER> > <PREPROCESSED_SOURCE> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <FLAGS> <DEFINES> -E <SOURCE>${CMAKE_END_TEMP_FILE}")
+ set(CMAKE_${lang}_CREATE_ASSEMBLY_SOURCE
+ "<CMAKE_${lang}_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO}${_COMPILE_${lang}} <FLAGS> <DEFINES> /FoNUL /FAs /Fa<ASSEMBLY_SOURCE> /c <SOURCE>${CMAKE_END_TEMP_FILE}")
+
+ set(CMAKE_${lang}_COMPILER_LINKER_OPTION_FLAG_EXECUTABLE "/link")
+ set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 1)
+ set(CMAKE_${lang}_LINK_EXECUTABLE "<CMAKE_${lang}_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> /Fe<TARGET> /Fd<TARGET_PDB> <OBJECTS> /link /implib:<TARGET_IMPLIB> /version:<TARGET_VERSION_MAJOR>.<TARGET_VERSION_MINOR> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
+
+ set(CMAKE_${lang}_FLAGS_INIT "")
+ set(CMAKE_${lang}_FLAGS_DEBUG_INIT "")
+ set(CMAKE_${lang}_FLAGS_RELEASE_INIT "/MD /O2 /Ob2 /D NDEBUG")
+ set(CMAKE_${lang}_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG")
+ set(CMAKE_${lang}_FLAGS_MINSIZEREL_INIT "/MD /O1 /Ob1 /D NDEBUG")
+endmacro()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.