Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • CMake CMake
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 4,102
    • Issues 4,102
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 16
    • Merge requests 16
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • External wiki
    • External wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • CMakeCMake
  • CMakeCMake
  • Issues
  • #22405
Closed
Open
Issue created Jul 10, 2021 by Be Ing@Be

cmcldeps failure with Ninja generator and sccache

With ccache, a CMake project can simply add:

set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "ccache")

However ccache does not support MSVC. The only currently maintained compiler cache for MSVC is sccache. Using sccache, this fails if the project compiles an RC file with MSVC:

[715/841] Building RC object CMakeFiles\mixxx.dir\src\mixxx.rc.res
FAILED: CMakeFiles/mixxx.dir/src/mixxx.rc.res 
sccache "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin/cmcldeps.exe" RC D:\a\mixxx\mixxx\src\mixxx.rc CMakeFiles\mixxx.dir\src\mixxx.rc.res.d CMakeFiles\mixxx.dir\src\mixxx.rc.res "Note: including file: " "C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.28.29333/bin/Hostx64/x64/cl.exe" C:\PROGRA~2\WI3CF2~1\10\bin\x64\rc.exe -DAMD64 -DCHROMAPRINT_NODLL -DFLAC__NO_DLL -DMIXXX_BUILD_RELEASE -DMIXXX_DEBUG_ASSERTIONS_ENABLED -DMIXXX_DEBUG_ASSERTIONS_FATAL -DNDEBUG -DNOMINMAX -DQT_ACCESSIBILITY_SUPPORT_LIB -DQT_CONCURRENT_LIB -DQT_CORE_LIB -DQT_EVENTDISPATCHER_SUPPORT_LIB -DQT_FONTDATABASE_SUPPORT_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NODLL -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_SCRIPTTOOLS_LIB -DQT_SCRIPT_LIB -DQT_SQL_LIB -DQT_SVG_LIB -DQT_TABLET_SUPPORT -DQT_TESTCASE_BUILDDIR=\"D:/a/mixxx/mixxx/build\" -DQT_TESTLIB_LIB -DQT_THEME_SUPPORT_LIB -DQT_USE_QSTRINGBUILDER -DQT_WIDGETS_LIB -DQT_WINDOWSUIAUTOMATION_SUPPORT_LIB -DQT_XML_LIB -DSFC_SUPPORTS_SET_COMPRESSION_LEVEL -DTAGLIB_STATIC -DUNICODE -DWIN32 -DWINVER=0x0601 -D_ATL_MIN_CRT -D_CRT_SECURE_NO_WARNINGS -D_SILENCE_CXX17_ITERATOR_BASE_CLASS_DEPRECATION_WARNING -D_USE_MATH_DEFINES -D_WIN32_WINNT=0x0601 -D__BATTERY__ -D__BROADCAST__ -D__HID__ -D__HSS1394__ -D__MAD__ -D__MEDIAFOUNDATION__ -D__OPUS__ -D__QTKEYCHAIN__ -D__SNDFILE__ -D__SQLITE3__ -D__SSE2__ -D__SSE__ -D__VINYLCONTROL__ -I D:\a\mixxx\mixxx -I D:\a\mixxx\mixxx\src -I D:\a\mixxx\mixxx\build\src -I D:\a\mixxx\mixxx\lib\fidlib -I D:\a\mixxx\mixxx\lib\googletest-1.10.x\googletest\include -I C:\buildenv\2.3-j00019-x64-release-fastbuild-static-55e94982-minimal\include -I D:\a\mixxx\mixxx\lib\portaudio -I D:\a\mixxx\mixxx\lib\rigtorp\SPSCQueue\include -I D:\a\mixxx\mixxx\lib\qtscript-bytearray -I C:\buildenv\2.3-j00019-x64-release-fastbuild-static-55e94982-minimal\include\opus -I D:\a\mixxx\mixxx\lib\libebur128\ebur128 -I D:\a\mixxx\mixxx\lib\kaitai -I D:\a\mixxx\mixxx\lib\mp3guessenc-0.27.4 -I C:\buildenv\2.3-j00019-x64-release-fastbuild-static-55e94982-minimal\Qt-5.14.2\include -I C:\buildenv\2.3-j00019-x64-release-fastbuild-static-55e94982-minimal\Qt-5.14.2\include\QtConcurrent -I C:\buildenv\2.3-j00019-x64-release-fastbuild-static-55e94982-minimal\Qt-5.14.2\include\QtCore -I C:\buildenv\2.3-j00019-x64-release-fastbuild-static-55e94982-minimal\Qt-5.14.2\mkspecs\win32-msvc -I C:\buildenv\2.3-j00019-x64-release-fastbuild-static-55e94982-minimal\Qt-5.14.2\include\QtGui -I C:\buildenv\2.3-j00019-x64-release-fastbuild-static-55e94982-minimal\Qt-5.14.2\include\QtANGLE -I C:\buildenv\2.3-j00019-x64-release-fastbuild-static-55e94982-minimal\Qt-5.14.2\include\QtEventDispatcherSupport -I C:\buildenv\2.3-j00019-x64-release-fastbuild-static-55e94982-minimal\Qt-5.14.2\include\QtFontDatabaseSupport -I C:\buildenv\2.3-j00019-x64-release-fastbuild-static-55e94982-minimal\Qt-5.14.2\include\QtThemeSupport -I C:\buildenv\2.3-j00019-x64-release-fastbuild-static-55e94982-minimal\Qt-5.14.2\include\QtAccessibilitySupport -I C:\buildenv\2.3-j00019-x64-release-fastbuild-static-55e94982-minimal\Qt-5.14.2\include\QtWindowsUIAutomationSupport -I C:\buildenv\2.3-j00019-x64-release-fastbuild-static-55e94982-minimal\Qt-5.14.2\include\QtNetwork -I C:\buildenv\2.3-j00019-x64-release-fastbuild-static-55e94982-minimal\Qt-5.14.2\include\QtOpenGL -I C:\buildenv\2.3-j00019-x64-release-fastbuild-static-55e94982-minimal\Qt-5.14.2\include\QtWidgets -I C:\buildenv\2.3-j00019-x64-release-fastbuild-static-55e94982-minimal\Qt-5.14.2\include\QtScript -I C:\buildenv\2.3-j00019-x64-release-fastbuild-static-55e94982-minimal\Qt-5.14.2\include\QtScriptTools -I C:\buildenv\2.3-j00019-x64-release-fastbuild-static-55e94982-minimal\Qt-5.14.2\include\QtSql -I C:\buildenv\2.3-j00019-x64-release-fastbuild-static-55e94982-minimal\Qt-5.14.2\include\QtSvg -I C:\buildenv\2.3-j00019-x64-release-fastbuild-static-55e94982-minimal\Qt-5.14.2\include\QtTest -I C:\buildenv\2.3-j00019-x64-release-fastbuild-static-55e94982-minimal\Qt-5.14.2\include\QtXml -I D:\a\mixxx\mixxx\lib\qm-dsp -I D:\a\mixxx\mixxx\lib\qm-dsp\include -I D:\a\mixxx\mixxx\lib -I C:\buildenv\2.3-j00019-x64-release-fastbuild-static-55e94982-minimal\include\taglib -I D:\a\mixxx\mixxx\lib\hidapi\hidapi -I D:\a\mixxx\mixxx\lib\xwax -DWIN32 /fo CMakeFiles\mixxx.dir\src\mixxx.rc.res D:\a\mixxx\mixxx\src\mixxx.rc
sccache: error: failed to execute compile
sccache: caused by: Compiler not supported: "ninja: FATAL: Couldn\'t parse arguments.\r\n\r\nusage:\r\n    cmcldeps <language C, CXX or RC>  <source file path>  <output path for *.d file>  <output path for *.obj file>  <prefix of /showIncludes>  <path to cl.exe>  <path to tool (cl or rc)>  <rest of command ...>\r\n\r\n"
[716/841] Building CXX object CMakeFiles\mixxx.dir\C_\buildenv\2.3-j00019-x64-release-fastbuild-static-55e94982-minimal\Qt-5.14.2\lib\cmake\Qt5Gui\Qt5Gui_QICOPlugin_Import.cpp.obj
ninja: build stopped: subcommand failed.
Error: Process completed with exit code 1.

A workaround is to split most of the program into a library target with CMake and define a separate executable target that includes the RC file so RULE_LAUNCH_COMPILE can be set only for the library target but not the executable.

Bug on sccache's tracker

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking