build: Fix apple-non-apple cross building

When cross compiling for an apple platform on a non-apple platform
(or the reverse), `if(APPLE)` in line 32 should refer to the target
platform. Without importing the `APPLE` variable, it refers to the
host platform.

Reviewed-by: John Bowler <jbowler@acm.org>
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
This commit is contained in:
Joost Nieuwenhuijse 2025-02-26 22:17:08 +01:00 committed by Cosmin Truta
parent e2c1579816
commit dc71f481ff
2 changed files with 3 additions and 1 deletions

View File

@ -29,6 +29,7 @@ Author List
* Jeremy Maitin-Shepard * Jeremy Maitin-Shepard
* John Bowler * John Bowler
* Jon Creighton * Jon Creighton
* Joost Nieuwenhuijse
* Kyle Bentley * Kyle Bentley
* Martin Storsjö * Martin Storsjö
* Owen Rudge * Owen Rudge

View File

@ -1,7 +1,7 @@
# genout.cmake.in # genout.cmake.in
# Generate .out from .c with awk (generic), based upon the automake logic. # Generate .out from .c with awk (generic), based upon the automake logic.
# Copyright (c) 2022-2024 Cosmin Truta # Copyright (c) 2022-2025 Cosmin Truta
# Copyright (c) 2016 Glenn Randers-Pehrson # Copyright (c) 2016 Glenn Randers-Pehrson
# Written by Roger Leigh, 2016 # Written by Roger Leigh, 2016
# #
@ -16,6 +16,7 @@
set(SRCDIR "@CMAKE_CURRENT_SOURCE_DIR@") set(SRCDIR "@CMAKE_CURRENT_SOURCE_DIR@")
set(BINDIR "@CMAKE_CURRENT_BINARY_DIR@") set(BINDIR "@CMAKE_CURRENT_BINARY_DIR@")
set(APPLE "@APPLE@")
set(AWK "@AWK@") set(AWK "@AWK@")
set(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@") set(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@")
set(CMAKE_C_FLAGS @CMAKE_C_FLAGS@) set(CMAKE_C_FLAGS @CMAKE_C_FLAGS@)