Skip to content
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

Support CMake style compiler feature checks #134

Open
NiklasRosenstein opened this issue Nov 25, 2016 · 1 comment
Open

Support CMake style compiler feature checks #134

NiklasRosenstein opened this issue Nov 25, 2016 · 1 comment
Assignees
Milestone

Comments

@NiklasRosenstein
Copy link
Collaborator

NiklasRosenstein commented Nov 25, 2016

You often find code like this in CMake:

check_include_file(assert.h HAVE_ASSERT_H)
check_function_exists(calloc HAVE_CALLOC)
check_struct_has_member("struct timespec" tv_sec "time.h" HAVE_STRUCT_TIMESPEC)
check_c_source_compiles("
__thread int tls;
int main(void) {
    return 0;
}" HAVE_GCC_THREAD_LOCAL_STORAGE)
check_c_compiler_flag("-fvisibility=hidden" WITH_VISIBILITY_HIDDEN)
try_run()

Many libraries use these together with a CMake configuration header file. We can already render CMake config files using the cmake_configure_file() function in the utils.cmake package, but we lack the feature checks.

@NiklasRosenstein NiklasRosenstein added this to the Craftr 2.x milestone Nov 25, 2016
@NiklasRosenstein NiklasRosenstein self-assigned this Nov 25, 2016
@NiklasRosenstein NiklasRosenstein removed this from the Craftr 2.x milestone Nov 25, 2016
@NiklasRosenstein
Copy link
Collaborator Author

Added try_run()

@NiklasRosenstein NiklasRosenstein modified the milestone: Future Dec 17, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant