I’m new to JUCE and I want to play with it to see if it’s suitable for my work, but I’ve hit an issue right away. Juceaide is failing to build during cmake setup if I specify clang-18 as the compiler. I’ve stripped my set up down to a minimum that reproduces it and put it up on gitlab.
I get this problem on MacOS and Linux.
I’m running cmake as…
cmake -S . -B build -DCMAKE_CXX_COMPILER=clang-18 -DCMAKE_C_COMPILER=clang-18
My minimal CMakeLists.txt is
cmake_minimum_required(VERSION 3.15 FATAL_ERROR)
include(CPM.txt)
set(CMAKE_CXX_STANDARD 23)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_SCAN_FOR_MODULES OFF)
set (CMAKE_CXX_FLAGS_INIT "-Wall -std=c++23 -stdlib=libc++ -Wno-deprecated-declarations")
add_link_options(-lc++ -lm)
# set the project name and version
project(HelloWorld VERSION 1.0)
# add juce, commenting out this line and it will work
CPMAddPackage("gh:juce-framework/JUCE#8.0.0")
# add our c++23 test program
add_executable(hello
"hello.cpp"
)
I get copious errors along the lines of…
check_atomic_cDtk0I0RpHz3y4Og.cpp:(.text._ZNKSt13__atomic_baseIxE12is_lock_freeEv[_ZNKSt13__atomic_baseIxE12is_lock_freeEv]+0x19):
undefined reference to `__atomic_is_lock_free'
It appears that the juceaide build is being passed the compiler, it is not being passed the compiler flags. Is there any way I can force juceaide to just use the default system compiler; have it use my flags; or just have it built separately and installed somehow before I invoke cmake? This is a complete blocker for me.
