[FREELDR] Fix VSSolution configuring and build
authorOleksandr Shaposhnikov <sanchaez@reactos.org>
Mon, 4 Feb 2019 02:53:09 +0000 (04:53 +0200)
committerHermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
Sat, 9 Feb 2019 23:25:04 +0000 (00:25 +0100)
"configure.cmd VSSolution" was failing due to add_asm_files macro
 expansion. It was using the same 'freeldr_linker_file' variable name
 as a temporary filename base twice. This patch uses '_target'
 parameter to make those variable names differ.

boot/freeldr/freeldr/CMakeLists.txt

index 5d0bba0..6fb5960 100644 (file)
@@ -34,7 +34,7 @@ function(add_linker_script _target _linker_script_file)
         COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${_file_full_path}" "${_generated_file}"
         DEPENDS ${_file_full_path})
     set_source_files_properties(${_generated_file} PROPERTIES LANGUAGE "ASM" GENERATED TRUE)
         COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${_file_full_path}" "${_generated_file}"
         DEPENDS ${_file_full_path})
     set_source_files_properties(${_generated_file} PROPERTIES LANGUAGE "ASM" GENERATED TRUE)
-    add_asm_files(freeldr_linker_file ${_generated_file})
+    add_asm_files(${_target}_freeldr_linker_file ${_generated_file})
 
     # Generate the C module containing extra sections specifications and layout,
     # as well as comment-type linker #pragma directives.
 
     # Generate the C module containing extra sections specifications and layout,
     # as well as comment-type linker #pragma directives.
@@ -44,10 +44,10 @@ function(add_linker_script _target _linker_script_file)
         COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${_file_full_path}" "${_generated_file}"
         DEPENDS ${_file_full_path})
     set_source_files_properties(${_generated_file} PROPERTIES LANGUAGE "C" GENERATED TRUE)
         COMMAND "${CMAKE_COMMAND}" -E copy_if_different "${_file_full_path}" "${_generated_file}"
         DEPENDS ${_file_full_path})
     set_source_files_properties(${_generated_file} PROPERTIES LANGUAGE "C" GENERATED TRUE)
-    list(APPEND freeldr_linker_file ${_generated_file})
+    list(APPEND ${_target}_freeldr_linker_file ${_generated_file})
 
     # Add both files to the sources of the target.
 
     # Add both files to the sources of the target.
-    target_sources(${_target} PRIVATE ${freeldr_linker_file})
+    target_sources(${_target} PRIVATE "${${_target}_freeldr_linker_file}")
 
     # Create the additional linker response file.
     set(_generated_file "${_generated_file_path_prefix}.rsp")
 
     # Create the additional linker response file.
     set(_generated_file "${_generated_file_path_prefix}.rsp")