mirror of
				https://github.com/Z3Prover/z3
				synced 2025-11-04 13:29:11 +00:00 
			
		
		
		
	fix git_utils.cmake (#4954)
The code should refrain from using global parameters such as CMAKE_SOURCE_DIR/CMAKE_BINARY_DIR, especially here which is handling the case of Z3 being a submodule. Instead, use project specific variables like Z3_SOURCE_DIR so that people can incorporate z3 build as part of their build-system.
This commit is contained in:
		
							parent
							
								
									fa4869e400
								
							
						
					
					
						commit
						9dcf44b767
					
				
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
					@ -38,8 +38,8 @@ function(add_git_dir_dependency GIT_DOT_FILE SUCCESS_VAR)
 | 
				
			||||||
        get_filename_component(GIT_WORKTREE_PARENT "${GIT_WORKTREE_PARENT}" NAME)
 | 
					        get_filename_component(GIT_WORKTREE_PARENT "${GIT_WORKTREE_PARENT}" NAME)
 | 
				
			||||||
        if ("${GIT_WORKTREE_PARENT}" STREQUAL "modules")
 | 
					        if ("${GIT_WORKTREE_PARENT}" STREQUAL "modules")
 | 
				
			||||||
          # Z3 is a git submodule
 | 
					          # Z3 is a git submodule
 | 
				
			||||||
          set(GIT_HEAD_FILE "${CMAKE_SOURCE_DIR}/${GIT_HEAD_FILE}")
 | 
					          set(GIT_HEAD_FILE "${Z3_SOURCE_DIR}/${GIT_HEAD_FILE}")
 | 
				
			||||||
          set(GIT_DIR "${CMAKE_SOURCE_DIR}/${GIT_WORKTREE_DIR}")
 | 
					          set(GIT_DIR "${Z3_SOURCE_DIR}/${GIT_WORKTREE_DIR}")
 | 
				
			||||||
        else()
 | 
					        else()
 | 
				
			||||||
          message(FATAL_ERROR "Found git worktree dir but could not find \"${GIT_COMMON_DIR_FILE}\"")
 | 
					          message(FATAL_ERROR "Found git worktree dir but could not find \"${GIT_COMMON_DIR_FILE}\"")
 | 
				
			||||||
        endif()
 | 
					        endif()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue