File: TestGCCSections.cmake

package info (click to toggle)
s3d 0.2.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,708 kB
  • sloc: ansic: 23,609; python: 488; perl: 98; makefile: 31; sh: 29
file content (16 lines) | stat: -rw-r--r-- 574 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# SPDX-License-Identifier: BSD-3-Clause
# SPDX-FileCopyrightText: 2007-2015  Sven Eckelmann <sven@narfation.org>

include(CheckCCompilerFlag)

# put data in new section for linker optimization
check_c_compiler_flag("-fdata-sections" HAVE_GCCDATASECTIONS)
if (HAVE_GCCDATASECTIONS)
	add_definitions("-fdata-sections")
endif (HAVE_GCCDATASECTIONS)

# put function in new section for linker optimization
check_c_compiler_flag("-ffunction-sections" HAVE_GCCFUNCTIONSECTIONS)
if (HAVE_GCCFUNCTIONSECTIONS)
	add_definitions("-ffunction-sections")
endif (HAVE_GCCFUNCTIONSECTIONS)