CMake: Link execution error:% 1 is not a valid Win32 application

I am trying to build a NaCl extension for 64-bit Windows 8.1 using CMake. The same code runs on Ubuntu without any problems. Everything goes well until CMake tries to link this command:

cmake -E cmake_link_script link.txt

CMake command: Startup error:% 1 is not a valid Win32 application

The link.txt link is as follows:

C:/nacl_sdk/pepper_39/toolchain/win_pnacl/bin/pnacl-ar cr libfoo.a CMakeFiles/foo.dir/Foo.cc.o
C:/nacl_sdk/pepper_39/toolchain/win_pnacl/bin/pnacl-ranlib libfoo.a

This happens with both makefile NMake generators and Unix (the NaCl file contains the make.exe file for Windows).

If I run these commands manually, they will succeed. What could be wrong here?

+4
source share
1 answer

eugensk00, , ".bat" . ar ranlib:

set(CMAKE_AR                    "${PLATFORM_PREFIX}/bin/pnacl-ar.bat" CACHE STRING "")
set(CMAKE_RANLIB                "${PLATFORM_PREFIX}/bin/pnacl-ranlib.bat" CACHE STRING "")
+1

All Articles