ClickHouse/cmake/test_compiler.cmake
proller 9409419258 --no-pie flag have no effect in ubuntu, using -no-pie with test (#422)
* Cmake: fix apple build

* --no=pie flag have no effect in ubuntu, using -no-pie with test

* better
2017-01-31 00:09:11 +03:00

17 lines
265 B
CMake

include (CheckCXXSourceCompiles)
set (TEST_FLAG "-no-pie")
set (CMAKE_REQUIRED_FLAGS "${TEST_FLAG}")
check_cxx_source_compiles("
int main() {
return 0;
}
" HAVE_NO_PIE)
set (CMAKE_REQUIRED_FLAGS "")
if (HAVE_NO_PIE)
set (FLAG_NO_PIE ${TEST_FLAG})
endif ()