Skip to content

Commit

Permalink
refactor: minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pplmx committed Aug 13, 2024
1 parent 96a6ee3 commit 14bdb33
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions template/cxx/{{cookiecutter.project_slug}}/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,20 @@ endif()

{% if cookiecutter.project_type == "binary" -%}

add_executable(${PROJECT_NAME} ${SOURCES})
add_executable(${PROJECT_NAME} ${SOURCES})

{% if not cookiecutter.is_shared -%}
{% else -%}

target_link_libraries(${PROJECT_NAME} PUBLIC "-static")
{% if not cookiecutter.is_shared -%}
# static library
add_library({{cookiecutter.project_slug}} STATIC src/library.cpp)
{% else -%}
# shared library
add_library({{cookiecutter.project_slug}} SHARED src/library.cpp)
{% endif %}

{%- endif %}
{% endif %}

{%- elif not cookiecutter.is_shared -%}

# static
add_library({{cookiecutter.project_slug}} src/library.cpp)

{%- else -%}

# shared
add_library({{cookiecutter.project_slug}} SHARED src/library.cpp)

{%- endif %}
{% if cookiecutter.project_type == "binary" and not cookiecutter.is_shared -%}
target_link_libraries(${PROJECT_NAME} PUBLIC "-static")
{% endif %}

0 comments on commit 14bdb33

Please sign in to comment.