Skip to content

Commit

Permalink
cmake: add option ORC_SWAPRUN_NET for stability from network execution
Browse files Browse the repository at this point in the history
  • Loading branch information
fabienfl-orc committed Feb 11, 2021
1 parent 5828703 commit 241711d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Expand Up @@ -15,6 +15,7 @@ option(ORC_BUILD_JSON "Build with JSON StructuredOutput enabled" ON)
option(ORC_BUILD_BOOST_STACKTRACE "Build with stack backtrace enabled" ON)
option(ORC_DOWNLOADS_ONLY "Do not build ORC but only download vcpkg third parties" OFF)
option(ORC_DISABLE_PRECOMPILED_HEADERS "Disable precompiled headers" OFF)
option(ORC_SWAPRUN_NET "Enable PE option to for stable execution from network" ON)

if(NOT ORC_BUILD_COMMAND)
set(ORC_BUILD_FASTFIND OFF)
Expand Down
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -62,6 +62,7 @@ cmake --build . --config MinSizeRel -- -maxcpucount
| ORC_USE_STATIC_CRT | ON | Use static runtime |
| ORC_VCPKG_ROOT | ${ORC}/external/vcpkg | VCPKG root directory |
| ORC_XMLLITE_PATH | | XmlLite.dll path (xp sp2) |
| ORC_SWAPRUN_NET | ON | Enable PE flag for network use |
| VCPKG_TARGET_TRIPLET | Autodetect | VCPKG triplet to use |
| CMAKE_TOOLCHAIN_FILE | Autodetect | VCPKG's toolchain file |

Expand Down
8 changes: 8 additions & 0 deletions src/FastFind/CMakeLists.txt
Expand Up @@ -84,6 +84,14 @@ if("${CMAKE_GENERATOR_TOOLSET}" STREQUAL "v141_xp"
endif()
endif()

if(${ORC_SWAPRUN_NET})
add_custom_command(
TARGET FastFind
POST_BUILD
COMMAND editbin /swaprun:net $<TARGET_FILE:Orc>
)
endif()

foreach(CONFIG Debug MinSizeRel Release RelWithDebInfo)
install(TARGETS FastFind
CONFIGURATIONS ${CONFIG}
Expand Down
8 changes: 8 additions & 0 deletions src/Orc/CMakeLists.txt
Expand Up @@ -91,6 +91,14 @@ if("${CMAKE_GENERATOR_TOOLSET}" STREQUAL "v141_xp"
endif()
endif()

if(${ORC_SWAPRUN_NET})
add_custom_command(
TARGET Orc
POST_BUILD
COMMAND editbin /swaprun:net $<TARGET_FILE:Orc>
)
endif()

if(${ORC_BUILD_PARQUET})

if("${TARGET_ARCH}" STREQUAL "x64")
Expand Down

0 comments on commit 241711d

Please sign in to comment.