-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
44 additions
and
3 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import os | ||
|
||
cxx_build_tool = "{{cookiecutter.cxx_build_tool}}" | ||
|
||
cmake_file = "CMakeLists.txt" | ||
xmake_file = "xmake.lua" | ||
|
||
if cxx_build_tool == "cmake": | ||
if os.path.exists(xmake_file): | ||
os.remove(xmake_file) | ||
elif cxx_build_tool == "xmake": | ||
if os.path.exists(cmake_file): | ||
os.remove(cmake_file) | ||
else: | ||
raise ValueError(f"Unknown cxx_build_tool: {cxx_build_tool}") |
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
-- Set project name and language | ||
set_project("{{cookiecutter.project_slug}}") | ||
set_languages("c++{{cookiecutter.cxx_standard_version}}") | ||
|
||
{% if cookiecutter.cxx_project_type == "binary" %} | ||
-- Binary project setup | ||
target("{{cookiecutter.project_slug}}") | ||
set_kind("binary") | ||
add_files("src/*.cpp") | ||
add_headerfiles("src/*.h") | ||
|
||
{% if cookiecutter.cxx_share_enabled == "STATIC" %} | ||
-- Static link settings for non-macOS platforms | ||
if not is_plat("macosx") then | ||
add_ldflags("-static", {force = true}) | ||
end | ||
{% endif %} | ||
|
||
{% else %} | ||
-- Library project setup | ||
target("{{cookiecutter.project_slug}}") | ||
set_kind("{{cookiecutter.cxx_share_enabled | lower}}") | ||
add_files("src/*.cpp") | ||
add_headerfiles("src/*.h") | ||
{% endif %} |