-
-
Notifications
You must be signed in to change notification settings - Fork 393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
make /utf-8
from fmt
public
#4657
Conversation
probably a good idea, since otherwise the flag would be lost on targets dependent on targets that have fmt
package cxflags, defines etc... public by default. |
funny that in https://github.com/SFGrenade/System_Simulator, adding https://github.com/SFGrenade/System_Simulator/blob/master/logger/xmake.lua#L15-L18 made all other parts build successfully |
It work for me: add_requires("spdlog", {configs = {fmt_external = true}})
target("test")
set_kind("shared")
add_files("src/main.cpp")
add_packages("spdlog")
|
for me the linked setup is basically: ./logger/xmake.lua:
add_requires( "spdlog" )
add_requireconfs( "spdlog", { configs = { fmt_external_ho = true } } )
target( "Logger" )
set_kind( "static" )
add_packages( "spdlog", { public = true } )
add_includedirs( "include", { public = true } )
add_headerfiles( "include/(*.h)" )
add_files( "src/*.cpp" )
./anything_else/xmake.lua:
target( "ActualProgram" )
set_kind( "binary" )
add_deps( "Logger", { public = true } )
add_includedirs( "include", { public = true } )
add_headerfiles( "include/(*.h)" )
add_files( "src/*.cpp" ) with which ./logger/xmake.lua:
add_requires( "spdlog" )
add_requireconfs( "spdlog", { configs = { fmt_external_ho = true } } )
target( "Logger" )
set_kind( "static" )
add_packages( "spdlog", { public = true } )
if is_plat( "windows" ) then -- this is extra
add_cxxflags( "/utf-8", { public = true } ) -- this is extra
end -- this is extra
add_includedirs( "include", { public = true } )
add_headerfiles( "include/(*.h)" )
add_files( "src/*.cpp" ) it compiled successfully |
@waruqi Any idea? |
@@ -52,7 +52,7 @@ package("fmt") | |||
end | |||
end | |||
if package:is_plat("windows") and package:config("unicode") then | |||
package:add("cxxflags", "/utf-8") | |||
package:add("cxxflags", "/utf-8", {public = true}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
package:add does not {public}
, only target supports it.
Currently, only abstract interfaces support exporting from a package to a parent target. e.g. but add_cxflags, add_ldflags do not support now. |
probably a good idea, since otherwise the flag would be lost on targets dependent on targets that have fmt