File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -415,8 +415,13 @@ function(ADD_PRECOMPILED_HEADER Target)
415415 try_c_cxx_flag(PCH "-pch" )
416416
417417 if (PCH)
418+ # CMAKE_CXX_COMPILER_ARG1 is used with compilers using subcommands.
419+ # For example when doing: cmake -D'CMAKE_CXX_COMPILER'='zig;c++'
420+ # CMAKE_CXX_COMPILER will be "zig",
421+ # CMAKE_CXX_COMPILER_ARG1 will be "c++".
418422 add_custom_command (OUTPUT "${OBJ_DIR} /${Target} .h.gch"
419- COMMAND ${PNACLPYTHON_PREFIX2} ${CMAKE_CXX_COMPILER} ${Defs} ${Flags} -x c++-header ${Header} -o "${OBJ_DIR} /${Target} .h.gch"
423+ COMMAND ${PNACLPYTHON_PREFIX2} ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_COMPILER_ARG1}
424+ ${Defs} ${Flags} -x c++-header ${Header} -o "${OBJ_DIR} /${Target} .h.gch"
420425 DEPENDS ${Header}
421426 IMPLICIT_DEPENDS CXX ${Header}
422427 )
You can’t perform that action at this time.
0 commit comments