Skip to content
Commit 27eb7c5b authored by Craig Scott's avatar Craig Scott
Browse files

cmake: Ensure source and binary dirs are set

If only the source dir is provided, the binary dir is assumed
to be the working directory. If only the binary dir is provided
and it doesn't yet have a CMakeCache.txt to provide the
source dir, then the source dir is assumed to be the working
directory. This logic was not previously being handled
correctly when -S and/or -B options were involved.
Furthermore, when both were missing, no suitable error
message was provided and an empty string was used for
the build directory.

Fixes: #18707
parent a1adbc72
Loading
Loading
Loading
Loading
  • Brad King @brad.king

    mentioned in commit 1f411b0c

    ·

    mentioned in commit 1f411b0c

    Toggle commit list
  • Contributor

    We had some build scripts that implicitly used the working directory fallback when no directory was specified.

    Using a clone of https://github.com/google/flatbuffers as the working directory, on cmake 3.13.2 one could run

    cmake -G "Unix Makefiles"

    and the command would run correctly. cmake 3.13.3 gave an error: "CMake Error: No source or binary directory provided". Changing the command to:

    cmake -G "Unix Makefiles" .

    fixed the problem.

    Just figured this may be good to know in case other people were also relying on this bug :)

    https://xkcd.com/1172/

    Edited by Jeremy Day
  • Tobias C. Berner @tcberner

    mentioned in issue #18817 (closed)

    ·

    mentioned in issue #18817 (closed)

    Toggle commit list
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment