Compare commits

..

2 Commits

Author SHA1 Message Date
Eoin O'Neill 6898ee9a40
Merge 368f671912 into 36847f6af0 2024-02-09 22:50:58 +00:00
Eoin O'Neill 368f671912 Adjust clang version checking to account for other non-vanilla clangs
We can no longer make the assumption that all non-vanilla clang versions
are Apple's clang or that all other non vanilla clangs will work with
the given arguments. There are times where additional tools might use non vanilla clang
and the presumed arguments here will break compilation on those
platforms.

We might want to consider adding tooling-specific optimazation functions
long term to fetch desired optimizations on a platform basis.
2024-02-09 14:49:07 -08:00
1 changed files with 2 additions and 1 deletions

View File

@ -2,6 +2,7 @@ import os
import subprocess import subprocess
import sys import sys
from SCons.Script import ARGUMENTS from SCons.Script import ARGUMENTS
from SCons.Tool import Tool
from SCons.Variables import * from SCons.Variables import *
from SCons.Variables.BoolVariable import _text2bool from SCons.Variables.BoolVariable import _text2bool
@ -128,7 +129,7 @@ def generate(env):
if using_clang(env) and is_clang_type(env, "Apple"): if using_clang(env) and is_clang_type(env, "Apple"):
# Apple Clang, its linker doesn't like -s. # Apple Clang, its linker doesn't like -s.
env.Append(LINKFLAGS=["-Wl,-S", "-Wl,-x", "-Wl,-dead_strip"]) env.Append(LINKFLAGS=["-Wl,-S", "-Wl,-x", "-Wl,-dead_strip"])
elif is_clang_type(env, "clang"): elif using_clang(env) and is_clang_type(env, "clang"):
env.Append(LINKFLAGS=["-s"]) env.Append(LINKFLAGS=["-s"])
if env["optimize"] == "speed": if env["optimize"] == "speed":