diff --git a/CMakeLists.txt b/CMakeLists.txt index 4df006619..d4b32449f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -152,7 +152,7 @@ endif() # Initialize macros etc. set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/modules/" ${CMAKE_MODULE_PATH}) -if(CMAKE_CROSSCOMPILING AND NOT CORRADE_TARGET_WINDOWS_RT) +if(CMAKE_CROSSCOMPILING) find_program(CORRADE_RC_EXECUTABLE corrade-rc) if(NOT CORRADE_RC_EXECUTABLE) message(FATAL_ERROR "Native `corrade-rc` executable, which is needed when crosscompiling, was not found") diff --git a/doc/building-corrade.dox b/doc/building-corrade.dox index 6304ccc77..8e479a8c3 100644 --- a/doc/building-corrade.dox +++ b/doc/building-corrade.dox @@ -659,25 +659,28 @@ git submodule update --init @m_class{m-block m-primary} @par Native build of corrade-rc - For all cross-compilation except the UWP / Windows RT build, you need to - have a native version of Corrade installed, because Corrade needs to run - the `corrade-rc` utility on the host system as part of the build process. - If native version of `corrade-rc` is not found on the system, - cross-compilation will fail. If `corrade-rc` is not in `PATH`, point CMake - to it using `-DCORRADE_RC_EXECUTABLE=/path/to/corrade-rc`. + You also need to have a native version of Corrade installed, because + Corrade needs to run `corrade-rc` utility on the host system as part of the + build process. If native version of `corrade-rc` is not found on the + system, cross-compilation will fail. If `corrade-rc` is not in `PATH`, + point CMake to it using `-DCORRADE_RC_EXECUTABLE=/path/to/corrade-rc`. -@subsection building-corrade-cross-winrt Cross-compiling for UWP / Windows RT +@subsection building-corrade-cross-winrt Cross-compiling for Windows RT As said above, you need a native build of the `corrade-rc` executable. The below script assumes that a native Corrade build is installed in `C:/Sys` and the installation path for WinRT is in `C:/Sys-winrt`. You need at least Windows 8.1, Visual Studio 2015 and Windows 8.1 Store/Phone SDK installed. Because WinRT applications run in a sandbox, it's recommended to build the library as -static so you don't have to bundle all the DLLs. Example is below: +static so you don't have to bundle all the DLLs. Example is below, you can omit +specifying `CORRADE_RC_EXECUTABLE` if +@ref building-corrade-cross-rc "natively-built corrade-rc" is accessible +through `PATH`. @code{.bat} mkdir build-winrt && cd build-winrt cmake .. ^ + -DCORRADE_RC_EXECUTABLE="C:/Sys/bin/corrade-rc.exe" ^ -DCMAKE_INSTALL_PREFIX="C:/Sys-winrt" ^ -DBUILD_STATIC=ON ^ -DCMAKE_SYSTEM_NAME=WindowsStore ^ diff --git a/doc/corrade-changelog.dox b/doc/corrade-changelog.dox index a4df7bdfe..9f781bbed 100644 --- a/doc/corrade-changelog.dox +++ b/doc/corrade-changelog.dox @@ -33,11 +33,6 @@ namespace Corrade { @subsection corrade-changelog-latest-buildsystem Build system -- On UWP / Windows RT builds it's not needed to build a native version of - @ref corrade-rc "corrade-rc" anymore, it's now generated as a native - executable during the crosscompilation build (see - [mosra/corrade#81](https://github.com/mosra/corrade/issues/81) and - [mosra/corrade#82](https://github.com/mosra/corrade/pull/82)) - Fixed compilation of the @ref main "Corrade::Main" library on i686 MinGW @subsection corrade-changelog-latest-documentation Documentation diff --git a/src/Corrade/Utility/CMakeLists.txt b/src/Corrade/Utility/CMakeLists.txt index 167827752..084fc6ab9 100644 --- a/src/Corrade/Utility/CMakeLists.txt +++ b/src/Corrade/Utility/CMakeLists.txt @@ -171,9 +171,15 @@ if(WITH_UTILITY) add_library(Corrade::Utility ALIAS CorradeUtility) endif() -# On Windows RT / UWP the corrade-rc has VS_WINRT_COMPONENT set and thus we -# don't need a separate native build -if(NOT CMAKE_CROSSCOMPILING OR CORRADE_TARGET_WINDOWS_RT) +# TODO: https://cmake.org/pipermail/cmake-developers/2015-January/024242.html +# mentions that in the future it might be possible to not require external +# corrade-rc when generating WinRT targets by setting +# set_target_properties(corrade-rc PROPERTIES VS_WINRT_COMPONENT OFF) +# Then this would be if(NOT CMAKE_CROSSCOMPILING OR CORRADE_TARGET_WINDOWS_RT). +# However, it seems like this feature never materialized, as doing this will +# result in corrade-rc that's looking for vcruntime140_app.dll in order to be +# run. Last checked: Nov 2019. +if(NOT CMAKE_CROSSCOMPILING) # Sources for standalone corrade-rc set(CorradeUtilityRc_SRCS Arguments.cpp @@ -219,9 +225,6 @@ if(NOT CMAKE_CROSSCOMPILING OR CORRADE_TARGET_WINDOWS_RT) target_link_libraries(corrade-rc PRIVATE ${CMAKE_DL_LIBS}) endif() set_target_properties(corrade-rc PROPERTIES FOLDER "Corrade/Utility") - if(CORRADE_TARGET_WINDOWS_RT) - set_target_properties(corrade-rc PROPERTIES VS_WINRT_COMPONENT OFF) - endif() install(TARGETS corrade-rc DESTINATION ${CORRADE_BINARY_INSTALL_DIR}) # Corrade::rc target alias for superprojects