Skip to content

Commit

Permalink
feat(docker): add static binary compile
Browse files Browse the repository at this point in the history
  • Loading branch information
pplmx committed Sep 20, 2022
1 parent 18ab452 commit 491534c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions template/cxx/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # clangd completion
file(GLOB SOURCES CONFIGURE_DEPENDS "${CMAKE_SOURCE_DIR}/src/*.cpp")

{% if proj_type == "bin" -%}
{% if bin_type == "static" -%}
link_libraries("-static")
{%- endif %}
add_executable(${PROJECT_NAME} ${SOURCES})
{%- elsif lib_type == "static" -%}
# static
Expand Down
6 changes: 6 additions & 0 deletions template/cxx/cargo-generate.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,12 @@ prompt = "Which cxx project type?"
choices = ["bin", "lib"]
default = "bin"

[conditional.'proj_type == "bin"'.placeholders.bin_type]
type = "string"
prompt = "Which bin compile type?"
choices = ["static", "dynamic"]
default = "dynamic"

[conditional.'proj_type == "lib"'.placeholders.lib_type]
type = "string"
prompt = "Which lib type?"
Expand Down

0 comments on commit 491534c

Please sign in to comment.