Comments (16)
I have reported the issue upstream.
from project_options.
I found difference in log.
In v0.25.2
-- Using Windows MSVC toolchain
after v0.26.x
-- Using Windows Windows toolchain
maybe it is related issue I don't know. 🤷
from project_options.
0.32 does not fix this issue, but here is what I discovered after debugging a bit.
I think the issue is in the generator issue, maybe related to CLION.
If I run cmake like this please notice the -G option, then it works fine :
"C:\Program Files\JetBrains\CLion 2023.2\bin\cmake\win\x64\bin\cmake.exe" -DCMAKE_BUILD_TYPE=RelWithDebInfo -G "CodeBlocks - MinGW Makefiles" -S C:\Users\Shadow\CLionProjects\PhotoTools -B C:\Users\Shadow\CLionProjects\PhotoTools\cmake-build-relwithdebinfo-mingw"
While if I run it like this it does not work (the issue, here), note that's how Clion is setting the Generator by default :
"C:\Program Files\JetBrains\CLion 2023.2\bin\cmake\win\x64\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Release -G "CodeBlocks - NMake Makefiles" -S C:\Users\Shadow\CLionProjects\PhotoTools -B C:\Users\Shadow\CLionProjects\PhotoTools\cmake-build-release
Removing the "-G" (ie let's cmake decide what generator to use) like this also lead to the issue :
"C:\Program Files\JetBrains\CLion 2023.2\bin\cmake\win\x64\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Release -S C:\Users\Shadow\CLionProjects\PhotoTools -B C:\Users\Shadow\CLionProjects\PhotoTools\cmake-build-release
And this works too :
"C:\Program Files\JetBrains\CLion 2023.2\bin\cmake\win\x64\bin\cmake.exe" -G "Visual Studio 17 2022" -S C:\Users\Shadow\CLionProjects\PhotoTools -B C:\Users\Shadow\CLionProjects\PhotoTools\cmake-build-debug
So it sounds there's a combination of Generator/platform (windows) that lead to the issue, not sure it is a project_options issue
from project_options.
I have the same problem with my Windows 10 and visual studio 2022 17.
Tried to move the include(${_project_options_SOURCE_DIR}/Index.cmake)
under the project()
(so it could find the CMAKE_SYSTEM_PROCESSOR
), but got some other error...
My workaround right now is just not using CMakePresets.json
.
from project_options.
My workaround is using v0.25.2 :)
from project_options.
I don't understand the root of the problem. Why is the value of CMAKE_SYSTEM_PROCESSOR
not given in the logs? Is it a string?
from project_options.
Thanks a lot :D
from project_options.
I have the same problem. Should I return to 0.25 in the meanwhile ? BTW : I love project options
from project_options.
Also found that using CLION you may have to check that the compiler is pointing to the right version of "cl" (there's two cl installed one for x32 and other one for x64).
like this C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.34.31933\bin\Hostx64\x64\cl.exe
Setting project_option to v25 and resetting this seems to fix the problem (quite odd)
from project_options.
Issue reproduced today with 0.31 on Windows
- Using Windows Windows toolchain
CMake Error at cmake-build-release/_deps/_msvc_toolchain-src/Windows.MSVC.toolchain.cmake:166 (message):
**Unable identify compiler architecture for CMAKE_SYSTEM_PROCESSOR**
Call Stack (most recent call first):
cmake-build-release/_deps/_project_options-src/src/VCEnvironment.cmake:65 (include)
cmake-build-release/_deps/_project_options-src/src/Index.cmake:38 (msvc_toolchain)
cmake-build-release/_deps/_project_options-src/CMakeLists.txt:3 (include)
while version 0.25.2 correctly set this variable :
-- Running vcpkg install - done
BUILD TYPE : Release USING :MSVC version : 19.36.32537.0
CMAKE_SYSTEM_PROCESSOR = x64
CMAKE_SYSTEM_NAME = Windows
CMAKE_SYSTEM_VERSION =
CMAKE_SYSTEM = Windows
CMAKE_CXX_COMPILER = C:/Program Files/Microsoft Visual Studio/2022/Community/VC/Tools/MSVC/14.36.32532/bin/Hostx64/x64/cl.exe
CMAKE_CXX_COMPILER_VERSION = 19.36.32537.0
CMAKE_CXX_COMPILER_ID = MSVC
CMAKE_CXX_COMPILER_FRONTEND_VARIANT = MSVC
CMAKE_CXX_COMPILER_TARGET =
CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN =
CMAKE_CXX_COMPILER_LAUNCHER =
CMAKE_CXX_COMPILER_WORKS = TRUE
from project_options.
Merged #237 which disables the msvc toolchain if CMAKE_TOOL_CHAIN is already specified. I hope it fixes this issue.
from project_options.
Now, that I look at this again, I noticed that I didn't use CMAKE_TOOLCHAIN_FILE
as the variable to bypass the MSVC toolchain. That might be why it doesn't fix the issue.
Could you try v0.32.1
and see if it fixes the issue?
from project_options.
0.32 does not fix this issue, but here is what I discovered after debugging a bit. I think the issue is in the generator issue, maybe related to CLION. If I run cmake like this please notice the -G option, then it works fine.
@Nosenzor Not specifying -G
on Windows means Cmake will use the Visual Studio*
generator, which I specifically guard against. Maybe CMAKE_GENERATOR
is not set yet at that point.
project_options/src/VCEnvironment.cmake
Line 53 in 90b064b
from project_options.
Now, that I look at this again, I noticed that I didn't use
CMAKE_TOOLCHAIN_FILE
as the variable to bypass the MSVC toolchain. That might be why it doesn't fix the issue.Could you try
v0.32.1
and see if it fixes the issue?
Hey, very happy to help here so tested with 0.32.1 on windows, mac and linux. The good news is no more issue ! Well done !
BTW I suggest you try to automate test (like trying to build your example) using github actions on the three platforms FYI, I'm using project options with Lukka's vcpkg
from project_options.
Awesome! Closing this then
from project_options.
BTW I suggest you try to automate test (like trying to build your example) using github actions on the three platforms FYI, I'm using project options with Lukka's vcpkg
We already have a very comprehensive CI suite. We use setup-cpp
.
https://github.com/aminya/project_options/actions
from project_options.
Related Issues (20)
- CMake now supports SYSTEM includes on Windows for Ninja/MSVC
- update to stable tagged version of WindowsToolchain HOT 6
- cmake policy warnings HOT 1
- Macro for installing conan HOT 3
- Doxygen options overwrite HOT 1
- Warning is valid for C++/ObjC++ but not for C
- Cross-compiling HOT 10
- conancenter remote name is not conan's default
- `target_link_system_directories` dosen't support generator expressions that have semicolons
- Conan server errors inside CI HOT 1
- Support Conan 2 HOT 9
- When compiling with LTO compiler warnings should be passed to the linker. HOT 2
- Add an option to enable GCC 10+ analyzer HOT 2
- Add utility function to check if sanitizers are supported
- dynamic_project_options:
- target_find_dependencies with COMPONENT HOT 2
- target_find_dependencies and pkg-config HOT 10
- Using clang-cl with ENABLE_COVERAGE lead to 'argument unused during compilation: '-O0'' HOT 1
- Bincrafter's Conan repo down HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from project_options.