29 Commits
Author SHA1 Message Date
Martin Storsjö 6a2d235ffd Revert "build-lldb-mi: Disallow detecting LLVM outside of $LLVM_DIR"
This reverts commit 9e628b0f2d.

If LLVM was built with --disable-dylib, then the individual
LLVM libraries may expose a dependency on zlib. By restricting
the lldb-mi build to detect dependencies outside of $LLVM_DIR,
the build of lldb-mi fails to find zlib, making it impossible to
find all the necessary dependencies, ending up with errors like this:

    CMake Error at llvm-mingw/llvm-project/llvm/build-asserts/lib/cmake/llvm/LLVMExports.cmake:55 (set_target_properties):
      The link interface of target "LLVMSupport" contains:

        ZLIB::ZLIB

      but the target was not found.  Possible reasons include:

        * There is a typo in the target name.
        * A find_package call is missing for an IMPORTED target.
        * An ALIAS target is missing.

Revert this change for now, to allow building lldb-mi against
a non-dylib build of LLVM.
2025-06-26 13:41:05 +03:00
Martin Storsjö 9e628b0f2d build-lldb-mi: Disallow detecting LLVM outside of $LLVM_DIR
Do the same as when cross compiling; disallow detecting dependencies
outside of the given CMAKE_FIND_ROOT_PATH. Don't export LLVM_DIR
as we no longer need to pass it implicitly that way.

This makes the errors clearer, if LLVM isn't found where expected,
instead of misdetecting it from a different installation of LLVM
in the system.

If lldb-mi would try to find other optional dependencies, they would
no longer be found; this was already the case when cross compiling
though.
2025-06-25 11:51:06 +03:00
Martin Storsjö d69ccd33a7 build-lldb-mi: Fix finding the build directory
As build-llvm now can create a larger variety of build dir names,
enumerating all possible suffixes becomes problematic (especially
as they don't necessarily appear in one canonical order).

Instead, iterate over potential matches. If cross compiling, it
is easy as we can require the directory to contain the expected
suffix. If not cross compiling, we have no explicit suffix to look
for, but we can check that the directory doesn't match common
cross compilation triples.
2025-06-25 11:51:06 +03:00
Martin Storsjö 2280c59bc7 Revert "build-lldb-mi: Fix building with CMake 4.0"
This reverts commit debafe1a80.

This workaround is no longer needed as this is fixed in upstream
lldb-mi.
2025-04-02 19:58:38 +03:00
Martin Storsjö f92375b57b build-lldb-mi: Bump to the latest upstream version
This version fixes building with CMake 4.0 out of the box.
2025-04-02 19:58:10 +03:00
Martin Storsjö debafe1a80 build-lldb-mi: Fix building with CMake 4.0
CMake 4.0 removed compatibility with CMake versions below 3.5.
Therefore, it errors out on projects with a
cmake_minimum_required() less than 3.5.

(Since CMake 3.31, it already warns that compatibility with versions
below 3.10 is deprecated.)

By passing CMAKE_POLICY_VERSION_MINIMUM=3.5, we indicate that
we are ok with configuring this project with the policies of
CMake 3.5, even if the project files themselves don't state it.

This flag is only recognized by CMake 4.0; older versions will
only warn that the manually specified variable is unused.
2025-04-02 11:45:35 +03:00
Martin Storsjö b30dc55095 build-lldb-mi: Bump to the latest upstream version 2025-02-28 15:07:33 +02:00
Martin Storsjö f84079bb71 macos: Bump the minimum deployment target to macOS 10.12
Since https://github.com/llvm/llvm-project/pull/117252 and
https://github.com/llvm/llvm-project/commit/186fac33d08b34be494caa58fe63972f69c6d6ab,
part of the latest git main branch, LLDB uses std::shared_mutex.

On macOS, std::shared_mutex is only available since macOS 10.12.

This change raises the deployment target from 10.9 to 10.12.
2024-12-13 09:51:58 +02:00
Martin Storsjö e921e3cdc6 build-lldb-mi: Update to the latest version from git 2024-07-24 09:52:44 +03:00
Martin Storsjö 5700ed3e85 build-lldb-mi: Bump to the latest version from git 2023-11-27 11:29:48 +02:00
Norbert Lange d0a03c46c0 Use CMake's build and install functionality
This allows simplification, this functionality was added long
ago to CMake.

Further motivation is to be able to re-direct the installation,
make/ninja install allow this by setting DESTDIR but this
generally doesnt work well with window paths (see [1]).

[1] - https://cmake.org/cmake/help/latest/envvar/DESTDIR.html#envvar:DESTDIR
2023-09-27 22:53:01 +03:00
Norbert Lange 97cd12a63a Ignore set but empty CORES variable
Change the behavior when the CORES environment variable
is set and empty.
Now `-j` will not be added to make/ninja.
2023-09-27 22:53:01 +03:00
Martin Storsjö 2bfe3e7c48 Remove setting the unused variable NINJA in build shell scripts
This variable ended up unused in
b89cdef107.
2023-09-21 12:42:03 +03:00
Martin Storsjö b46ae2b8f6 build-lldb-mi: Bump to the latest version from git 2023-08-10 08:02:07 +03:00
Martin Storsjö 4855077598 build-lldb-mi: Bump to the latest current version 2023-04-27 10:50:36 +03:00
Martin Storsjö 06f44cda62 Support cross compilation to non-windows targets
Don't have --host/$HOST imply targeting Windows, but actually inspect
the target triple where necessary.
2023-04-26 19:18:24 +03:00
Martin Storsjö af99275e2e Remove unnecessary empty cases in shell scripts 2023-04-26 10:01:21 +03:00
Martin Storsjö 21da44ac93 build-lldb-mi: Sync cross compilation logic improvements from build-llvm.sh 2023-04-26 10:01:21 +03:00
Martin Storsjö d347b2022c Revert "build-lldb-mi: Skip building lldb-mi, as it's incompatible with current llvm versions"
This reverts commit 49950ae6be.

It's now compatible with current llvm versions.
2023-04-11 00:08:27 +03:00
Martin Storsjö dc2c2e0727 build-lldb-mi: Bump to a version that builds in C++17 mode
This is compatible with LLVM 16 and git main.
2023-04-10 11:57:08 +03:00
Martin Storsjö 49950ae6be build-lldb-mi: Skip building lldb-mi, as it's incompatible with current llvm versions
Since the switch to building in C++17 mode in llvm 16, lldb-mi is
incompatible, until lldb-mi itself switches to building with C++17 too.

A fix has been suggested upstream in
https://github.com/lldb-tools/lldb-mi/pull/102, but there hasn't
been any action on it so far.
2023-01-29 01:06:10 +02:00
Martin Storsjö 349877296b Allow overriding what archs to build for, or what version to target, for MACOS_REDIST builds 2022-10-21 18:00:20 +03:00
Martin Storsjö 972b3b2725 Wipe the cmake cache before rerunning cmake
When rebuilding in an already built directory, cmake does use
the cache file, containing what variables were set to previously.
When changing build configuration (building with a different prefix,
or changing build configurations) this can often result in failed
cmake runs.

Wipe the cache (and the rest of the cmake temp files) by default.
This makes sure that the full cmake configuration is run each time
when running the build scripts, just like it does the first time.
(This doesn't remove the build artifacts; if nothing of significance
has changed, ninja would still reuse old built files.)

By setting the env variable NO_RECONF, this behaviour can be skipped,
rerunning cmake without wiping the cache inbetween. (For cases where
the user knows that the configuration hasn't changed since the last
build, this can speed up the cmake execution time a bit.)
2022-10-01 13:29:15 +03:00
Martin Storsjö 7060e41fc1 Stop manually setting CMAKE_CROSSCOMPILING
This is set implicitly when CMAKE_SYSTEM_NAME is set. According to
the docs, the user isn't supposed to set it manually.
2022-08-03 22:45:24 +03:00
Martin Storsjö 3d4e36806a Avoid using the nonstandard "which" command
This command isn't a standard tool; different distributions have
different implementations, and e.g. Fedora doesn't ship it by
default.

Settle on using "command -v $tool >/dev/null" for tests about whether
a tool is available. (We could also use "hash $tool 2>/dev/null" as we
already had in build-all.sh, but settling on using "command -v"
everywhere, for consistency and simplicity.)
2022-08-02 15:17:24 +03:00
Martin Storsjö ee6caf31cf Allow building a redistributable package for macOS
This includes building universal binaries (for arm64 and x86_64)
and targeting an older minimum deployment target.

(Before 1919720fdd348ca568b235bf3f1357c198eccd15 in llvm-project,
Jan 2022, building lldb's debugserver failed, if building for macOS
for multiple architectures, or for an architecture other than the
current host.)
2022-02-09 14:02:20 +02:00
Martin Storsjö 45cc868505 build-lldb-mi: Update to the latest version as of February 9th 2022-02-09 14:02:20 +02:00
Martin Storsjö 214b775065 build-lldb-mi: Update to the latest upstream version
This fixes a bunch of build warnings in some setups.
2021-10-01 22:22:53 +03:00
Martin Storsjö eaf5ac08e5 Build lldb-mi
Building this tool requires having a full LLVM build available;
either by installing without LLVM_INSTALL_TOOLCHAIN_ONLY (and not
stripping the llvm installation yet) or by pointing it at the
LLVM build directory instead. The latter works better for our
normal build flows.
2021-08-16 11:26:37 +03:00