@@ -501,6 +501,8 @@ def cmake_workflow(self, src_dir, build_type, build_dir, install_dir, extra_args
501
501
config_args .extend (["-DCMAKE_C_COMPILER=" + self .options .cc ,
502
502
"-DCMAKE_CXX_COMPILER=" + self .options .cxx ])
503
503
504
+ if self .is_windows ():
505
+ config_args .extend (["-DPYTHON_EXECUTABLE=" + sys .executable ])
504
506
# "OptimizedDebug" is not a valid build type. We interpret it as a special case
505
507
# where the build type is Debug and optimizations are enabled.
506
508
# This is equivalent to RelWithDebInfo on Unix, but ensures
@@ -1151,6 +1153,7 @@ def create_cmake_presets(self):
1151
1153
if cxx_flags :
1152
1154
new_preset ["cacheVariables" ]['CMAKE_CXX_FLAGS' ] = cxx_flags .strip ()
1153
1155
1156
+ new_preset ["cacheVariables" ]["PYTHON_EXECUTABLE" ] = sys .executable
1154
1157
1155
1158
# Update cache variables path prefixes with their relative equivalents
1156
1159
mrdocs_src_dir_parent = os .path .dirname (self .options .mrdocs_src_dir )
@@ -1398,8 +1401,9 @@ def generate_clion_run_configs(self, configs):
1398
1401
if 'folder' in config :
1399
1402
attrib ["folderName" ] = config ["folder" ]
1400
1403
clion_config = ET .SubElement (root , "configuration" , attrib )
1404
+ args = config .get ("args" ) or []
1401
1405
ET .SubElement (clion_config , "option" , name = "SCRIPT_TEXT" ,
1402
- value = f"{ shlex .quote (config ['script' ])} { ' ' .join (shlex .quote (arg ) for arg in config [ ' args' ] )} " )
1406
+ value = f"{ shlex .quote (config ['script' ])} { ' ' .join (shlex .quote (arg ) for arg in args )} " )
1403
1407
ET .SubElement (clion_config , "option" , name = "INDEPENDENT_SCRIPT_PATH" , value = "true" )
1404
1408
ET .SubElement (clion_config , "option" , name = "SCRIPT_PATH" , value = config ["script" ])
1405
1409
ET .SubElement (clion_config , "option" , name = "SCRIPT_OPTIONS" , value = "" )
0 commit comments