Skip to content

Commit

Permalink
Revert an attempt to make corrade-rc working on WinRT.
Browse files Browse the repository at this point in the history
It was based off an old mailing list thread but apparently the change
never materialized, as the executable reuquires vcruntime140_app.dll to
run and that one is available only when running an UWP app.

Sigh. Should have tested better.

This reverts commit 1a71898.
This reverts commit 53b5fcd.
  • Loading branch information
mosra committed Nov 18, 2019
1 parent 9584912 commit bb900a9
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 20 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
19 changes: 11 additions & 8 deletions doc/building-corrade.dox
Original file line number Diff line number Diff line change
Expand Up @@ -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 ^
Expand Down
5 changes: 0 additions & 5 deletions doc/corrade-changelog.dox
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 9 additions & 6 deletions src/Corrade/Utility/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit bb900a9

Please sign in to comment.