Skip to content

Commit

Permalink
Change scheme file compile command invocation
Browse files Browse the repository at this point in the history
This
* adds normal double quotes around the guild function call
* removes escaped quotes from paths
* add 'VERBATIM' keyword to let cmake perform its own escape logic on the commands

Verified to work on Windows and linux with both ninja and make.
  • Loading branch information
gjanssens committed Sep 12, 2019
1 parent 84dede1 commit 82b3af9
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions common/cmake_modules/GncAddSchemeTargets.cmake
Expand Up @@ -119,7 +119,7 @@ function(gnc_add_scheme_targets _TARGET _SOURCE_FILES _OUTPUT_DIR _GUILE_DEPENDS
if (MINGW64)
set(fpath "")
file(TO_CMAKE_PATH "$ENV{PATH}" fpath)
set(LIBRARY_PATH "PATH=\"${BINDIR_BUILD};${fpath}\"")
set(LIBRARY_PATH "PATH=${BINDIR_BUILD};${fpath}")
else (MINGW64)
set (LIBRARY_PATH "LD_LIBRARY_PATH=${LIBDIR_BUILD}:${LIBDIR_BUILD}/gnucash")
endif (MINGW64)
Expand Down Expand Up @@ -150,13 +150,14 @@ function(gnc_add_scheme_targets _TARGET _SOURCE_FILES _OUTPUT_DIR _GUILE_DEPENDS
COMMAND ${CMAKE_COMMAND} -E env
"${LIBRARY_PATH}"
"GNC_UNINSTALLED=YES"
"GNC_BUILDDIR=\"${CMAKE_BINARY_DIR}\""
"GUILE_LOAD_PATH=\"${_GUILE_LOAD_PATH}\""
"GUILE_LOAD_COMPILED_PATH=\"${_GUILE_LOAD_COMPILED_PATH}\""
"GNC_MODULE_PATH=\"${_GNC_MODULE_PATH}\""
${GUILE_EXECUTABLE} -e '\(@@ \(guild\) main\)' -s ${GUILD_EXECUTABLE} compile -o ${output_file} ${source_file_abs_path}
"GNC_BUILDDIR=${CMAKE_BINARY_DIR}"
"GUILE_LOAD_PATH=${_GUILE_LOAD_PATH}"
"GUILE_LOAD_COMPILED_PATH=${_GUILE_LOAD_COMPILED_PATH}"
"GNC_MODULE_PATH=${_GNC_MODULE_PATH}"
${GUILE_EXECUTABLE} -e "\(@@ \(guild\) main\)" -s ${GUILD_EXECUTABLE} compile -o ${output_file} ${source_file_abs_path}
DEPENDS ${guile_depends}
MAIN_DEPENDENCY ${source_file_abs_path}
VERBATIM
)
endforeach(source_file)
if (__DEBUG)
Expand Down

0 comments on commit 82b3af9

Please sign in to comment.