Commit fdbf0356 authored by Thomas Arcila's avatar Thomas Arcila

Fix capnpc extension handling on Windows

On Windows executables needs to end with .exe.
Fix this in CMakeLists.txt and update capnp detection code accordingly.
parent aa53106d
...@@ -182,7 +182,7 @@ if(NOT CAPNP_LITE) ...@@ -182,7 +182,7 @@ if(NOT CAPNP_LITE)
install(TARGETS capnp_tool capnpc_cpp capnpc_capnp ${INSTALL_TARGETS_DEFAULT_ARGS}) install(TARGETS capnp_tool capnpc_cpp capnpc_capnp ${INSTALL_TARGETS_DEFAULT_ARGS})
# Symlink capnpc -> capnp # Symlink capnpc -> capnp
install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink capnp \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_BINDIR}/capnpc\")") install(CODE "execute_process(COMMAND \"${CMAKE_COMMAND}\" -E create_symlink capnp${CMAKE_EXECUTABLE_SUFFIX} \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_BINDIR}/capnpc${CMAKE_EXECUTABLE_SUFFIX}\")")
endif() # NOT CAPNP_LITE endif() # NOT CAPNP_LITE
# Tests ======================================================================== # Tests ========================================================================
......
...@@ -78,7 +78,7 @@ public: ...@@ -78,7 +78,7 @@ public:
: context(context), disk(kj::newDiskFilesystem()), loader(*this) {} : context(context), disk(kj::newDiskFilesystem()), loader(*this) {}
kj::MainFunc getMain() { kj::MainFunc getMain() {
if (context.getProgramName().endsWith("capnpc")) { if (context.getProgramName().endsWith("capnpc") || context.getProgramName().endsWith("capnpc.exe")) {
kj::MainBuilder builder(context, VERSION_STRING, kj::MainBuilder builder(context, VERSION_STRING,
"Compiles Cap'n Proto schema files and generates corresponding source code in one or " "Compiles Cap'n Proto schema files and generates corresponding source code in one or "
"more languages."); "more languages.");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment