mirror of
https://github.com/RYDE-WORK/pybind11.git
synced 2026-02-03 22:14:33 +08:00
minor CMakeLists.txt tweak: optimize for small binaries even in release builds
This commit is contained in:
parent
929fd7e694
commit
867ae377ed
@ -123,6 +123,11 @@ elseif (UNIX)
|
|||||||
# .SO file extension on Linux/Mac OS
|
# .SO file extension on Linux/Mac OS
|
||||||
set_target_properties(example PROPERTIES SUFFIX ".so")
|
set_target_properties(example PROPERTIES SUFFIX ".so")
|
||||||
|
|
||||||
|
# Optimize for a small binary size
|
||||||
|
if (NOT ${U_CMAKE_BUILD_TYPE} MATCHES DEBUG)
|
||||||
|
set_target_properties(example PROPERTIES COMPILE_FLAGS "-Os")
|
||||||
|
endif()
|
||||||
|
|
||||||
# Strip unnecessary sections of the binary on Linux/Mac OS
|
# Strip unnecessary sections of the binary on Linux/Mac OS
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
set_target_properties(example PROPERTIES MACOSX_RPATH ".")
|
set_target_properties(example PROPERTIES MACOSX_RPATH ".")
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user