1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- add_rules("mode.debug", "mode.release")
- add_includedirs("include", {public = true})
- -- ENABLE_INTEL_RDRAND
- option("ENABLE_INTEL_RDRAND")
- set_default(false)
- set_showmenu(true)
- set_description("Enable Intel RDRAND")
- -- ENABLE_SM4_AESNI_AVX
- option("ENABLE_SM4_AESNI_AVX")
- set_default(false)
- set_showmenu(true)
- set_description("Enable SM4 AESNI AVX")
- target("gmssl")
- set_kind("static")
- set_languages("c11", "c++17")
- add_files(
- "src/*.c" ..
- "|rand_win.c|rand_apple.c|rand_unix.c|http_win.c|http.c" ..
- "|gf128_avx.c|rdrand.c|sm3_x8_avx2.c|sm4_aesni_avx.c|sm4_cl.c",
- "src/skf/*.c",
- "src/sdf/*.c"
- )
- if is_host("windows") then
- add_files("src/rand_win.c", "src/http_win.c")
- elseif is_host("macosx") then
- add_files("src/rand_apple.c", "src/http.c")
- elseif is_host("linux") then
- add_files("src/rand_unix.c", "src/http.c")
- else
- add_files("src/rand.c", "src/http.c")
- end
- if has_config("ENABLE_INTEL_RDRAND") then
- add_files("src/rdrand.c")
- end
- if has_config("ENABLE_SM4_AESNI_AVX") then
- add_files("src/sm4_aesni_avx.c")
- end
- add_syslinks("pthread", "dl", "rt")
- add_rpathdirs("$ORIGIN")
- add_rpathdirs("$ORIGIN/../lib")
- if is_host("linux") then
- add_cxflags("-fPIC", "-fexceptions")
- add_ldflags("-fPIC", "-fexceptions")
- end
- target_end()
|