-
Notifications
You must be signed in to change notification settings - Fork 41
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
Portability fixes #669
Portability fixes #669
Conversation
f1dadf9
to
820ee8e
Compare
Better errors if something is missing Not all platforms need 'dl' so use `CMAKE_DL_LIBS` which is set depending on if its needed Find threads with in a platform agnostic way which requires bumping `cmake_minimum_required` to 3.10.
|
||
pkg_search_module(PCRE REQUIRED libpcre) | ||
pkg_search_module(JSONC REQUIRED json-c) | ||
pkg_search_module(LIBGC REQUIRED bdw-gc-threaded bdw-gc) |
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 never tested bdw-gc
. Did you? If not, let's remove it.
Edit: if keeping, there should be automated tests.
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.
bdw-gc
builds with threading by default, only freebsd separates the threaded and non threaded versions.
file(READ lib/stdlib.ngs FILE_CONTENTS) | ||
string(REPLACE "#@INSTALL_LIBDIR@" ${CMAKE_INSTALL_LIBDIR}/ngs FILE_CONTENTS "${FILE_CONTENTS}") | ||
file(WRITE lib/stdlib.ngs "${FILE_CONTENTS}") |
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 would really prefer passing CMAKE_INSTALL_LIBDIR
to the C code and then exposing it into the language instead of this.
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 get the following error on Mac:
[ 64%] Building C object CMakeFiles/ngs.dir/compile.c.o
[ 71%] Building C object CMakeFiles/ngs.dir/debug.c.o
[ 78%] Building C object CMakeFiles/ngs.dir/ast.c.o
[ 85%] Building C object CMakeFiles/ngs.dir/malloc.c.o
[ 92%] Building C object CMakeFiles/ngs.dir/decompile.c.o
[100%] Linking C executable ngs
ld: library 'gc' not found
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[3]: *** [ngs] Error 1
make[2]: *** [CMakeFiles/ngs.dir/all] Error 2
make[1]: *** [all] Error 2
make: *** [build] Error 2
I don't know why this happens.
While working on another issue discovered that this also happens when I comment out |
I'll split out the dependency part and ngs_path so the other improvements aren't blocked |
Worked on #668 and had to make some changes. I took some of your changes here to the |
I have pulled your changes from this PR piece by piece into I've modified string replacement to passing |
Awesome, thank you. There is one change missing. #671 |
Better errors if something is missing
Not all platforms need 'dl' so use
CMAKE_DL_LIBS
which is set depending onif its needed
Find threads with in a platform agnostic way which requires bumping
cmake_minimum_required
to 3.10.