Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[mingw] add VCPKG cmake_system_name #11934

Closed
wants to merge 9 commits into from
Closed

[mingw] add VCPKG cmake_system_name #11934

wants to merge 9 commits into from

Conversation

MVoz
Copy link
Contributor

@MVoz MVoz commented Jun 14, 2020

Supports: !mingw or Supports: (mingw|windows) ...

vcpkg_fail_port_install(MESSAGE "Only ... is supported by ${PORT}" ON_TARGET MinGW)

logic

VCPKG_CMAKE_SYSTEM_NAME MinGW

set(VCPKG_CMAKE_SYSTEM_NAME MinGW)


example

VCPKG_CMAKE_SYSTEM_NAME WindowsStore

set(VCPKG_CMAKE_SYSTEM_NAME WindowsStore)

VCPKG_CMAKE_SYSTEM_NAME Emscripten

set(VCPKG_CMAKE_SYSTEM_NAME Emscripten)


why is there no compiler definition? as in the example

https://gitlab.kitware.com/cmake/community/-/wikis/doc/cmake/cross_compiling/Mingw

https://gitlab.kitware.com/cmake/community/uploads/265a703419aeaa26bef8044b92911e37/Toolchain-cross-mingw32-linux.cmake

# for 32 or 64 bits mingw-w64
# see http://mingw-w64.sourceforge.net/
set(COMPILER_PREFIX "i686-w64-mingw32")
#set(COMPILER_PREFIX "x86_64-w64-mingw32"

# which compilers to use for C and C++
find_program(CMAKE_RC_COMPILER NAMES ${COMPILER_PREFIX}-windres)
#SET(CMAKE_RC_COMPILER ${COMPILER_PREFIX}-windres)
find_program(CMAKE_C_COMPILER NAMES ${COMPILER_PREFIX}-gcc)
#SET(CMAKE_C_COMPILER ${COMPILER_PREFIX}-gcc)
find_program(CMAKE_CXX_COMPILER NAMES ${COMPILER_PREFIX}-g++)
#SET(CMAKE_CXX_COMPILER ${COMPILER_PREFIX}-g++)


# here is the target environment located
SET(USER_ROOT_PATH /home/erk/erk-win32-dev)
SET(CMAKE_FIND_ROOT_PATH  /usr/${COMPILER_PREFIX} ${USER_ROOT_PATH})

# adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search 
# programs in the host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

@MVoz MVoz changed the title Msys2 mingw architecture [mingw] add VCPKG cmake_system_name Jun 14, 2020
@@ -171,6 +174,7 @@ namespace vcpkg
case Identifier::android: return true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "Android");
case Identifier::emscripten: return true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "Emscripten");
case Identifier::wasm32: return true_if_exists_and_equal("VCPKG_TARGET_ARCHITECTURE", "wasm32");
case Identifier::mingw: return true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "mingw");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "mingw")
->
true_if_exists_and_equal("VCPKG_CMAKE_SYSTEM_NAME", "MinGW")

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok

@JackBoosY JackBoosY added the category:vcpkg-feature The issue is a new capability of the tool that doesn’t already exist and we haven’t committed label Jun 16, 2020
Copy link
Contributor

@PhoebeHui PhoebeHui left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks for the PR!

@MVoz MVoz marked this pull request as ready for review June 16, 2020 07:07
@MVoz MVoz closed this Jun 20, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
category:vcpkg-feature The issue is a new capability of the tool that doesn’t already exist and we haven’t committed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants