-
Notifications
You must be signed in to change notification settings - Fork 18
Feature/refactory install module #211
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
Feature/refactory install module #211
Conversation
| #====================================================================== | ||
| # NOTE: Only for Release build with enabled install rules useful! CK | ||
| #====================================================================== | ||
| if(BEMAN_EXECUTION_INSTALL_CONFIG_FILE_PACKAGE AND NOT CMAKE_SKIP_INSTALL_RULES) | ||
| # test if the targets are usable from the install directory | ||
| add_test( | ||
| NAME install-to-stagedir | ||
| COMMAND | ||
| ${CMAKE_COMMAND} --install ${CMAKE_BINARY_DIR} --prefix | ||
| ${CMAKE_BINARY_DIR}/stagedir --config $<CONFIG> | ||
| ) | ||
| add_test( | ||
| NAME find-package-test | ||
| COMMAND | ||
| ${CMAKE_CTEST_COMMAND} # --verbose | ||
| --output-on-failure -C $<CONFIG> # | ||
| --build-and-test "${CMAKE_SOURCE_DIR}/examples" | ||
| "${CMAKE_CURRENT_BINARY_DIR}/find-package-test" # | ||
| --build-generator ${CMAKE_GENERATOR} # | ||
| --build-makeprogram ${CMAKE_MAKE_PROGRAM} # | ||
| --build-options # | ||
| "-D BEMAN_USE_MODULES=${BEMAN_USE_MODULES}" | ||
| "-D CMAKE_BUILD_TYPE=$<CONFIG>" | ||
| "-D CMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}" | ||
| "-D CMAKE_CXX_EXTENSIONS=${CMAKE_CXX_EXTENSIONS}" | ||
| "-D CMAKE_CXX_MODULE_STD=${CMAKE_CXX_MODULE_STD}" | ||
| "-D CMAKE_CXX_SCAN_FOR_MODULES=${CMAKE_CXX_SCAN_FOR_MODULES}" | ||
| "-D CMAKE_CXX_STANDARD=${CMAKE_CXX_STANDARD}" | ||
| "-D CMAKE_CXX_STANDARD_REQUIRED=${CMAKE_CXX_STANDARD_REQUIRED}" | ||
| "-D CMAKE_PREFIX_PATH=${CMAKE_BINARY_DIR}/stagedir" | ||
| ) | ||
| endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This add a test to build examples with the installed targets
| set(CMAKE_CXX_FLAGS_DEBUG_INIT "${SANITIZER_FLAGS}") | ||
|
|
||
| set(RELEASE_FLAGS "-O3 ${SANITIZER_FLAGS}") | ||
| set(RELEASE_FLAGS "-O3") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not add sanitizer flags for Release builds, it would be exported!
| "tests": ["Debug.Default", "Release.Default", "Release.MaxSan"] | ||
| "tests": [ | ||
| "Debug.Default", "Debug.MaxSan", | ||
| "Release.Default", "Release.Dynamic" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Windows, static and dynamic must be build in Release and tested after install!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dietmarkuehl or may dynamic libraries now the problem?
rm old cmake modules (was only experimental code!)
cmake/prelude.cmake
Outdated
| if(NOT APPLE) | ||
| return() | ||
| endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nickelpro @camio @JeffGarland Changed after review!
Now all non preset tests on UNIX CI workflows fails
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we know why these builds fail and is that something which can be fixed? I had a brief look but couldn’t actually spot a reason for the failure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we know why these builds fail and is that something which can be fixed? I had a brief look but couldn’t actually spot a reason for the failure.
line 37 above
| option( | ||
| BEMAN_USE_STD_MODULE | ||
| "Check if 'import std;' is possible with the toolchain?" | ||
| OFF | ||
| ON | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dietmarkuehl this seems to cause the CI problems!
Only BEMAN_USE_MODULES AND BEMAN_USE_STD_MODULE should control it, even if the toolchain supports it!
Installing a Library
Installation is handled by the
beman_install_library()helper.Function Signature
Arguments
name
Logical package name (e.g. "beman.utility").
Used to derive config file names and cache variable prefixes.
TARGETS
Targets to install and export.
DEPENDENCIES (optional)
Semicolon-separated list, one dependency per entry.
Each entry is a valid
find_dependency()argument list.NOTE: you must use the bracket form for quoting if not only a package name is used!
"[===[beman.inplace_vector 1.0.0]===] [===[beman.scope 0.0.1 EXACT]===] fmt"NAMESPACE (optional)
Namespace for imported targets.
Defaults to "beman::".
EXPORT_NAME (optional)
Name of the generated CMake export set.
Defaults to "-targets".
DESTINATION (optional)
Installation directory for C++ module interface units.
Defaults to
${CMAKE_INSTALL_INCLUDEDIR}/beman/modules.This function installs the specified project TARGETS and its
FILE_SET TYPE HEADERSto the default CMAKE install destination.It also handles the installation of the CMake config package files if
needed. If the given targets has
FILE_SET TYPE CXX_MODULE, it will alsoinstalled to the given DESTINATION
BEMAN_INSTALL_CONFIG_FILE_PACKAGESList of package names for which config files should be installed.
<PREFIX>_INSTALL_CONFIG_FILE_PACKAGEPer-package override to enable/disable config file installation.
is the uppercased package name with dots replaced by underscores.
Caveats
Only one
FILE_SET of each TYPEis supported to install with this function yet!