Private sources and patch to link arguments
This commit is contained in:
@@ -74,7 +74,7 @@ def recurse_cmakelists(path: Path):
|
||||
if has_headers:
|
||||
lines.append("target_include_directories(%s PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})"%(CMAKE_TARGET))
|
||||
if len(sources) != 0:
|
||||
lines.append("target_sources(%s PUBLIC"%(CMAKE_TARGET))
|
||||
lines.append("target_sources(%s PRIVATE"%(CMAKE_TARGET))
|
||||
lines += ["\t%s"%(src.name) for src in sources]
|
||||
lines.append(")")
|
||||
lines += ["add_subdirectory(%s)"%(directory.name) for directory in dirs]
|
||||
@@ -95,7 +95,7 @@ def root_cmakelists(path: Path):
|
||||
lines.append("add_library(%s STATIC)"%(CMAKE_TARGET))
|
||||
lines.append("target_compile_definitions(%s PRIVATE ${COMPILER_DEFINES})"%(CMAKE_TARGET))
|
||||
lines.append("target_compile_options(%s PRIVATE -Os -ffunction-sections -fdata-sections -g -flto)"%(CMAKE_TARGET))
|
||||
lines.append("target_link_options(%s PRIVATE -T ${LINKER_SCRIPT} --specs=nano.specs -Wl,--gc-sections -flto)"%(CMAKE_TARGET))
|
||||
lines.append("target_link_options(%s PRIVATE -T ${LINKER_SCRIPT} -Wl,--gc-sections -flto)"%(CMAKE_TARGET))
|
||||
|
||||
# Read previously generated contents
|
||||
with open(lists_path, "r") as _if:
|
||||
|
||||
Reference in New Issue
Block a user