mirror of
https://github.com/rdkit/rdkit.git
synced 2026-06-03 21:44:30 +08:00
Build: forward-slash Python3_EXECUTABLE when generating rdkit-stubs (#9318)
The rdkit-stubs CMakeLists builds a cmake script (RUN_GEN_RDKIT_STUBS_PY) that is later run via cmake -P. Every path embedded in that generated script is converted to forward slashes first (CMAKE_SOURCE_DIR, CMAKE_CURRENT_BINARY_DIR, PYTHON_INSTDIR) so the backslashes in native Windows paths don't get treated as escape sequences when the script is re-parsed. Python3_EXECUTABLE was the one path that wasn't converted, so on Windows the generated COMMAND line contained backslashes and failed to parse. Apply the same forward-slash conversion to it for consistency. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -14,13 +14,14 @@ set(CONCURRENCY "")
|
|||||||
if (DEFINED ENV{CMAKE_BUILD_PARALLEL_LEVEL})
|
if (DEFINED ENV{CMAKE_BUILD_PARALLEL_LEVEL})
|
||||||
set(CONCURRENCY "--concurrency $ENV{CMAKE_BUILD_PARALLEL_LEVEL} ")
|
set(CONCURRENCY "--concurrency $ENV{CMAKE_BUILD_PARALLEL_LEVEL} ")
|
||||||
endif()
|
endif()
|
||||||
|
string(REGEX REPLACE "\\\\" "/" Python3_EXECUTABLE_FWDSLASH ${Python3_EXECUTABLE})
|
||||||
string(CONCAT RUN_GEN_RDKIT_STUBS_PY "message("
|
string(CONCAT RUN_GEN_RDKIT_STUBS_PY "message("
|
||||||
"\"-- Building and Installing rdkit-stubs into the following director${DIR_OR_DIRS}: ${STUB_LOCATIONS}\")\n"
|
"\"-- Building and Installing rdkit-stubs into the following director${DIR_OR_DIRS}: ${STUB_LOCATIONS}\")\n"
|
||||||
"set (SEPARATOR \"=====================================================================\n\")\n"
|
"set (SEPARATOR \"=====================================================================\n\")\n"
|
||||||
"set (COMMON_FILENAME ${CMAKE_CURRENT_BINARY_DIR_FWDSLASH}/gen_rdkit_stubs)\n"
|
"set (COMMON_FILENAME ${CMAKE_CURRENT_BINARY_DIR_FWDSLASH}/gen_rdkit_stubs)\n"
|
||||||
"execute_process("
|
"execute_process("
|
||||||
"COMMAND "
|
"COMMAND "
|
||||||
"${Python3_EXECUTABLE} -m Scripts.gen_rdkit_stubs ${CONCURRENCY}"
|
"${Python3_EXECUTABLE_FWDSLASH} -m Scripts.gen_rdkit_stubs ${CONCURRENCY}"
|
||||||
"${CMAKE_SOURCE_DIR_FWDSLASH_QUOTED}${PYTHON_INSTDIR_FWDSLASH_QUOTED}"
|
"${CMAKE_SOURCE_DIR_FWDSLASH_QUOTED}${PYTHON_INSTDIR_FWDSLASH_QUOTED}"
|
||||||
"WORKING_DIRECTORY \"${CMAKE_SOURCE_DIR_FWDSLASH}\" "
|
"WORKING_DIRECTORY \"${CMAKE_SOURCE_DIR_FWDSLASH}\" "
|
||||||
"OUTPUT_FILE \"\${COMMON_FILENAME}.out\" "
|
"OUTPUT_FILE \"\${COMMON_FILENAME}.out\" "
|
||||||
|
|||||||
Reference in New Issue
Block a user