Skip to content

Recent CMake change exposed build error for MacOS #155

@jhiemstrawisc

Description

@jhiemstrawisc

It looks like a recent change to CMakeLists.txt by @GregThain changed the default behavior of the SCITOKENS_BUILD_UNITTESTS option, switching it from OFF by default to ON.

Pelican regularly builds scitokens-cpp on MacOS as part of our unit testing framework, and I think this change in default behavior introduced a build error for us. I haven't decided if this is an issue with Pelican or Scitokens, because I haven't been able to reproduce the error locally on my Mac, and I'm no CMake wizard.

Here's how we build/install the library:

git clone --depth=1 https://github.com/scitokens/scitokens-cpp.git
pushd scitokens-cpp
mkdir build
cd build
export SCITOKENS_CPP_DIR=$PWD/release_dir
cmake .. -GNinja -DCMAKE_INSTALL_PREFIX="$PWD/release_dir"
ninja install
sudo ln -s "$PWD"/release_dir/lib/libSciTokens*.dylib /usr/local/lib
popd

Prior to the CMake changes on 04/28/25 this worked fine, but now it yields the following error:

 + ninja install
ninja: error: 'external/gtest/src/gtest-build/lib/libgtest.a', needed by 'test/scitokens-gtest', missing and no known rule to make it

I confirmed this is tied to the SCITOKENS_BUILD_UNITTESTS option by modifying our build script to pass -DSCITOKENS_BUILD_UNITTESTS=OFF, which resulted in a successful build. Plus there's no reason we need to be building the unit tests.

I also pinned the version we use so we're not building off the tip of master.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions