Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make enabling dynamic hpx_main on non-Linux systems a configuration error #4384

Merged
merged 1 commit into from Feb 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 12 additions & 4 deletions CMakeLists.txt
Expand Up @@ -299,10 +299,18 @@ else()
ON CATEGORY "Build Targets")
endif()

set(HPX_WITH_DYNAMIC_HPX_MAIN_DEFAULT OFF)
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" OR APPLE)
set(HPX_WITH_DYNAMIC_HPX_MAIN_DEFAULT ON)
endif()

hpx_option(HPX_WITH_DYNAMIC_HPX_MAIN BOOL
"Enable dynamic overload of system ``main()`` (Linux only, default: ON)"
ON ADVANCED)
if(HPX_WITH_DYNAMIC_HPX_MAIN AND (NOT MSVC))
"Enable dynamic overload of system ``main()`` (Linux and Apple only, default: ON)"
${HPX_WITH_DYNAMIC_HPX_MAIN_DEFAULT} ADVANCED)
if(HPX_WITH_DYNAMIC_HPX_MAIN)
if(NOT HPX_WITH_DYNAMIC_HPX_MAIN_DEFAULT)
hpx_error("HPX_WITH_DYNAMIC_HPX_MAIN was set to ON, but the option is only available on Linux and Apple (this is \"${CMAKE_SYSTEM_NAME}\").")
endif()
hpx_add_config_cond_define(HPX_HAVE_DYNAMIC_HPX_MAIN 1)
endif()

Expand Down Expand Up @@ -371,7 +379,7 @@ hpx_option(HPX_WITH_IO_COUNTERS BOOL
${HPX_WITH_IO_COUNTERS_DEFAULT} ADVANCED CATEGORY "Build Targets")
if(HPX_WITH_IO_COUNTERS)
if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
hpx_error("HPX_WITH_IO_COUNTERS was set to ON, but IO counters are only available on Linux (this is \"${CMAKE_SYSTEM_NAME}\")")
hpx_error("HPX_WITH_IO_COUNTERS was set to ON, but IO counters are only available on Linux (this is \"${CMAKE_SYSTEM_NAME}\").")
endif()
hpx_add_config_define(HPX_HAVE_IO_COUNTERS)
endif()
Expand Down