Skip to content

Commit

Permalink
cmake: Honor CMAKE_SYSROOT if set
Browse files Browse the repository at this point in the history
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
  • Loading branch information
ericriff authored and ctruta committed Sep 5, 2024
1 parent 33ef48b commit 43d6ad3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions scripts/cmake/AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Author List
* Cosmin Truta
* Dan Rosser
* David Callu
* Eric Riff
* Gianfranco Costamagna
* Gleb Mazovetskiy
* Glenn Randers-Pehrson
Expand Down
5 changes: 5 additions & 0 deletions scripts/cmake/genout.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ set(BINDIR "@CMAKE_CURRENT_BINARY_DIR@")
set(AWK "@AWK@")
set(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@")
set(CMAKE_C_FLAGS @CMAKE_C_FLAGS@)
set(CMAKE_SYSROOT @CMAKE_SYSROOT@)
set(INCDIR "@CMAKE_CURRENT_BINARY_DIR@")
set(PNG_PREFIX "@PNG_PREFIX@")
set(PNGLIB_MAJOR "@PNGLIB_MAJOR@")
Expand All @@ -38,6 +39,10 @@ if(APPLE)
endif()
endif()

if(CMAKE_SYSROOT)
set(PLATFORM_C_FLAGS ${PLATFORM_C_FLAGS} "--sysroot=${CMAKE_SYSROOT}")
endif()

get_filename_component(INPUTEXT "${INPUT}" EXT)
get_filename_component(OUTPUTEXT "${OUTPUT}" EXT)
get_filename_component(INPUTBASE "${INPUT}" NAME_WE)
Expand Down

0 comments on commit 43d6ad3

Please sign in to comment.