Align CMake to Visual Studio projects#56875
Conversation
|
I need someone that uses CMake to review this. |
Because the third party lib is setup to export the include path as a 'system' include path, which makes to
Probably cause it's the default to have |
akrieger
left a comment
There was a problem hiding this comment.
I don't really do CMake but I can comment a bit generally about the windows build specifics.
|
The PCH change appears to have broken clang-tidy. |
clang-tidy run searched for |
|
Even still, we can't break clang-tidy. I think though what we can do is just conditionally enable PCH based on the same environment variable we use in the Makefile, just PCH=1 or 0. |
|
Or, alternatively, disable PCH when clang-tidy is enabled. |
akrieger
left a comment
There was a problem hiding this comment.
Sorry, meant to write some of these earlier but missed the submit button.
There was a problem hiding this comment.
My static analysis of this is satisfied. I haven't tested it locally but I trust @alef has, I've just reviewed it with my eyeballs. The clang-tidy check exercises the CMake setup hard enough that if it isn't obviously broken, it's probably fine. I would appreciate if someone who actually has tried to use the cmake build to build can validate it's not broken on other platforms, but the clang-tidy check is the only 'production' flow that depends on it.
One should not use CMAKE_SOURCE_DIR because changes during compiler features testing and wastes time too. Renaming the script because it's not more just looking for VCPKG.
Good enough for me :) |
Summary
None
Purpose of change
Use CMake and VCPKG to build a Windows release and testing it.
Describe the solution
/W3and/GRremoved starting CMake 3.15. Enforced with policies for clarity/std:c++14default since VS 2015 Update 3 (read CMake'sMSVC-CXX.cmake)/external:W1is set but not used since no includes are marked with/external:I/Ob1part of MinSizeRel and RelWithDebInfo presets/TPmeaning every file is a C++ file.src/third-partyis in/external:I/Gm-the whole option is deprecated/fp:preciseis default/MT. Enabled CMP0091 for itCMakePresets.jsonand toolchain files likebuild-scripts/MSVC.cmake.CMAKE_BUILD_TYPE(s)prebuild.cmdmay not havegit.exein PATH. It now attempt using VS own.LC_MESSAGE/used in testing because now in git database#include <tuple>and<cwctype>Build VCPKG's wholegettextjust to usemsgfmt. Since it take too long, maybe will be removed in favor of using the one in Git for WindowsDescribe alternatives you've considered
Started a local subperbuild branch with the SDL lineage but then realized VCPKG is just doing that.
Testing
and your GHAcmake --preset x64-debugcmake --build --preset x64-debugMaybe Linux WSL/Hyper-V images later.Additional context