mirror of
				https://github.com/Z3Prover/z3
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	cmake: fix windows build with long absolute directory names
This commit is contained in:
		
							parent
							
								
									deb2deb4ad
								
							
						
					
					
						commit
						70ada9919e
					
				
					 2 changed files with 14 additions and 9 deletions
				
			
		| 
						 | 
					@ -262,18 +262,20 @@ macro(z3_add_install_tactic_rule)
 | 
				
			||||||
      GLOBAL
 | 
					      GLOBAL
 | 
				
			||||||
      PROPERTY Z3_${dependency}_TACTIC_HEADERS
 | 
					      PROPERTY Z3_${dependency}_TACTIC_HEADERS
 | 
				
			||||||
    )
 | 
					    )
 | 
				
			||||||
    list(APPEND _tactic_header_files ${_component_tactic_header_files})
 | 
					    list(APPEND _tactic_header_files "${_component_tactic_header_files}")
 | 
				
			||||||
  endforeach()
 | 
					  endforeach()
 | 
				
			||||||
  unset(_component_tactic_header_files)
 | 
					  unset(_component_tactic_header_files)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  string(REPLACE ";" "\n" _tactic_header_files "${_tactic_header_files}")
 | 
				
			||||||
 | 
					  file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/install_tactic.deps" ${_tactic_header_files})
 | 
				
			||||||
  add_custom_command(OUTPUT "install_tactic.cpp"
 | 
					  add_custom_command(OUTPUT "install_tactic.cpp"
 | 
				
			||||||
    COMMAND "${PYTHON_EXECUTABLE}"
 | 
					    COMMAND "${PYTHON_EXECUTABLE}"
 | 
				
			||||||
    "${CMAKE_SOURCE_DIR}/scripts/mk_install_tactic_cpp.py"
 | 
					    "${CMAKE_SOURCE_DIR}/scripts/mk_install_tactic_cpp.py"
 | 
				
			||||||
    "${CMAKE_CURRENT_BINARY_DIR}"
 | 
					    "${CMAKE_CURRENT_BINARY_DIR}"
 | 
				
			||||||
    ${_tactic_header_files}
 | 
					    "${CMAKE_CURRENT_BINARY_DIR}/install_tactic.deps"
 | 
				
			||||||
    DEPENDS "${CMAKE_SOURCE_DIR}/scripts/mk_install_tactic_cpp.py"
 | 
					    DEPENDS "${CMAKE_SOURCE_DIR}/scripts/mk_install_tactic_cpp.py"
 | 
				
			||||||
            ${Z3_GENERATED_FILE_EXTRA_DEPENDENCIES}
 | 
					            ${Z3_GENERATED_FILE_EXTRA_DEPENDENCIES}
 | 
				
			||||||
            ${_tactic_header_files}
 | 
					            "${CMAKE_CURRENT_BINARY_DIR}/install_tactic.deps"
 | 
				
			||||||
    COMMENT "Generating \"${CMAKE_CURRENT_BINARY_DIR}/install_tactic.cpp\""
 | 
					    COMMENT "Generating \"${CMAKE_CURRENT_BINARY_DIR}/install_tactic.cpp\""
 | 
				
			||||||
    ${ADD_CUSTOM_COMMAND_USES_TERMINAL_ARG}
 | 
					    ${ADD_CUSTOM_COMMAND_USES_TERMINAL_ARG}
 | 
				
			||||||
    VERBATIM
 | 
					    VERBATIM
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -14,19 +14,22 @@ def main(args):
 | 
				
			||||||
    logging.basicConfig(level=logging.INFO)
 | 
					    logging.basicConfig(level=logging.INFO)
 | 
				
			||||||
    parser = argparse.ArgumentParser(description=__doc__)
 | 
					    parser = argparse.ArgumentParser(description=__doc__)
 | 
				
			||||||
    parser.add_argument("destination_dir", help="destination directory")
 | 
					    parser.add_argument("destination_dir", help="destination directory")
 | 
				
			||||||
    parser.add_argument("header_files", nargs="+",
 | 
					    parser.add_argument("deps", help="file with header file names to parse")
 | 
				
			||||||
                        help="One or more header files to parse")
 | 
					 | 
				
			||||||
    pargs = parser.parse_args(args)
 | 
					    pargs = parser.parse_args(args)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if not mk_genfile_common.check_dir_exists(pargs.destination_dir):
 | 
					    if not mk_genfile_common.check_dir_exists(pargs.destination_dir):
 | 
				
			||||||
        return 1
 | 
					        return 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if not mk_genfile_common.check_files_exist(pargs.header_files):
 | 
					    if not mk_genfile_common.check_files_exist([pargs.deps]):
 | 
				
			||||||
        return 1
 | 
					        return 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    h_files_full_path = []
 | 
					    with open(pargs.deps, 'r') as f:
 | 
				
			||||||
    for header_file in pargs.header_files:
 | 
					        lines = f.read().split('\n')
 | 
				
			||||||
        h_files_full_path.append(os.path.abspath(header_file))
 | 
					        h_files_full_path = [os.path.abspath(header_file)
 | 
				
			||||||
 | 
					                                for header_file in lines if header_file]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if not mk_genfile_common.check_files_exist(h_files_full_path):
 | 
				
			||||||
 | 
					        return 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    output = mk_genfile_common.mk_install_tactic_cpp_internal(
 | 
					    output = mk_genfile_common.mk_install_tactic_cpp_internal(
 | 
				
			||||||
        h_files_full_path,
 | 
					        h_files_full_path,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue