diff --git a/desktop/Library_active_native.mk b/desktop/Library_active_native.mk index 7c09c10737ec..ef4815f1e947 100644 --- a/desktop/Library_active_native.mk +++ b/desktop/Library_active_native.mk @@ -13,6 +13,8 @@ $(eval $(call gb_Library_add_exception_objects,active_native, \ desktop/test/deployment/active/active_native \ )) +$(eval $(call gb_Library_set_external_code,active_native)) + $(eval $(call gb_Library_use_externals,active_native, \ boost_headers \ )) diff --git a/desktop/Library_passive_native.mk b/desktop/Library_passive_native.mk index ac2c0bc53b15..8bc14b5c48f6 100644 --- a/desktop/Library_passive_native.mk +++ b/desktop/Library_passive_native.mk @@ -15,6 +15,8 @@ $(eval $(call gb_Library_add_exception_objects,passive_native, \ $(eval $(call gb_Library_set_componentfile,passive_native,desktop/test/deployment/passive/passive_native)) +$(eval $(call gb_Library_set_external_code,passive_native)) + $(eval $(call gb_Library_use_externals,passive_native, \ boost_headers \ )) diff --git a/external/mysqlcppconn/Library_mysqlcppconn.mk b/external/mysqlcppconn/Library_mysqlcppconn.mk index 3a5da71592a4..8b6202fa7d4e 100644 --- a/external/mysqlcppconn/Library_mysqlcppconn.mk +++ b/external/mysqlcppconn/Library_mysqlcppconn.mk @@ -32,6 +32,8 @@ $(eval $(call gb_Library_use_externals,mysqlcppconn,\ endif endif +$(eval $(call gb_Library_set_external_code,mysqlcppconn)) + $(eval $(call gb_Library_set_warnings_not_errors,mysqlcppconn)) $(eval $(call gb_Library_set_generated_cxx_suffix,mysqlcppconn,cpp)) diff --git a/include/rtl/stringutils.hxx b/include/rtl/stringutils.hxx index 52ed1d02fdf6..1f1e53bcdacc 100644 --- a/include/rtl/stringutils.hxx +++ b/include/rtl/stringutils.hxx @@ -13,15 +13,11 @@ #include #include -// Manually defining RTL_DISABLE_FAST_STRING allows to force turning fast string concatenation off -// (e.g. for debugging). -#ifndef RTL_DISABLE_FAST_STRING // This feature is not part of public API and is meant to be used only internally by LibreOffice. #ifdef LIBO_INTERNAL_ONLY // Enable fast string concatenation. #define RTL_FAST_STRING #endif -#endif // The unittest uses slightly different code to help check that the proper // calls are made. The class is put into a different namespace to make diff --git a/mysqlc/Library_mysqlc.mk b/mysqlc/Library_mysqlc.mk index 656b5dc519d7..bc26eaf2ccd5 100644 --- a/mysqlc/Library_mysqlc.mk +++ b/mysqlc/Library_mysqlc.mk @@ -9,8 +9,6 @@ $(eval $(call gb_Library_Library,mysqlc)) -$(eval $(call gb_Library_add_cxxflags,mysqlc,-DRTL_DISABLE_FAST_STRING)) - $(eval $(call gb_Library_use_externals,mysqlc,\ boost_headers \ mysqlcppconn \ @@ -59,4 +57,6 @@ $(eval $(call gb_Library_add_exception_objects,mysqlc,\ $(eval $(call gb_Library_set_componentfile,mysqlc,mysqlc/source/mysqlc)) +$(eval $(call gb_Library_set_external_code,mysqlc)) + # vim: set noet sw=4 ts=4: diff --git a/odk/CppunitTest_odk_checkapi.mk b/odk/CppunitTest_odk_checkapi.mk index 8d2bf2fde882..3c4581477052 100644 --- a/odk/CppunitTest_odk_checkapi.mk +++ b/odk/CppunitTest_odk_checkapi.mk @@ -26,7 +26,6 @@ $(eval $(call gb_CppunitTest_use_internal_comprehensive_api,odk_checkapi,\ $(eval $(call gb_CppunitTest_disable_compiler_plugins,odk_checkapi)) $(eval $(call gb_CppunitTest_add_cxxflags,odk_checkapi,\ - $(gb_CXXFLAGS_Wundef) \ $(gb_CXX03FLAGS) \ )) @@ -38,4 +37,6 @@ $(eval $(call gb_CppunitTest_use_libraries,odk_checkapi,\ $(gb_UWINAPI) \ )) +$(eval $(call gb_CppunitTest_set_external_code,odk_checkapi)) + # vim: set noet sw=4 ts=4: diff --git a/odk/qa/checkapi/checkapi.cxx b/odk/qa/checkapi/checkapi.cxx index 67e11c6b2ea6..c76b4feec373 100644 --- a/odk/qa/checkapi/checkapi.cxx +++ b/odk/qa/checkapi/checkapi.cxx @@ -8,7 +8,9 @@ */ // Acts as if building outside of LO. -#undef LIBO_INTERNAL_ONLY +#ifdef LIBO_INTERNAL_ONLY +#error Build system problem, LIBO_INTERNAL_ONLY should not be set here. +#endif // The whole purpose of this test is to check that public API headers // build even without RTL_USING (which enables using e.g. rtl::OUString @@ -17,7 +19,7 @@ // for uses of such types. #ifdef RTL_USING -#error Build system problem, RTL_USING using should not be set here. +#error Build system problem, RTL_USING should not be set here. #endif // Additionally, check that public API headers build also with C++03. diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk index 47f1110d078b..dd535ae77974 100644 --- a/solenv/gbuild/CppunitTest.mk +++ b/solenv/gbuild/CppunitTest.mk @@ -385,6 +385,7 @@ $(eval $(foreach method,\ use_custom_headers \ set_visibility_default \ set_warnings_not_errors \ + set_external_code \ set_generated_cxx_suffix \ disable_compiler_plugins \ ,\ diff --git a/solenv/gbuild/Executable.mk b/solenv/gbuild/Executable.mk index 83298ad8dcfa..d45e2dc27964 100644 --- a/solenv/gbuild/Executable.mk +++ b/solenv/gbuild/Executable.mk @@ -138,6 +138,7 @@ $(eval $(foreach method,\ set_precompiled_header \ add_nativeres \ set_warnings_not_errors \ + set_external_code \ set_generated_cxx_suffix \ disable_compiler_plugins \ ,\ diff --git a/solenv/gbuild/Library.mk b/solenv/gbuild/Library.mk index 17135e5dcfd9..c66b57c1807a 100644 --- a/solenv/gbuild/Library.mk +++ b/solenv/gbuild/Library.mk @@ -223,6 +223,7 @@ $(eval $(foreach method,\ set_nativeres \ set_visibility_default \ set_warnings_not_errors \ + set_external_code \ set_generated_cxx_suffix \ disable_compiler_plugins \ ,\ diff --git a/solenv/gbuild/LinkTarget.mk b/solenv/gbuild/LinkTarget.mk index 948f65676a86..104c5b663e93 100644 --- a/solenv/gbuild/LinkTarget.mk +++ b/solenv/gbuild/LinkTarget.mk @@ -615,6 +615,7 @@ $(call gb_LinkTarget_get_target,$(1)) : EXTRAOBJECTLISTS := $(call gb_LinkTarget_get_target,$(1)) : NATIVERES := $(call gb_LinkTarget_get_target,$(1)) : VISIBILITY := $(call gb_LinkTarget_get_target,$(1)) : WARNINGS_NOT_ERRORS := +$(call gb_LinkTarget_get_target,$(1)) : EXTERNAL_CODE := $(call gb_LinkTarget_get_target,$(1)) : SOVERSIONSCRIPT := $(call gb_LinkTarget_get_target,$(1)) : T_COMPILER_PLUGINS := $$(COMPILER_PLUGINS) @@ -1369,6 +1370,12 @@ $(call gb_LinkTarget_get_target,$(1)) : WARNINGS_NOT_ERRORS := $(true) endef +# call gb_LinkTarget_set_external_code,linktarget +define gb_LinkTarget_set_external_code +$(call gb_LinkTarget_get_target,$(1)) : EXTERNAL_CODE := $(true) + +endef + # Set suffix of C++ files, if different from 'cxx' # # This is useful for external libraries. diff --git a/solenv/gbuild/StaticLibrary.mk b/solenv/gbuild/StaticLibrary.mk index a78a781fe563..a6e0795ecbe6 100644 --- a/solenv/gbuild/StaticLibrary.mk +++ b/solenv/gbuild/StaticLibrary.mk @@ -110,6 +110,7 @@ $(eval $(foreach method,\ add_sdi_headers \ set_precompiled_header \ set_warnings_not_errors \ + set_external_code \ set_generated_cxx_suffix \ disable_compiler_plugins \ ,\ diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk index fbf13fe0e064..3d1f0f1292ce 100644 --- a/solenv/gbuild/gbuild.mk +++ b/solenv/gbuild/gbuild.mk @@ -210,13 +210,6 @@ gb_GLOBALDEFS := \ $(gb_COMPILERDEFS) \ $(gb_CPUDEFS) \ -# This is used to detect whether LibreOffice is being built (as opposed to building -# 3rd-party code). Used for tag deprecation for API we want to -# ensure is not used at all externally while we clean -# out our internal usage, for code in sal/ that should be used only internally, etc. -gb_GLOBALDEFS += \ - -DLIBO_INTERNAL_ONLY \ - ifeq ($(gb_ENABLE_DBGUTIL),$(true)) gb_GLOBALDEFS += -DDBG_UTIL @@ -268,6 +261,13 @@ gb_GLOBALDEFS += \ gb_GLOBALDEFS := $(sort $(gb_GLOBALDEFS)) +# This is used to detect whether LibreOffice is being built (as opposed to building +# 3rd-party code). Used for tag deprecation for API we want to +# ensure is not used at all externally while we clean +# out our internal usage, for code in sal/ that should be used only internally, etc. +gb_DEFS_INTERNAL := \ + -DLIBO_INTERNAL_ONLY \ + include $(GBUILDDIR)/Deliver.mk $(eval $(call gb_Deliver_init)) diff --git a/solenv/gbuild/platform/com_GCC_class.mk b/solenv/gbuild/platform/com_GCC_class.mk index c7bf4b7bf668..59678bb394f7 100644 --- a/solenv/gbuild/platform/com_GCC_class.mk +++ b/solenv/gbuild/platform/com_GCC_class.mk @@ -54,6 +54,7 @@ $(call gb_Helper_abbreviate_dirs,\ $(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \ $(if $(5),$(gb_COMPILER_PLUGINS)) \ $(2) \ + $(if $(EXTERNAL_CODE),$(gb_CXXFLAGS_Wundef),$(gb_DEFS_INTERNAL)) \ -c $(3) \ -o $(1) \ $(call gb_cxx_dep_generation_options,$(1),$(4)) \ @@ -77,6 +78,7 @@ $(call gb_Helper_abbreviate_dirs,\ $(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \ $(gb_COMPILER_PLUGINS) \ $(T_CFLAGS) $(T_CFLAGS_APPEND) \ + $(if $(EXTERNAL_CODE),$(gb_CXXFLAGS_Wundef),$(gb_DEFS_INTERNAL)) \ -c $(2) \ -I$(dir $(2)) \ $(INCLUDE) \ @@ -93,6 +95,7 @@ $(call gb_Helper_abbreviate_dirs,\ $(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \ $(gb_COMPILER_PLUGINS) \ $(T_OBJCFLAGS) $(T_OBJCFLAGS_APPEND) \ + $(if $(EXTERNAL_CODE),$(gb_CXXFLAGS_Wundef),$(gb_DEFS_INTERNAL)) \ -c $(2) \ -I$(dir $(2)) \ $(INCLUDE) \ @@ -112,6 +115,7 @@ $(call gb_Helper_abbreviate_dirs,\ $(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \ $(gb_COMPILER_PLUGINS) \ $(T_CXXFLAGS) $(T_CXXFLAGS_APPEND) \ + $(if $(EXTERNAL_CODE),$(gb_CXXFLAGS_Wundef),$(gb_DEFS_INTERNAL)) \ -c $(2) \ -I$(dir $(2)) \ $(INCLUDE) \ @@ -128,6 +132,7 @@ $(call gb_Helper_abbreviate_dirs,\ $(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \ $(gb_COMPILER_PLUGINS) \ $(T_OBJCXXFLAGS) $(T_OBJCXXFLAGS_APPEND) \ + $(if $(EXTERNAL_CODE),$(gb_CXXFLAGS_Wundef),$(gb_DEFS_INTERNAL)) \ -c $(2) \ -I$(dir $(2)) \ $(INCLUDE) \ diff --git a/solenv/gbuild/platform/com_MSC_class.mk b/solenv/gbuild/platform/com_MSC_class.mk index 7d220c55ea3d..92b6e2b0362e 100644 --- a/solenv/gbuild/platform/com_MSC_class.mk +++ b/solenv/gbuild/platform/com_MSC_class.mk @@ -42,6 +42,7 @@ $(call gb_Helper_abbreviate_dirs,\ $(if $(filter YES,$(CXXOBJECT_X64)), $(CXX_X64_BINARY), \ $(if $(filter %.c,$(3)), $(gb_CC), $(gb_CXX))) \ $(DEFS) \ + $(if $(EXTERNAL_CODE),,$(gb_DEFS_INTERNAL)) \ $(gb_LTOFLAGS) \ $(2) \ $(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \