|
848 | 848 |
|
849 | 849 | function_get_envs_for_default_flags(package,configs,opt) |
850 | 850 | localbuildtype=_get_cmake_buildtype(package) |
851 | | -localenvs= {} |
852 | | -localdefault_flags=_get_default_flags(package,configs,buildtype,opt) |
853 | | -ifdefault_flagsthen |
854 | | -ifnotopt.cxxflagsandnotopt.cxflagsthen |
855 | | -envs.CMAKE_CXX_FLAGS=default_flags.CMAKE_CXX_FLAGS |
856 | | -envs["CMAKE_CXX_FLAGS_"..buildtype]=default_flags["CMAKE_CXX_FLAGS_"..buildtype] |
857 | | -end |
858 | | -ifnotopt.cflagsandnotopt.cxflagsthen |
859 | | -envs.CMAKE_C_FLAGS=default_flags.CMAKE_C_FLAGS |
860 | | -envs["CMAKE_C_FLAGS_"..buildtype]=default_flags["CMAKE_C_FLAGS_"..buildtype] |
861 | | -end |
862 | | -ifnotopt.ldflagsthen |
863 | | -envs.CMAKE_EXE_LINKER_FLAGS=default_flags.CMAKE_EXE_LINKER_FLAGS |
864 | | -envs["CMAKE_EXE_LINKER_FLAGS_"..buildtype]=default_flags["CMAKE_EXE_LINKER_FLAGS_"..buildtype] |
865 | | -end |
866 | | -ifnotopt.arflagsthen |
867 | | -envs.CMAKE_STATIC_LINKER_FLAGS=default_flags.CMAKE_STATIC_LINKER_FLAGS |
868 | | -envs["CMAKE_STATIC_LINKER_FLAGS_"..buildtype]=default_flags["CMAKE_STATIC_LINKER_FLAGS_"..buildtype] |
869 | | -end |
870 | | -ifnotopt.shflagsthen |
871 | | -envs.CMAKE_SHARED_LINKER_FLAGS=default_flags.CMAKE_SHARED_LINKER_FLAGS |
872 | | -envs["CMAKE_SHARED_LINKER_FLAGS_"..buildtype]=default_flags["CMAKE_SHARED_LINKER_FLAGS_"..buildtype] |
873 | | -end |
874 | | -end |
875 | | -returnenvs |
| 851 | +returntable.clone(_get_default_flags(package,configs,buildtype,opt))or {} |
876 | 852 | end |
877 | 853 |
|
878 | 854 | function_get_envs_for_runtime_flags(package,opt) |
|
892 | 868 |
|
893 | 869 | function_get_envs_for_flags(package,configs,opt) |
894 | 870 | -- get the default envs |
895 | | -localenvs=_get_envs_for_default_flags(package,configs,opt)or {} |
| 871 | +localenvs=_get_envs_for_default_flags(package,configs,opt) |
896 | 872 | localruntime_envs=_get_envs_for_runtime_flags(package,opt) |
897 | 873 | ifruntime_envsthen |
898 | 874 | forname,valueinpairs(runtime_envs)do |
|