4 changed files with 13 additions and 109 deletions
			
			
		@ -1,30 +1,19 @@ | 
				
			|||
From 4645f74eb668cc1cf876d1e9bef933591da7575c Mon Sep 17 00:00:00 2001 | 
				
			|||
From: Adam Duskett <aduskett@gmail.com> | 
				
			|||
Date: Mon, 3 Feb 2020 06:21:57 -0800 | 
				
			|||
Subject: [PATCH] set minimum cmake version | 
				
			|||
 | 
				
			|||
The CMakeLists.txt file uses the CMP0091 which is an MSVC runtime library flag | 
				
			|||
abstraction macro. | 
				
			|||
 | 
				
			|||
Because we are not building ninja for Microsoft, it is safe to remove this | 
				
			|||
macro and set the minimum version to 3.10. | 
				
			|||
 | 
				
			|||
Signed-off-by: Adam Duskett <aduskett@gmail.com> | 
				
			|||
---
 | 
				
			|||
 CMakeLists.txt | 3 +-- | 
				
			|||
 1 file changed, 1 insertion(+), 2 deletions(-) | 
				
			|||
 | 
				
			|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
 | 
				
			|||
index 60fd8a1..a040e0b 100644
 | 
				
			|||
index 7f03c35..2be3cbc 100644
 | 
				
			|||
--- a/CMakeLists.txt
 | 
				
			|||
+++ b/CMakeLists.txt
 | 
				
			|||
@@ -1,5 +1,4 @@
 | 
				
			|||
@@ -1,4 +1,4 @@
 | 
				
			|||
-cmake_minimum_required(VERSION 3.15)
 | 
				
			|||
-cmake_policy(SET CMP0091 NEW)
 | 
				
			|||
+cmake_minimum_required(VERSION 3.7)
 | 
				
			|||
  | 
				
			|||
 include(CheckIncludeFileCXX) | 
				
			|||
 include(CheckIPOSupported) | 
				
			|||
@@ -6,7 +6,7 @@ include(CheckIPOSupported)
 | 
				
			|||
 project(ninja) | 
				
			|||
  | 
				
			|||
 if(CMAKE_BUILD_TYPE MATCHES "Release") | 
				
			|||
-- 
 | 
				
			|||
2.24.1 | 
				
			|||
 # --- optional link-time optimization | 
				
			|||
-check_ipo_supported(RESULT lto_supported OUTPUT error)
 | 
				
			|||
+#check_ipo_supported(RESULT lto_supported OUTPUT error)
 | 
				
			|||
  | 
				
			|||
 if(lto_supported) | 
				
			|||
 	message(STATUS "IPO / LTO enabled") | 
				
			|||
 | 
				
			|||
@ -1,29 +0,0 @@ | 
				
			|||
From 87caa8c4bc536f745aceed757ce8a492fbdba84f Mon Sep 17 00:00:00 2001 | 
				
			|||
From: Adam Duskett <aduskett@gmail.com> | 
				
			|||
Date: Mon, 3 Feb 2020 07:36:58 -0800 | 
				
			|||
Subject: [PATCH] remove fdiagnostics-color from make command | 
				
			|||
 | 
				
			|||
-fdiagnostics-color was introduced in gcc 4.9 and the minimum supported version
 | 
				
			|||
that Buildroot supports is 4.8. | 
				
			|||
 | 
				
			|||
Signed-off-by: Adam Duskett <aduskett@gmail.com> | 
				
			|||
---
 | 
				
			|||
 CMakeLists.txt | 2 +- | 
				
			|||
 1 file changed, 1 insertion(+), 1 deletion(-) | 
				
			|||
 | 
				
			|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
 | 
				
			|||
index a040e0b..af8010f 100644
 | 
				
			|||
--- a/CMakeLists.txt
 | 
				
			|||
+++ b/CMakeLists.txt
 | 
				
			|||
@@ -18,7 +18,7 @@ if(MSVC)
 | 
				
			|||
 	set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") | 
				
			|||
 	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /GR- /Zc:__cplusplus") | 
				
			|||
 else() | 
				
			|||
-	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -fdiagnostics-color")
 | 
				
			|||
+	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated")
 | 
				
			|||
 endif() | 
				
			|||
  | 
				
			|||
 find_program(RE2C re2c) | 
				
			|||
-- 
 | 
				
			|||
2.24.1 | 
				
			|||
 | 
				
			|||
@ -1,56 +0,0 @@ | 
				
			|||
From 7982ecebe1c1c41e82779a65fa2d93f19ffd755f Mon Sep 17 00:00:00 2001 | 
				
			|||
From: Yegor Yefremov <yegorslists@googlemail.com> | 
				
			|||
Date: Wed, 5 Feb 2020 12:28:44 +0100 | 
				
			|||
Subject: [PATCH] CMake: fix object library usage | 
				
			|||
 | 
				
			|||
Object libraries cannot be use in target_link_libraries() command | 
				
			|||
as they are no normal binary files like *.a or *.so but a collection | 
				
			|||
of object files. | 
				
			|||
 | 
				
			|||
See add_library() definition for details. | 
				
			|||
 | 
				
			|||
Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> | 
				
			|||
---
 | 
				
			|||
 CMakeLists.txt | 9 ++++----- | 
				
			|||
 1 file changed, 4 insertions(+), 5 deletions(-) | 
				
			|||
 | 
				
			|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
 | 
				
			|||
index af8010f..028a7bb 100644
 | 
				
			|||
--- a/CMakeLists.txt
 | 
				
			|||
+++ b/CMakeLists.txt
 | 
				
			|||
@@ -83,8 +83,7 @@ target_compile_definitions(libninja PRIVATE _WIN32_WINNT=0x0601 __USE_MINGW_ANSI
 | 
				
			|||
 endif() | 
				
			|||
 | 
				
			|||
 # Main executable is library plus main() function. | 
				
			|||
-add_executable(ninja src/ninja.cc)
 | 
				
			|||
-target_link_libraries(ninja PRIVATE libninja libninja-re2c)
 | 
				
			|||
+add_executable(ninja src/ninja.cc $<TARGET_OBJECTS:libninja> $<TARGET_OBJECTS:libninja-re2c>)
 | 
				
			|||
 | 
				
			|||
 # Tests all build into ninja_test executable. | 
				
			|||
 add_executable(ninja_test | 
				
			|||
@@ -106,11 +105,12 @@ add_executable(ninja_test
 | 
				
			|||
	src/subprocess_test.cc | 
				
			|||
	src/test.cc | 
				
			|||
	src/util_test.cc | 
				
			|||
+	$<TARGET_OBJECTS:libninja>
 | 
				
			|||
+	$<TARGET_OBJECTS:libninja-re2c>
 | 
				
			|||
 ) | 
				
			|||
 if(WIN32) | 
				
			|||
	target_sources(ninja_test PRIVATE src/includes_normalize_test.cc src/msvc_helper_test.cc) | 
				
			|||
 endif() | 
				
			|||
-target_link_libraries(ninja_test PRIVATE libninja libninja-re2c)
 | 
				
			|||
 | 
				
			|||
 foreach(perftest | 
				
			|||
   build_log_perftest | 
				
			|||
@@ -120,8 +120,7 @@ foreach(perftest
 | 
				
			|||
   hash_collision_bench | 
				
			|||
   manifest_parser_perftest | 
				
			|||
 ) | 
				
			|||
-  add_executable(${perftest} src/${perftest}.cc)
 | 
				
			|||
-  target_link_libraries(${perftest} PRIVATE libninja libninja-re2c)
 | 
				
			|||
+  add_executable(${perftest} src/${perftest}.cc $<TARGET_OBJECTS:libninja> $<TARGET_OBJECTS:libninja-re2c>)
 | 
				
			|||
 endforeach() | 
				
			|||
 | 
				
			|||
 enable_testing() | 
				
			|||
--
 | 
				
			|||
2.17.0 | 
				
			|||
					Loading…
					
					
				
		Reference in new issue