mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
--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
This commit is contained in:
parent
9e94066e98
commit
9409419258
@ -127,8 +127,8 @@ endif ()
|
||||
|
||||
include (cmake/test_compiler.cmake)
|
||||
if (USE_STATIC_LIBRARIES AND HAVE_NO_PIE)
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --no-pie")
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --no-pie")
|
||||
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAG_NO_PIE}")
|
||||
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FLAG_NO_PIE}")
|
||||
endif ()
|
||||
|
||||
set (SAN_FLAGS "-O3 -g -fno-omit-frame-pointer")
|
||||
|
@ -1,7 +1,8 @@
|
||||
include (CheckCXXSourceCompiles)
|
||||
|
||||
set (TEST_FLAG "--no-pie")
|
||||
set (TEST_FLAG "-no-pie")
|
||||
set (CMAKE_REQUIRED_FLAGS "${TEST_FLAG}")
|
||||
|
||||
check_cxx_source_compiles("
|
||||
int main() {
|
||||
return 0;
|
||||
@ -9,3 +10,7 @@ check_cxx_source_compiles("
|
||||
" HAVE_NO_PIE)
|
||||
|
||||
set (CMAKE_REQUIRED_FLAGS "")
|
||||
|
||||
if (HAVE_NO_PIE)
|
||||
set (FLAG_NO_PIE ${TEST_FLAG})
|
||||
endif ()
|
||||
|
Loading…
Reference in New Issue
Block a user