Skip to content

Adjust build script for native IDE building #3028

@JakubFornadel

Description

@JakubFornadel

Task Description

Adjust build script users who do not want to run build.sh, but rather use IDE cmake build process. Existing issue on macOS:

  • if clang is installed through both brew and xcode, build will not work because those 2 clangs are not binary compatible anc conan is using xcode clang. To fix that, this section must be added to the conan clang profile:
[buildenv]
CC=/opt/homebrew/opt/llvm@18/bin/clang
CXX=/opt/homebrew/opt/llvm@18/bin/clang++

, which is equivalent to

if [ "$(uname)" == "Darwin" ]; then
    export CC=/opt/homebrew/opt/llvm@${LLVM_VERSION}/bin/clang
    export CXX=/opt/homebrew/opt/llvm@${LLVM_VERSION}/bin/clang++
else
    export CC=clang-${LLVM_VERSION}
    export CXX=clang++-${LLVM_VERSION}
fi

from build script.

Overall to make the code built on macOS without build script:

  1. Add [buildenv] section to conan clang profile
  2. Manually run conan install, e.g. conan install . -s "build_type=Release" -s "&:build_type=RelWithDebInfo" --profile:host=clang --profile:build=clang --build=missing --output-folder=cmake-build-relwithdebinfo
    in case of removing build directory
  • Adding [buildenv] section to conan clang profile would not hurt anything evethough the same thing is already set in build script through export CC/CXX. For people who don't run the script it is useful though
  • moving conan install command to config.sh would work only if ${BUILD_DIR} and other variables used on that command would be properly set. They are not if you run it manually so it always choose build/ directory instead of what IDE is using, e.g. cmake-build-relwithdebinfo in my case

Epic Parent

Metadata

Metadata

Assignees

Labels

taskA small task that is, most likely, part of an Epic

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions