diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f4a78e..d6c4f08 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -94,7 +94,6 @@ if(NOT WIN32 AND NOT IS_CC_MSVC) set(COMPILE_OPTIONS "${COMPILE_OPTIONS}" "-fexpensive-optimizations" - "-fwhole-program" ) endif() endif() @@ -187,7 +186,11 @@ function(wtr_add_bin_target include(GNUInstallDirs) add_executable("${NAME}" "${SRC_SET}") set_property(TARGET "${NAME}" PROPERTY CXX_STANDARD "${WTR_WATCHER_CXX_STD}") - target_compile_options("${NAME}" PRIVATE "${CC_OPT_SET}") + if(NOT WIN32 AND NOT IS_CC_MSVC AND NOT IS_CC_APPLECLANG) + target_compile_options("${NAME}" PRIVATE "${CC_OPT_SET};-fwhole-program") + else() + target_compile_options("${NAME}" PRIVATE "${CC_OPT_SET}") + endif() target_link_options("${NAME}" PRIVATE "${LL_OPT_SET}") target_include_directories("${NAME}" PUBLIC "${INCLUDE_PATH}") target_link_libraries("${NAME}" PRIVATE "${LLIB_SET}") diff --git a/libwatcher-c.version b/libwatcher-c.version new file mode 100644 index 0000000..6fe0302 --- /dev/null +++ b/libwatcher-c.version @@ -0,0 +1,4 @@ +WATCHER_C { + global: wtr_* ; WTR_* ; + local: _Z* ; +};