-
Notifications
You must be signed in to change notification settings - Fork 252
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
Fixes for the macOS build (iPhone with Xcode) #555
base: master
Are you sure you want to change the base?
Conversation
70cc815
to
325aee7
Compare
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.
I don't understand the reasoning for the removal of the PCH part, I've added inline comments.
tests/test.sh
Outdated
@@ -2206,7 +2206,7 @@ else | |||
fi | |||
|
|||
run_ice "$testdir/includes.h.gch" "local" 0 "keepoutput" $TESTCXX -x c++-header -Wall -Werror -c includes.h -o "$testdir"/includes.h.gch | |||
run_ice "$testdir/includes.o" "remote" 0 $TESTCXX -Wall -Werror -c includes.cpp -include "$testdir"/includes.h -Winvalid-pch -o "$testdir"/includes.o | |||
run_ice "$testdir/includes.o" "remote" 0 $TESTCXX -Wall -Werror -c includes.cpp -include includes.h -Winvalid-pch -o "$testdir"/includes.o |
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.
Why does this need changing?
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.
Original:
-include
and "$testdir"/includes.h
is actually ignored by codes I removed in the 325aee7. So test pass successfully.
Modified:
325aee7 makes "$testdir"/includes.h
starts actully to work. But there's no file with that name. Only includes.h
or `"$testdir"/includes.h.gch' are exist.
So I fixed it working as I have thought it is came from mistake.
client/cpp.cpp
Outdated
o = it++; | ||
flags.erase(o); | ||
} | ||
} |
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.
What trouble exactly is this part supposed to cause? The flags are removed for a reason, PCH files are not sent to the remote node, so if the flags are kept, the remote compilation may fail.
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.
In my environment, that code made building fail.
I'm using Prefix Header
option on Xcode.
This option help for not including common headers which is always included.
For example, As I set prefixHeader.pch
as value of Prefix Header
option, I don't need to include stdarg or vector or any other in my sourcecode.
// contents of prefixHeader.pch
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <float.h>
#include <math.h>
#include <stdio.h>
#include <time.h>
#include <stdint.h>
#include <assert.h>
#include <sys/time.h>
#include <sys/select.h>
#include <OpenGLES/ES2/gl.h>
#include <OpenGLES/ES2/glext.h>
#ifdef __OBJC__
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#endif
#ifdef __cplusplus
#include <vector>
#include <string>
#include <map>
#include <list>
#include <memory>
#include <functional>
#include <thread>
#include <mutex>
#include <unordered_map>
#include <list>
#include <algorithm>
#include <cstdint>
#include <stack>
#endif
But code that I removed make "-include prefixHeader.pch" skipped during local compilation, So build is failed because that source has not included stdio or vector or etc...
After some investigation, I found you removed the smilar code(#475 ).
I have thought the comment in the #475 can be also applied to the code I removed.
If it must not be removed, I have to find other way to support Prefix Header
option.
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.
Bleows are documentations in the Xcode.
Precompile Prefix Header (GCC_PRECOMPILE_PREFIX_HEADER)
Generates a precompiled header for the prefix header, which should reduce overall build times.Precompiling the prefix header will be most effective if the contents of the prefix header or any file it includes change rarely. If the contents of the prefix header or any file it includes change frequently, there may be a negative impact to overall build time.
Prefix Header (GCC_PREFIX_HEADER)
Implicitly include the named header. The path given should either be a project relative path or an absolute path.Preprocessor Macros (GCC_PREPROCESSOR_DEFINITIONS)
Space-separated list of preprocessor macros of the form foo or foo=bar.
@llunak ++ I have found the commit hash in the description is wrong. I have fixed it. |
This reverts commit 325aee7.
@llunak
Conclusion: |
@cinakyn I'm going to put this behind #548 because it looks like at one point you're trying to do the same sort of thing - create a "fake" path and include it in the compiler tarball. I would like to see #548 become a general mechanism for doing that. I'll take a further look at this PR over the coming weeks to see if it's good to go after we get the other one in. |
Hi.
I have used dozen of days for building iPhone application using icecc.
During works, There was some needs to modify little codes for handling clang and iPhone target.
This PR is the result of that modifications.
I hope these are helpful for other icecc user but it could be not.
My Environment:
__has_include
to decide wether some frameworks are included or not.apple-llvm
containing that commitCommits
8e551a6
Make some flags to be local because they are only used by preprocessor or would be OK without them.
27f52dc
clang compilation with "-fembed-bitcode" tries to access
/var/tmp
directory. As icecc environment maker doesn't handle it, iPhone build always fail with messageclang: unable to make temporary file: No such file or directory.
. This commit make dummy files for keeping that directory.325aee7
This commit removed handling pch for clang. Same logic exist on
call_cpp
is making some troubles. So I removed it from code.Thanks.