Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLion is unable to get compiler information from circle (circle doesn't support -fpch-preprocess and -dD) #206

Open
nithrill opened this issue Jun 23, 2024 · 0 comments

Comments

@nithrill
Copy link

TL;DR

circle 205 doesn't support -fpch-preprocess or -dD, which prevents it from being used as the compiler for CMake projects in CLion.

I believe this to be relevant for circle since I'd expect one of the keys to its adaption being how well it plays with IDEs.

Details

When using circle as the compiler then any CMake target (e.g.: add_executable and add_library) generates the following error (as reported within CLion):

Cannot get compiler information:
	Compiler exited with error code 1: /usr/bin/circle -xc++ -g -std=c++11 -fpch-preprocess -v -dD -E
	circle: Unknown command line argument '-fpch-preprocess'.  Try: '/usr/bin/circle --help'
	circle: Did you mean '--ftime-report'?
	circle: Unknown command line argument '-dD'.  Try: '/usr/bin/circle --help'
	circle: Did you mean '-D'?

sample CMakeLists.txt

cmake_minimum_required(VERSION 3.5.1...3.28.1 FATAL_ERROR)

project(test_circle LANGUAGES CXX)

set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 11)

add_executable(test_circle test_circle.cpp)

sample test_circle.cpp

int main() {}

sample CMake command (used by CLion)

cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_CXX_COMPILER=circle -G "CodeBlocks - Unix Makefiles" -S /tmp/test_circle -B /tmp/test_circle/cmake-build-debug-circle-ubuntu-2404

Using CMake on its own doesn't generate any errors.

Searching for the issue on the Internet the best description I could find was in an issue that was raised on the open-watcom issue list back in 2020 (see open-watcom/open-watcom-v2#596).

A possible workaround is to use CLions Custom Compilers feature (released in CLion 2021.3 EAP):

The issue with using CLions Custom Compilers is that all the data is static (e.g., each time one adds a new #define or a new #include then the custom section needs to be regenerated).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant