ClickHouse/cmake/test_compiler.cmake

22 lines
363 B
CMake
Raw Normal View History

2017-01-30 13:40:04 +00:00
include (CheckCXXSourceCompiles)
include (CMakePushCheckState)
cmake_push_check_state ()
2017-01-30 13:40:04 +00:00
set (TEST_FLAG "-no-pie")
2017-01-30 13:40:04 +00:00
set (CMAKE_REQUIRED_FLAGS "${TEST_FLAG}")
2017-01-30 13:40:04 +00:00
check_cxx_source_compiles("
int main() {
return 0;
}
2017-01-30 13:40:04 +00:00
" HAVE_NO_PIE)
set (CMAKE_REQUIRED_FLAGS "")
if (HAVE_NO_PIE)
set (FLAG_NO_PIE ${TEST_FLAG})
endif ()
cmake_pop_check_state ()