-
Notifications
You must be signed in to change notification settings - Fork 13
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
First step to install cxx_module #92
Merged
dietmarkuehl
merged 7 commits into
bemanproject:modules
from
ClausKlein:feature/install-cxx_module
Nov 28, 2024
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9f05438
First step to install cxx_module
ClausKlein 80b22ed
Allow CI workflow to run on every branch
ClausKlein 2725315
Disable g++ builds for now
ClausKlein 87f5fef
Cleanup
ClausKlein 107c774
Set CXX_MODULES_DIRECTORY and CMAKE_DEBUG_POSTFIX
ClausKlein 6910adc
Fix module example
ClausKlein f194608
Prevent linker problems with sanitizer or gcov
ClausKlein File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,15 +3,18 @@ | |
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
# cmake-format: on | ||
|
||
cmake_minimum_required(VERSION 3.25...3.31) | ||
cmake_minimum_required(VERSION 3.30...3.31) | ||
|
||
project(beman_execution26 VERSION 0.0.1 LANGUAGES CXX) | ||
project(beman_execution26 VERSION 0.1.0 LANGUAGES CXX) | ||
|
||
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR}) | ||
message(FATAL_ERROR "In-source builds are not allowed!") | ||
endif() | ||
|
||
set(CMAKE_CXX_SCAN_FOR_MODULES ON) | ||
# Note that scanning is only performed if C++20 or higher is enabled for the target. Scanning for modules in the target's | ||
# sources belonging to file sets of type CXX_MODULES is always performed. | ||
# not needed: set(CMAKE_CXX_SCAN_FOR_MODULES ON) | ||
|
||
Comment on lines
+14
to
+17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I had problems without this definition. Adding it resulted in things building on MacOS. Probably this part of the code can be removed. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes |
||
set(TARGET_NAME execution26) | ||
set(TARGET_NAMESPACE beman) # FIXME: not used in install(EXPORT ...) CK? | ||
set(TARGET_PREFIX ${TARGET_NAMESPACE}.${TARGET_NAME}) | ||
|
@@ -20,6 +23,9 @@ set(TARGET_ALIAS ${TARGET_LIBRARY}::${TARGET_LIBRARY}) | |
set(TARGET_PACKAGE_NAME ${PROJECT_NAME}-config) | ||
set(TARGETS_EXPORT_NAME ${PROJECT_NAME}-targets) | ||
|
||
# This variable is a special case of the more-general CMAKE_<CONFIG>_POSTFIX variable for the DEBUG configuration. | ||
set(CMAKE_DEBUG_POSTFIX D) | ||
|
||
include(GNUInstallDirs) | ||
set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}) | ||
|
||
|
@@ -56,7 +62,7 @@ if(CMAKE_BUILD_TYPE STREQUAL Debug) | |
ENABLE_SANITIZER_POINTER_COMPARE | ||
ENABLE_SANITIZER_POINTER_SUBTRACT | ||
ENABLE_CONTROL_FLOW_PROTECTION | ||
ENABLE_STACK_PROTECTION | ||
# XXX ENABLE_STACK_PROTECTION | ||
ENABLE_OVERFLOW_PROTECTION | ||
# ENABLE_ELF_PROTECTION | ||
# ENABLE_RUNTIME_SYMBOLS_RESOLUTION | ||
|
@@ -86,7 +92,7 @@ include(CMakePackageConfigHelpers) | |
write_basic_package_version_file( | ||
${CMAKE_CURRENT_BINARY_DIR}/${TARGET_PACKAGE_NAME}-version.cmake | ||
VERSION ${CMAKE_PROJECT_VERSION} | ||
COMPATIBILITY AnyNewerVersion | ||
COMPATIBILITY SameMajorVersion | ||
) | ||
|
||
configure_package_config_file( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
g++
is the default compiler on Linuxes. I understand that modules are only [properly] implemented withg++-15
but it seems unfortunate to remove the default compiler entirely: is it possible to setupcmake
to use modules only for some compilers?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 should be possible, fmt, boost do so
Is g++15 available to install on ubuntu 24.04?
If so, we should try it.
On macOS, I have only g++14 which fail to compile the module code.