-
Notifications
You must be signed in to change notification settings - Fork 284
CMake: Enable CXX compiler for tests only #110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
LGTM, just need to wait for CI to finish |
I think the build error is due to this commit google/googletest@23b2a3b |
I think we should set properties on source files to set LANGUAGE to CXX |
CMakeLists.txt
Outdated
@@ -197,6 +197,7 @@ if(BUILD_TESTING) | |||
EXCLUDE_FROM_ALL) | |||
endif() | |||
|
|||
enable_language(CXX) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should try to move it just after if(BUILD_TESTING)
line 162 so googletest is build with support enabled
Almost fixed! :) |
Last remaining issue is ci setup bug (no ninja on ppc64) -> unrelated to this PR |
BTW I was not able to reproduce it using a docker # Create a virtual environment with all tools installed
# ref: https://hub.docker.com/_/ubuntu
FROM ubuntu:rolling AS env
LABEL maintainer="mizux.dev@gmail.com"
# Install system build dependencies
RUN apt-get update -qq \
&& apt-get install -yq git wget curl libssl-dev build-essential ninja-build \
&& apt-get install -yq python3-dev python3-pip \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Install CMake 3.16.4
RUN wget "https://cmake.org/files/v3.16/cmake-3.16.4-Linux-x86_64.sh" \
&& chmod a+x cmake-3.16.4-Linux-x86_64.sh \
&& ./cmake-3.16.4-Linux-x86_64.sh --prefix=/usr/local/ --skip-license \
&& rm cmake-3.16.4-Linux-x86_64.sh
CMD [ "/bin/bash" ]
# Create lib directory
WORKDIR /home/lib
# Bundle lib source
COPY . .
FROM env as build
RUN cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON -GNinja
#RUN cmake -S. -Bbuild -DBUILD_TESTING=ON
RUN cmake --build build
FROM build as test
RUN cmake --build build --target test docker build -t cpu_feature -f ci/Dockerfile . |
Fixes #109