Skip to content

Commit

Permalink
Merge pull request #2372 from lf-lang/cpp-docker-cmake-fix
Browse files Browse the repository at this point in the history
Do not require libexecinfo in C++ docker images
  • Loading branch information
cmnrd authored Jul 23, 2024
2 parents 740ba74 + 2be839f commit 790fb5b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,6 @@ class CppStandaloneCmakeGenerator(private val targetConfig: TargetConfig, privat
|cmake_minimum_required(VERSION 3.5)
|project(${fileConfig.name} VERSION 0.0.0 LANGUAGES CXX)
|
|option(REACTOR_CPP_LINK_EXECINFO "Link against execinfo" OFF)
|
|${if (targetConfig.get(ExternalRuntimePathProperty.INSTANCE) != null) "find_package(reactor-cpp PATHS ${targetConfig.get(ExternalRuntimePathProperty.INSTANCE)})" else ""}
|
|set(LF_MAIN_TARGET ${fileConfig.name})
Expand All @@ -169,10 +167,6 @@ class CppStandaloneCmakeGenerator(private val targetConfig: TargetConfig, privat
|)
|target_link_libraries($S{LF_MAIN_TARGET} $reactorCppTarget)
|
|if(REACTOR_CPP_LINK_EXECINFO)
| target_link_libraries($S{LF_MAIN_TARGET} execinfo)
|endif()
|
|if(MSVC)
| target_compile_options($S{LF_MAIN_TARGET} PRIVATE /W4)
|else()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,8 @@ class CppStandaloneGenerator(generator: CppGenerator) :
private fun getCmakeArgs(
buildPath: Path,
outPath: Path,
additionalCmakeArgs: List<String> = listOf(),
sourcesRoot: String? = null
) = cmakeArgs + additionalCmakeArgs + listOf(
) = cmakeArgs + listOf(
"-DCMAKE_INSTALL_PREFIX=${outPath.toUnixString()}",
"-DCMAKE_INSTALL_BINDIR=$relativeBinDir",
"-S",
Expand All @@ -191,12 +190,11 @@ class CppStandaloneGenerator(generator: CppGenerator) :
private fun createCmakeCommand(
buildPath: Path,
outPath: Path,
additionalCmakeArgs: List<String> = listOf(),
sourcesRoot: String? = null
): LFCommand {
val cmd = commandFactory.createCommand(
"cmake",
getCmakeArgs(buildPath, outPath, additionalCmakeArgs, sourcesRoot),
getCmakeArgs(buildPath, outPath, sourcesRoot),
buildPath.parent
)

Expand All @@ -219,9 +217,7 @@ class CppStandaloneGenerator(generator: CppGenerator) :

override fun generateRunForInstallingDeps(): String {
return if (builderBase() == defaultImage()) {
("RUN set -ex && apk add --no-cache g++ musl-dev cmake make && apk add --no-cache"
+ " --update --repository=https://dl-cdn.alpinelinux.org/alpine/v3.16/main/"
+ " libexecinfo-dev")
("RUN set -ex && apk add --no-cache g++ musl-dev cmake make")
} else {
"# (Skipping installation of build dependencies; custom base image.)"
}
Expand All @@ -246,7 +242,6 @@ class CppStandaloneGenerator(generator: CppGenerator) :
listOf("cmake") + getCmakeArgs(
Path.of("./build"),
Path.of("."),
listOf("-DREACTOR_CPP_LINK_EXECINFO=ON"),
"src-gen"
),
listOf("cmake") + getMakeArgs(fileConfig.buildPath, true, fileConfig.name),
Expand Down

0 comments on commit 790fb5b

Please # to comment.