-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
prevent use of ProjectOptions_SRC_DIR as cache var #154
Merged
aminya
merged 4 commits into
aminya:main
from
ClausKlein:feature/prevent-use-of-ProjectOptions_SRC_DIR
Sep 16, 2022
Merged
prevent use of ProjectOptions_SRC_DIR as cache var #154
aminya
merged 4 commits into
aminya:main
from
ClausKlein:feature/prevent-use-of-ProjectOptions_SRC_DIR
Sep 16, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aminya
reviewed
Sep 15, 2022
aminya
requested changes
Sep 15, 2022
I have problems to build the test on my native OSX with newest apple clang: -- Build files have been written to: /Users/clausklein/cmake/project_options/test/cmake-build-test-x86_64-Debug/install
+ cmake --build ./cmake-build-test-x86_64-Debug/install
[4/9] Building CXX object CMakeFiles/main.dir/cmake_pch.hxx.pch
Checking /Users/clausklein/cmake/project_options/test/cmake-build-test-x86_64-Debug/install/CMakeFiles/main.dir/cmake_pch.hxx.cxx ...
Checking /Users/clausklein/cmake/project_options/test/cmake-build-test-x86_64-Debug/install/CMakeFiles/main.dir/cmake_pch.hxx.cxx: FMT_LOCALE=1...
[5/9] Building CXX object CMakeFiles/lib2.dir/cmake_pch.hxx.pch
Checking /Users/clausklein/cmake/project_options/test/cmake-build-test-x86_64-Debug/install/CMakeFiles/lib2.dir/cmake_pch.hxx.cxx ...
Checking /Users/clausklein/cmake/project_options/test/cmake-build-test-x86_64-Debug/install/CMakeFiles/lib2.dir/cmake_pch.hxx.cxx: FMT_LOCALE=1...
[6/9] Building CXX object CMakeFiles/main.dir/src/main/main.cpp.o
FAILED: CMakeFiles/main.dir/src/main/main.cpp.o
/usr/local/Cellar/cmake/3.24.1/bin/cmake -E __run_co_compile --launcher=/usr/local/bin/ccache --tidy="/usr/local/opt/llvm/bin/clang-tidy;-extra-arg=-Wno-unknown-warning-option;-extra-arg=-std=c++20;--extra-arg-before=--driver-mode=g++" --cppcheck="/usr/local/bin/cppcheck;--template=gcc;--enable=style,performance,warning,portability;--inline-suppr;--suppress=internalAstError;--suppress=unmatchedSuppression;--inconclusive;--std=c++20" --source=/Users/clausklein/cmake/project_options/test/src/main/main.cpp -- /Applications/Xcode.app/Contents/Developer/usr/bin/g++ -DFMT_LOCALE -isystem /Users/clausklein/cmake/project_options/test/cmake-build-test-x86_64-Debug/install/vcpkg_installed/x64-osx/include -isystem /Users/clausklein/cmake/project_options/test/cmake-build-test-x86_64-Debug/install/vcpkg_installed/x64-osx/include/eigen3 -g -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -fcolor-diagnostics -march=native --coverage -O0 -g -fsanitize=address,undefined -Wall -Wextra -Wextra-semi -Wshadow -Wnon-virtual-dtor -Wold-style-cast -Wcast-align -Wunused -Woverloaded-virtual -Wpedantic -Wconversion -Wsign-conversion -Wnull-dereference -Wdouble-promotion -Wformat=2 -Wimplicit-fallthrough -std=c++20 -Winvalid-pch -Xclang -include-pch -Xclang /Users/clausklein/cmake/project_options/test/cmake-build-test-x86_64-Debug/install/CMakeFiles/main.dir/cmake_pch.hxx.pch -Xclang -include -Xclang /Users/clausklein/cmake/project_options/test/cmake-build-test-x86_64-Debug/install/CMakeFiles/main.dir/cmake_pch.hxx -MD -MT CMakeFiles/main.dir/src/main/main.cpp.o -MF CMakeFiles/main.dir/src/main/main.cpp.o.d -o CMakeFiles/main.dir/src/main/main.cpp.o -c /Users/clausklein/cmake/project_options/test/src/main/main.cpp
error: PCH file built from a different branch ((clang-1400.0.29.102)) than the compiler () [clang-diagnostic-error]
1 error generated.
Error while processing /Users/clausklein/cmake/project_options/test/src/main/main.cpp.
Found compiler error(s).
[7/9] Building CXX object CMakeFiles/lib2.dir/src/mylib2/lib.cpp.o
FAILED: CMakeFiles/lib2.dir/src/mylib2/lib.cpp.o
/usr/local/Cellar/cmake/3.24.1/bin/cmake -E __run_co_compile --launcher=/usr/local/bin/ccache --tidy="/usr/local/opt/llvm/bin/clang-tidy;-extra-arg=-Wno-unknown-warning-option;-extra-arg=-std=c++20;--extra-arg-before=--driver-mode=g++" --cppcheck="/usr/local/bin/cppcheck;--template=gcc;--enable=style,performance,warning,portability;--inline-suppr;--suppress=internalAstError;--suppress=unmatchedSuppression;--inconclusive;--std=c++20" --source=/Users/clausklein/cmake/project_options/test/src/mylib2/lib.cpp -- /Applications/Xcode.app/Contents/Developer/usr/bin/g++ -DFMT_LOCALE -I/Users/clausklein/cmake/project_options/test/include -isystem /Users/clausklein/cmake/project_options/test/cmake-build-test-x86_64-Debug/install/vcpkg_installed/x64-osx/include -isystem /Users/clausklein/cmake/project_options/test/cmake-build-test-x86_64-Debug/install/vcpkg_installed/x64-osx/include/eigen3 -isystem /Users/clausklein/cmake/project_options/test/libs/mythirdpartylib/include -isystem /Users/clausklein/cmake/project_options/test/cmake-build-test-x86_64-Debug/install/libs/mythirdpartylib -g -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -fcolor-diagnostics -march=native --coverage -O0 -g -fsanitize=address,undefined -Wall -Wextra -Wextra-semi -Wshadow -Wnon-virtual-dtor -Wold-style-cast -Wcast-align -Wunused -Woverloaded-virtual -Wpedantic -Wconversion -Wsign-conversion -Wnull-dereference -Wdouble-promotion -Wformat=2 -Wimplicit-fallthrough -std=c++20 -Winvalid-pch -Xclang -include-pch -Xclang /Users/clausklein/cmake/project_options/test/cmake-build-test-x86_64-Debug/install/CMakeFiles/lib2.dir/cmake_pch.hxx.pch -Xclang -include -Xclang /Users/clausklein/cmake/project_options/test/cmake-build-test-x86_64-Debug/install/CMakeFiles/lib2.dir/cmake_pch.hxx -MD -MT CMakeFiles/lib2.dir/src/mylib2/lib.cpp.o -MF CMakeFiles/lib2.dir/src/mylib2/lib.cpp.o.d -o CMakeFiles/lib2.dir/src/mylib2/lib.cpp.o -c /Users/clausklein/cmake/project_options/test/src/mylib2/lib.cpp
error: PCH file built from a different branch ((clang-1400.0.29.102)) than the compiler () [clang-diagnostic-error]
1 error generated.
Error while processing /Users/clausklein/cmake/project_options/test/src/mylib2/lib.cpp.
Found compiler error(s).
ninja: build stopped: subcommand failed.
bash-3.2$ # |
this changes helps: diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
index 7739dca..b4f70da 100644
--- a/test/CMakeLists.txt
+++ b/test/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.16...3.21)
+cmake_minimum_required(VERSION 3.16...3.24)
# set a default CXX standard used by the external tools like clang-tidy, cppcheck, etc.
# You can later set fine-grained standards for each target using `target_compile_features`
@@ -49,16 +49,16 @@ project_options(
ENABLE_CACHE
ENABLE_CONAN
# WARNINGS_AS_ERRORS
- ENABLE_CPPCHECK
+ # ENABLE_CPPCHECK
ENABLE_CLANG_TIDY
- # ENABLE_INCLUDE_WHAT_YOU_USE
+ ENABLE_INCLUDE_WHAT_YOU_USE
ENABLE_COVERAGE
- ENABLE_PCH
- PCH_HEADERS
- ${PCH_HEADERS}
+ # ENABLE_PCH
+ # PCH_HEADERS
+ # ${PCH_HEADERS}
ENABLE_DOXYGEN
- ENABLE_INTERPROCEDURAL_OPTIMIZATION
- ENABLE_NATIVE_OPTIMIZATION
+ # ENABLE_INTERPROCEDURAL_OPTIMIZATION
+ # ENABLE_NATIVE_OPTIMIZATION
# ENABLE_USER_LINKER
# ENABLE_BUILD_WITH_TIME_TRACE
# ENABLE_UNITY |
aminya
approved these changes
Sep 16, 2022
It seems that PCH files are outdated. Clean the build directory. |
I do this always |
Open a new issue. It should be reproducible in CI. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
if to project A and B use different version of
project_options
andproject C use A and B with
CMP.cmake
(FetchContents), there is a commonCMakeCache
variable used!