Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit90b47a2

Browse files
authored
Merge pull request#6846 from xmake-io/cmake
improve cmake default flags#6845
2 parentsbf90656 +4700738 commit90b47a2

File tree

1 file changed

+2
-26
lines changed

1 file changed

+2
-26
lines changed

‎xmake/modules/package/tools/cmake.lua‎

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -848,31 +848,7 @@ end
848848

849849
function_get_envs_for_default_flags(package,configs,opt)
850850
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 {}
876852
end
877853

878854
function_get_envs_for_runtime_flags(package,opt)
@@ -892,7 +868,7 @@ end
892868

893869
function_get_envs_for_flags(package,configs,opt)
894870
-- 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)
896872
localruntime_envs=_get_envs_for_runtime_flags(package,opt)
897873
ifruntime_envsthen
898874
forname,valueinpairs(runtime_envs)do

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp