Kaydet (Commit) 86ba1843 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Introduce gb_*_set_external_code

...to harmonize the mechanisms to not define LIBO_INTERNAL_ONLY for extension
code and CppunitTest_odk_checkapi.  (It also needs to revert any -Wundef, as the
config_host/config_*.h files will not be included, so the HAVE_* macros will be
undefined.)

This obsoletes the need for RTL_DISABLE_FAST_STRING.

Change-Id: If5eacba80c349efb90762aade8f2ea6d2db7e314
üst 1cd94207
...@@ -13,6 +13,8 @@ $(eval $(call gb_Library_add_exception_objects,active_native, \ ...@@ -13,6 +13,8 @@ $(eval $(call gb_Library_add_exception_objects,active_native, \
desktop/test/deployment/active/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, \ $(eval $(call gb_Library_use_externals,active_native, \
boost_headers \ boost_headers \
)) ))
......
...@@ -15,6 +15,8 @@ $(eval $(call gb_Library_add_exception_objects,passive_native, \ ...@@ -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_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, \ $(eval $(call gb_Library_use_externals,passive_native, \
boost_headers \ boost_headers \
)) ))
......
...@@ -32,6 +32,8 @@ $(eval $(call gb_Library_use_externals,mysqlcppconn,\ ...@@ -32,6 +32,8 @@ $(eval $(call gb_Library_use_externals,mysqlcppconn,\
endif endif
endif endif
$(eval $(call gb_Library_set_external_code,mysqlcppconn))
$(eval $(call gb_Library_set_warnings_not_errors,mysqlcppconn)) $(eval $(call gb_Library_set_warnings_not_errors,mysqlcppconn))
$(eval $(call gb_Library_set_generated_cxx_suffix,mysqlcppconn,cpp)) $(eval $(call gb_Library_set_generated_cxx_suffix,mysqlcppconn,cpp))
......
...@@ -13,15 +13,11 @@ ...@@ -13,15 +13,11 @@
#include <sal/config.h> #include <sal/config.h>
#include <sal/types.h> #include <sal/types.h>
// 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. // This feature is not part of public API and is meant to be used only internally by LibreOffice.
#ifdef LIBO_INTERNAL_ONLY #ifdef LIBO_INTERNAL_ONLY
// Enable fast string concatenation. // Enable fast string concatenation.
#define RTL_FAST_STRING #define RTL_FAST_STRING
#endif #endif
#endif
// The unittest uses slightly different code to help check that the proper // 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 // calls are made. The class is put into a different namespace to make
......
...@@ -9,8 +9,6 @@ ...@@ -9,8 +9,6 @@
$(eval $(call gb_Library_Library,mysqlc)) $(eval $(call gb_Library_Library,mysqlc))
$(eval $(call gb_Library_add_cxxflags,mysqlc,-DRTL_DISABLE_FAST_STRING))
$(eval $(call gb_Library_use_externals,mysqlc,\ $(eval $(call gb_Library_use_externals,mysqlc,\
boost_headers \ boost_headers \
mysqlcppconn \ mysqlcppconn \
...@@ -59,4 +57,6 @@ $(eval $(call gb_Library_add_exception_objects,mysqlc,\ ...@@ -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_componentfile,mysqlc,mysqlc/source/mysqlc))
$(eval $(call gb_Library_set_external_code,mysqlc))
# vim: set noet sw=4 ts=4: # vim: set noet sw=4 ts=4:
...@@ -26,7 +26,6 @@ $(eval $(call gb_CppunitTest_use_internal_comprehensive_api,odk_checkapi,\ ...@@ -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_disable_compiler_plugins,odk_checkapi))
$(eval $(call gb_CppunitTest_add_cxxflags,odk_checkapi,\ $(eval $(call gb_CppunitTest_add_cxxflags,odk_checkapi,\
$(gb_CXXFLAGS_Wundef) \
$(gb_CXX03FLAGS) \ $(gb_CXX03FLAGS) \
)) ))
...@@ -38,4 +37,6 @@ $(eval $(call gb_CppunitTest_use_libraries,odk_checkapi,\ ...@@ -38,4 +37,6 @@ $(eval $(call gb_CppunitTest_use_libraries,odk_checkapi,\
$(gb_UWINAPI) \ $(gb_UWINAPI) \
)) ))
$(eval $(call gb_CppunitTest_set_external_code,odk_checkapi))
# vim: set noet sw=4 ts=4: # vim: set noet sw=4 ts=4:
...@@ -8,7 +8,9 @@ ...@@ -8,7 +8,9 @@
*/ */
// Acts as if building outside of LO. // 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 // 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 // build even without RTL_USING (which enables using e.g. rtl::OUString
...@@ -17,7 +19,7 @@ ...@@ -17,7 +19,7 @@
// for uses of such types. // for uses of such types.
#ifdef RTL_USING #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 #endif
// Additionally, check that public API headers build also with C++03. // Additionally, check that public API headers build also with C++03.
......
...@@ -385,6 +385,7 @@ $(eval $(foreach method,\ ...@@ -385,6 +385,7 @@ $(eval $(foreach method,\
use_custom_headers \ use_custom_headers \
set_visibility_default \ set_visibility_default \
set_warnings_not_errors \ set_warnings_not_errors \
set_external_code \
set_generated_cxx_suffix \ set_generated_cxx_suffix \
disable_compiler_plugins \ disable_compiler_plugins \
,\ ,\
......
...@@ -138,6 +138,7 @@ $(eval $(foreach method,\ ...@@ -138,6 +138,7 @@ $(eval $(foreach method,\
set_precompiled_header \ set_precompiled_header \
add_nativeres \ add_nativeres \
set_warnings_not_errors \ set_warnings_not_errors \
set_external_code \
set_generated_cxx_suffix \ set_generated_cxx_suffix \
disable_compiler_plugins \ disable_compiler_plugins \
,\ ,\
......
...@@ -223,6 +223,7 @@ $(eval $(foreach method,\ ...@@ -223,6 +223,7 @@ $(eval $(foreach method,\
set_nativeres \ set_nativeres \
set_visibility_default \ set_visibility_default \
set_warnings_not_errors \ set_warnings_not_errors \
set_external_code \
set_generated_cxx_suffix \ set_generated_cxx_suffix \
disable_compiler_plugins \ disable_compiler_plugins \
,\ ,\
......
...@@ -615,6 +615,7 @@ $(call gb_LinkTarget_get_target,$(1)) : EXTRAOBJECTLISTS := ...@@ -615,6 +615,7 @@ $(call gb_LinkTarget_get_target,$(1)) : EXTRAOBJECTLISTS :=
$(call gb_LinkTarget_get_target,$(1)) : NATIVERES := $(call gb_LinkTarget_get_target,$(1)) : NATIVERES :=
$(call gb_LinkTarget_get_target,$(1)) : VISIBILITY := $(call gb_LinkTarget_get_target,$(1)) : VISIBILITY :=
$(call gb_LinkTarget_get_target,$(1)) : WARNINGS_NOT_ERRORS := $(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)) : SOVERSIONSCRIPT :=
$(call gb_LinkTarget_get_target,$(1)) : T_COMPILER_PLUGINS := $$(COMPILER_PLUGINS) $(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) ...@@ -1369,6 +1370,12 @@ $(call gb_LinkTarget_get_target,$(1)) : WARNINGS_NOT_ERRORS := $(true)
endef 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' # Set suffix of C++ files, if different from 'cxx'
# #
# This is useful for external libraries. # This is useful for external libraries.
......
...@@ -110,6 +110,7 @@ $(eval $(foreach method,\ ...@@ -110,6 +110,7 @@ $(eval $(foreach method,\
add_sdi_headers \ add_sdi_headers \
set_precompiled_header \ set_precompiled_header \
set_warnings_not_errors \ set_warnings_not_errors \
set_external_code \
set_generated_cxx_suffix \ set_generated_cxx_suffix \
disable_compiler_plugins \ disable_compiler_plugins \
,\ ,\
......
...@@ -210,13 +210,6 @@ gb_GLOBALDEFS := \ ...@@ -210,13 +210,6 @@ gb_GLOBALDEFS := \
$(gb_COMPILERDEFS) \ $(gb_COMPILERDEFS) \
$(gb_CPUDEFS) \ $(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)) ifeq ($(gb_ENABLE_DBGUTIL),$(true))
gb_GLOBALDEFS += -DDBG_UTIL gb_GLOBALDEFS += -DDBG_UTIL
...@@ -268,6 +261,13 @@ gb_GLOBALDEFS += \ ...@@ -268,6 +261,13 @@ gb_GLOBALDEFS += \
gb_GLOBALDEFS := $(sort $(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 include $(GBUILDDIR)/Deliver.mk
$(eval $(call gb_Deliver_init)) $(eval $(call gb_Deliver_init))
......
...@@ -54,6 +54,7 @@ $(call gb_Helper_abbreviate_dirs,\ ...@@ -54,6 +54,7 @@ $(call gb_Helper_abbreviate_dirs,\
$(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \ $(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \
$(if $(5),$(gb_COMPILER_PLUGINS)) \ $(if $(5),$(gb_COMPILER_PLUGINS)) \
$(2) \ $(2) \
$(if $(EXTERNAL_CODE),$(gb_CXXFLAGS_Wundef),$(gb_DEFS_INTERNAL)) \
-c $(3) \ -c $(3) \
-o $(1) \ -o $(1) \
$(call gb_cxx_dep_generation_options,$(1),$(4)) \ $(call gb_cxx_dep_generation_options,$(1),$(4)) \
...@@ -77,6 +78,7 @@ $(call gb_Helper_abbreviate_dirs,\ ...@@ -77,6 +78,7 @@ $(call gb_Helper_abbreviate_dirs,\
$(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \ $(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \
$(gb_COMPILER_PLUGINS) \ $(gb_COMPILER_PLUGINS) \
$(T_CFLAGS) $(T_CFLAGS_APPEND) \ $(T_CFLAGS) $(T_CFLAGS_APPEND) \
$(if $(EXTERNAL_CODE),$(gb_CXXFLAGS_Wundef),$(gb_DEFS_INTERNAL)) \
-c $(2) \ -c $(2) \
-I$(dir $(2)) \ -I$(dir $(2)) \
$(INCLUDE) \ $(INCLUDE) \
...@@ -93,6 +95,7 @@ $(call gb_Helper_abbreviate_dirs,\ ...@@ -93,6 +95,7 @@ $(call gb_Helper_abbreviate_dirs,\
$(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \ $(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \
$(gb_COMPILER_PLUGINS) \ $(gb_COMPILER_PLUGINS) \
$(T_OBJCFLAGS) $(T_OBJCFLAGS_APPEND) \ $(T_OBJCFLAGS) $(T_OBJCFLAGS_APPEND) \
$(if $(EXTERNAL_CODE),$(gb_CXXFLAGS_Wundef),$(gb_DEFS_INTERNAL)) \
-c $(2) \ -c $(2) \
-I$(dir $(2)) \ -I$(dir $(2)) \
$(INCLUDE) \ $(INCLUDE) \
...@@ -112,6 +115,7 @@ $(call gb_Helper_abbreviate_dirs,\ ...@@ -112,6 +115,7 @@ $(call gb_Helper_abbreviate_dirs,\
$(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \ $(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \
$(gb_COMPILER_PLUGINS) \ $(gb_COMPILER_PLUGINS) \
$(T_CXXFLAGS) $(T_CXXFLAGS_APPEND) \ $(T_CXXFLAGS) $(T_CXXFLAGS_APPEND) \
$(if $(EXTERNAL_CODE),$(gb_CXXFLAGS_Wundef),$(gb_DEFS_INTERNAL)) \
-c $(2) \ -c $(2) \
-I$(dir $(2)) \ -I$(dir $(2)) \
$(INCLUDE) \ $(INCLUDE) \
...@@ -128,6 +132,7 @@ $(call gb_Helper_abbreviate_dirs,\ ...@@ -128,6 +132,7 @@ $(call gb_Helper_abbreviate_dirs,\
$(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \ $(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \
$(gb_COMPILER_PLUGINS) \ $(gb_COMPILER_PLUGINS) \
$(T_OBJCXXFLAGS) $(T_OBJCXXFLAGS_APPEND) \ $(T_OBJCXXFLAGS) $(T_OBJCXXFLAGS_APPEND) \
$(if $(EXTERNAL_CODE),$(gb_CXXFLAGS_Wundef),$(gb_DEFS_INTERNAL)) \
-c $(2) \ -c $(2) \
-I$(dir $(2)) \ -I$(dir $(2)) \
$(INCLUDE) \ $(INCLUDE) \
......
...@@ -42,6 +42,7 @@ $(call gb_Helper_abbreviate_dirs,\ ...@@ -42,6 +42,7 @@ $(call gb_Helper_abbreviate_dirs,\
$(if $(filter YES,$(CXXOBJECT_X64)), $(CXX_X64_BINARY), \ $(if $(filter YES,$(CXXOBJECT_X64)), $(CXX_X64_BINARY), \
$(if $(filter %.c,$(3)), $(gb_CC), $(gb_CXX))) \ $(if $(filter %.c,$(3)), $(gb_CC), $(gb_CXX))) \
$(DEFS) \ $(DEFS) \
$(if $(EXTERNAL_CODE),,$(gb_DEFS_INTERNAL)) \
$(gb_LTOFLAGS) \ $(gb_LTOFLAGS) \
$(2) \ $(2) \
$(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \ $(if $(WARNINGS_NOT_ERRORS),,$(gb_CFLAGS_WERROR)) \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment