-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reintroduce -nostdinc
for all system except macOS
#7684
Conversation
Signed-off-by: Olivier Voortman <olivier.voortman@gmail.com>
Instead of using toString().
macOS won't have `-nostdinc` until we support properly framework search path discovery.
expect or except? |
…sh-code Display only BuildCacheKey.getHashCode()
-nostdinc
for all system expect macOS-nostdinc
for all system except macOS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two small items.
@@ -33,7 +34,7 @@ | |||
private static class CCompileArgsTransformer extends GccCompilerArgsTransformer<CCompileSpec> { | |||
@Override | |||
protected boolean isNoStandardIncludes() { | |||
return false; | |||
return !OperatingSystem.current().isMacOsX(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a minor thing, but I think this should be based on the target platform (not that you could cross compile if you wanted to). We pass -nostdinc
for everything except macOS.
@@ -32,7 +33,7 @@ public CPCHCompiler(BuildOperationExecutor buildOperationExecutor, CompilerOutpu | |||
private static class CPCHCompileArgsTransformer extends GccCompilerArgsTransformer<CPCHCompileSpec> { | |||
@Override | |||
protected boolean isNoStandardIncludes() { | |||
return false; | |||
return !OperatingSystem.current().isMacOsX(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as above
@@ -33,7 +34,7 @@ | |||
private static class CppCompileArgsTransformer extends GccCompilerArgsTransformer<CppCompileSpec> { | |||
@Override | |||
protected boolean isNoStandardIncludes() { | |||
return false; | |||
return !OperatingSystem.current().isMacOsX(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as above
@@ -32,7 +33,7 @@ public CppPCHCompiler(BuildOperationExecutor buildOperationExecutor, CompilerOut | |||
private static class CppPCHCompileArgsTransformer extends GccCompilerArgsTransformer<CppPCHCompileSpec> { | |||
@Override | |||
protected boolean isNoStandardIncludes() { | |||
return false; | |||
return !OperatingSystem.current().isMacOsX(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as above
@@ -34,7 +36,9 @@ class CCompilerTest extends GccCompatibleNativeCompilerTest { | |||
@Override | |||
protected List<String> getCompilerSpecificArguments(File includeDir, File systemIncludeDir) { | |||
def arguments = super.getCompilerSpecificArguments(includeDir, systemIncludeDir) | |||
arguments.remove('-nostdinc') | |||
if (OperatingSystem.current().macOsX) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this just get moved up to the parent's method so we don't add -nostdinc
to begin with?
@@ -35,7 +36,9 @@ class CPCHCompilerTest extends GccCompatibleNativeCompilerTest { | |||
@Override | |||
protected List<String> getCompilerSpecificArguments(File includeDir, File systemIncludeDir) { | |||
def arguments = super.getCompilerSpecificArguments(includeDir, systemIncludeDir) | |||
arguments.remove('-nostdinc') | |||
if (OperatingSystem.current().macOsX) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as above
@@ -35,7 +36,9 @@ class CppCompilerTest extends GccCompatibleNativeCompilerTest { | |||
@Override | |||
protected List<String> getCompilerSpecificArguments(File includeDir, File systemIncludeDir) { | |||
def arguments = super.getCompilerSpecificArguments(includeDir, systemIncludeDir) | |||
arguments.remove('-nostdinc') | |||
if (OperatingSystem.current().macOsX) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as above
@@ -35,7 +36,9 @@ class CppPCHCompilerTest extends GccCompatibleNativeCompilerTest { | |||
@Override | |||
protected List<String> getCompilerSpecificArguments(File includeDir, File systemIncludeDir) { | |||
def arguments = super.getCompilerSpecificArguments(includeDir, systemIncludeDir) | |||
arguments.remove('-nostdinc') | |||
if (OperatingSystem.current().macOsX) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as above
@pzygielo except. For all platforms except for macOS, we want to restrict the include path used by the compiler to the set that Gradle knows about. We need to do a little more work to get this to work on macOS (to support Frameworks). |
Set CONSTANT_TIME_FOR_TAR_ENTRIES to epoch + 1 day (#7564)
* origin/lacasseio/native/nostdinc-linux: Reintroduce `-nostdinc` for all system expect macOS
macOS won't have
-nostdinc
until we support properly framework searchpath discovery.
Context
Fixes gradle/gradle-native#925
Gradle Core Team Checklist