交叉编译 firebreath 目标 windows
Cross compiling firebreath targeting windows
由于 NPAPI 实际上 100% 使用编译的二进制文件,因此希望构建同时包含所有平台代码的插件,因此将 cross 编译作为构建系统的优先功能是有意义的一个 NPAPI 框架。但是,当我尝试从 mac os x cross compile firebreath targeting windows 时,我得到:
$ bash firebreath/prepmake.sh Codebendercc/ build.win -DCMAKE_TOOLCHAIN_FILE=$HOME/Toolchain-mingw32.cmake
Using projects in: /path/to/project/root/Codebendercc
Generating build files in: /path/to/project/root/build.win
NOTE: The build files in /path/to/project/root/build.win should *NEVER* be modified directly. Make changes in cmake and re-run this script.
/path/to/root/build.win /path/to/root
-- The C compiler identification is GNU 4.9.3
-- The CXX compiler identification is GNU 4.9.3
-- Check for working C compiler: /usr/local/mingw/bin/i686-w64-mingw32-gcc
-- Check for working C compiler: /usr/local/mingw/bin/i686-w64-mingw32-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/local/mingw/bin/i686-w64-mingw32-g++
-- Check for working CXX compiler: /usr/local/mingw/bin/i686-w64-mingw32-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
!! Could not find VS DIR!
-- Visual Studio dir:
CMake Error at cmake/Win.cmake:126 (message):
FireBreath on windows requires ATL/MFC libs to be installed. Please
download the Microsoft DDK and install the build environments in \WinDDK
Call Stack (most recent call first):
cmake/common.cmake:31 (include)
CMakeLists.txt:41 (include)
-- Configuring incomplete, errors occurred!
See also "/path/to/project/root/build.win/CMakeFiles/CMakeOutput.log".
$HOME/Toolchain-mingw32.cmake
文件包含:
# the name of the target operating system
SET(CMAKE_SYSTEM_NAME Windows)
# which compilers to use for C and C++
SET(CMAKE_C_COMPILER /usr/local/mingw/bin/i686-w64-mingw32-gcc)
SET(CMAKE_CXX_COMPILER /usr/local/mingw/bin/i686-w64-mingw32-g++)
SET(CMAKE_RC_COMPILER /usr/local/mingw/bin/i686-w64-mingw32-windres)
SET(CMAKE_AR /usr/local/mingw/bin/i686-w64-mingw32-ar CACHE FILEPATH "Archiver")
# here is the target environment located
SET(CMAKE_FIND_ROOT_PATH /usr/local/mingw)
# 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)
有什么办法可以避免吗?
无法交叉编译 windows 库,原因很简单,ActiveX 代码当前需要 ATL,它只能使用 Visual Studio 构建(据我所知)。我建议使用构建机器 运行ning windows 并使用 Visual Studio(最好是 Professional,但它可能适用于 Express)用于您的 windows 构建。
这个问题很可能是可以解决的,但是这将是一个巨大的工作量——到目前为止还没有人花时间去做这项工作。
交叉编译会很好,但它肯定不是 FireBreath 团队的优先事项(我是主要开发人员),因为在 windows 上构建是一件简单的事情;就个人而言,我使用 jenkins 运行 在所有平台上同时构建作业并收集工件。在成本方面,这比消除 ATL 依赖所需的成本低得多。
也就是说,如果有人想为我重写框架的那部分以删除依赖项,我当然不会抱怨 =]
附带说明一下,我从未在 windows 上添加仅构建 NPAPI 版本的功能,理论上它不需要 ATL,因为仍然有几个部分,例如 DllRegisterServer 功能依靠ATL。不过,添加该功能会更容易,并且只需要您提出一个合适的抽象来替换所有这些功能,然后有条件地排除文件的 activex 部分;这不是一项简单的任务,但比在没有 ATL 的情况下重新实现整个 COM 堆栈要容易几个数量级。
由于 NPAPI 实际上 100% 使用编译的二进制文件,因此希望构建同时包含所有平台代码的插件,因此将 cross 编译作为构建系统的优先功能是有意义的一个 NPAPI 框架。但是,当我尝试从 mac os x cross compile firebreath targeting windows 时,我得到:
$ bash firebreath/prepmake.sh Codebendercc/ build.win -DCMAKE_TOOLCHAIN_FILE=$HOME/Toolchain-mingw32.cmake
Using projects in: /path/to/project/root/Codebendercc
Generating build files in: /path/to/project/root/build.win
NOTE: The build files in /path/to/project/root/build.win should *NEVER* be modified directly. Make changes in cmake and re-run this script.
/path/to/root/build.win /path/to/root
-- The C compiler identification is GNU 4.9.3
-- The CXX compiler identification is GNU 4.9.3
-- Check for working C compiler: /usr/local/mingw/bin/i686-w64-mingw32-gcc
-- Check for working C compiler: /usr/local/mingw/bin/i686-w64-mingw32-gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/local/mingw/bin/i686-w64-mingw32-g++
-- Check for working CXX compiler: /usr/local/mingw/bin/i686-w64-mingw32-g++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
!! Could not find VS DIR!
-- Visual Studio dir:
CMake Error at cmake/Win.cmake:126 (message):
FireBreath on windows requires ATL/MFC libs to be installed. Please
download the Microsoft DDK and install the build environments in \WinDDK
Call Stack (most recent call first):
cmake/common.cmake:31 (include)
CMakeLists.txt:41 (include)
-- Configuring incomplete, errors occurred!
See also "/path/to/project/root/build.win/CMakeFiles/CMakeOutput.log".
$HOME/Toolchain-mingw32.cmake
文件包含:
# the name of the target operating system
SET(CMAKE_SYSTEM_NAME Windows)
# which compilers to use for C and C++
SET(CMAKE_C_COMPILER /usr/local/mingw/bin/i686-w64-mingw32-gcc)
SET(CMAKE_CXX_COMPILER /usr/local/mingw/bin/i686-w64-mingw32-g++)
SET(CMAKE_RC_COMPILER /usr/local/mingw/bin/i686-w64-mingw32-windres)
SET(CMAKE_AR /usr/local/mingw/bin/i686-w64-mingw32-ar CACHE FILEPATH "Archiver")
# here is the target environment located
SET(CMAKE_FIND_ROOT_PATH /usr/local/mingw)
# 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)
有什么办法可以避免吗?
无法交叉编译 windows 库,原因很简单,ActiveX 代码当前需要 ATL,它只能使用 Visual Studio 构建(据我所知)。我建议使用构建机器 运行ning windows 并使用 Visual Studio(最好是 Professional,但它可能适用于 Express)用于您的 windows 构建。
这个问题很可能是可以解决的,但是这将是一个巨大的工作量——到目前为止还没有人花时间去做这项工作。
交叉编译会很好,但它肯定不是 FireBreath 团队的优先事项(我是主要开发人员),因为在 windows 上构建是一件简单的事情;就个人而言,我使用 jenkins 运行 在所有平台上同时构建作业并收集工件。在成本方面,这比消除 ATL 依赖所需的成本低得多。
也就是说,如果有人想为我重写框架的那部分以删除依赖项,我当然不会抱怨 =]
附带说明一下,我从未在 windows 上添加仅构建 NPAPI 版本的功能,理论上它不需要 ATL,因为仍然有几个部分,例如 DllRegisterServer 功能依靠ATL。不过,添加该功能会更容易,并且只需要您提出一个合适的抽象来替换所有这些功能,然后有条件地排除文件的 activex 部分;这不是一项简单的任务,但比在没有 ATL 的情况下重新实现整个 COM 堆栈要容易几个数量级。