@@ -1218,14 +1218,6 @@ function _instance:has_runtime(...)
1218
1218
end
1219
1219
end
1220
1220
1221
- -- check call limits in on_load
1222
- -- @see https://github.com/xmake-io/xmake/issues/5455
1223
- function _instance :_check_limits_on_load (apiname )
1224
- if not self ._LOADED then
1225
- os .raise (" we cannot call package:%s() in on_load(), please call it in on_check/on_install/on_test." , apiname )
1226
- end
1227
- end
1228
-
1229
1221
-- get the given toolchain
1230
1222
function _instance :toolchain (name )
1231
1223
local toolchains_map = self :_memcache ():get (" toolchains_map" )
@@ -1271,7 +1263,6 @@ end
1271
1263
1272
1264
-- get the program and name of the given tool kind
1273
1265
function _instance :tool (toolkind )
1274
- self :_check_limits_on_load (" tool" )
1275
1266
if self :toolchains () then
1276
1267
local cachekey = " package_" .. tostring (self )
1277
1268
return toolchain .tool (self :toolchains (), toolkind , {cachekey = cachekey , plat = self :plat (), arch = self :arch ()})
@@ -1282,7 +1273,6 @@ end
1282
1273
1283
1274
-- get tool configuration from the toolchains
1284
1275
function _instance :toolconfig (name )
1285
- self :_check_limits_on_load (" toolconfig" )
1286
1276
if self :toolchains () then
1287
1277
local cachekey = " package_" .. tostring (self )
1288
1278
return toolchain .toolconfig (self :toolchains (), name , {cachekey = cachekey , plat = self :plat (), arch = self :arch ()})
@@ -1316,7 +1306,6 @@ end
1316
1306
-- ...
1317
1307
-- end
1318
1308
function _instance :has_tool (toolkind , ...)
1319
- self :_check_limits_on_load (" has_tool" )
1320
1309
local _ , toolname = self :tool (toolkind )
1321
1310
if toolname then
1322
1311
for _ , v in ipairs (table .join (... )) do
@@ -2447,7 +2436,6 @@ end
2447
2436
-- @return true or false, errors
2448
2437
--
2449
2438
function _instance :has_cfuncs (funcs , opt )
2450
- self :_check_limits_on_load (" has_cfuncs" )
2451
2439
opt = opt or {}
2452
2440
opt .target = self
2453
2441
opt .configs = self :_generate_build_configs (opt .configs , {sourcekind = " cc" })
@@ -2462,7 +2450,6 @@ end
2462
2450
-- @return true or false, errors
2463
2451
--
2464
2452
function _instance :has_cxxfuncs (funcs , opt )
2465
- self :_check_limits_on_load (" has_cxxfuncs" )
2466
2453
opt = opt or {}
2467
2454
opt .target = self
2468
2455
opt .configs = self :_generate_build_configs (opt .configs , {sourcekind = " cxx" })
@@ -2477,7 +2464,6 @@ end
2477
2464
-- @return true or false, errors
2478
2465
--
2479
2466
function _instance :has_ctypes (types , opt )
2480
- self :_check_limits_on_load (" has_ctypes" )
2481
2467
opt = opt or {}
2482
2468
opt .target = self
2483
2469
opt .configs = self :_generate_build_configs (opt .configs , {sourcekind = " cc" })
@@ -2492,7 +2478,6 @@ end
2492
2478
-- @return true or false, errors
2493
2479
--
2494
2480
function _instance :has_cxxtypes (types , opt )
2495
- self :_check_limits_on_load (" has_cxxtypes" )
2496
2481
opt = opt or {}
2497
2482
opt .target = self
2498
2483
opt .configs = self :_generate_build_configs (opt .configs , {sourcekind = " cxx" })
@@ -2507,7 +2492,6 @@ end
2507
2492
-- @return true or false, errors
2508
2493
--
2509
2494
function _instance :has_cincludes (includes , opt )
2510
- self :_check_limits_on_load (" has_cincludes" )
2511
2495
opt = opt or {}
2512
2496
opt .target = self
2513
2497
opt .configs = self :_generate_build_configs (opt .configs , {sourcekind = " cc" })
@@ -2522,7 +2506,6 @@ end
2522
2506
-- @return true or false, errors
2523
2507
--
2524
2508
function _instance :has_cxxincludes (includes , opt )
2525
- self :_check_limits_on_load (" has_cxxincludes" )
2526
2509
opt = opt or {}
2527
2510
opt .target = self
2528
2511
opt .configs = self :_generate_build_configs (opt .configs , {sourcekind = " cxx" })
@@ -2537,7 +2520,6 @@ end
2537
2520
-- @return true or false, errors
2538
2521
--
2539
2522
function _instance :has_cflags (flags , opt )
2540
- self :_check_limits_on_load (" has_cflags" )
2541
2523
local compinst = self :compiler (" cc" )
2542
2524
return compinst :has_flags (flags , " cflags" , opt )
2543
2525
end
@@ -2550,7 +2532,6 @@ end
2550
2532
-- @return true or false, errors
2551
2533
--
2552
2534
function _instance :has_cxxflags (flags , opt )
2553
- self :_check_limits_on_load (" has_cxxflags" )
2554
2535
local compinst = self :compiler (" cxx" )
2555
2536
return compinst :has_flags (flags , " cxxflags" , opt )
2556
2537
end
@@ -2563,7 +2544,6 @@ end
2563
2544
-- @return true or false, errors
2564
2545
--
2565
2546
function _instance :has_features (features , opt )
2566
- self :_check_limits_on_load (" has_features" )
2567
2547
opt = opt or {}
2568
2548
opt .target = self
2569
2549
return sandbox_module .import (" core.tool.compiler" , {anonymous = true }).has_features (features , opt )
@@ -2577,7 +2557,6 @@ end
2577
2557
-- @return the type size
2578
2558
--
2579
2559
function _instance :check_sizeof (typename , opt )
2580
- self :_check_limits_on_load (" check_sizeof" )
2581
2560
opt = opt or {}
2582
2561
opt .target = self
2583
2562
return sandbox_module .import (" lib.detect.check_sizeof" , {anonymous = true })(typename , opt )
@@ -2591,7 +2570,6 @@ end
2591
2570
-- @return true or false, errors
2592
2571
--
2593
2572
function _instance :check_csnippets (snippets , opt )
2594
- self :_check_limits_on_load (" check_csnippets" )
2595
2573
opt = opt or {}
2596
2574
opt .target = self
2597
2575
opt .configs = self :_generate_build_configs (opt .configs , {sourcekind = " cc" })
@@ -2606,7 +2584,6 @@ end
2606
2584
-- @return true or false, errors
2607
2585
--
2608
2586
function _instance :check_cxxsnippets (snippets , opt )
2609
- self :_check_limits_on_load (" check_cxxsnippets" )
2610
2587
opt = opt or {}
2611
2588
opt .target = self
2612
2589
opt .configs = self :_generate_build_configs (opt .configs , {sourcekind = " cxx" })
@@ -2621,7 +2598,6 @@ end
2621
2598
-- @return true or false, errors
2622
2599
--
2623
2600
function _instance :check_msnippets (snippets , opt )
2624
- self :_check_limits_on_load (" check_msnippets" )
2625
2601
opt = opt or {}
2626
2602
opt .target = self
2627
2603
opt .configs = self :_generate_build_configs (opt .configs , {sourcekind = " mm" })
@@ -2636,7 +2612,6 @@ end
2636
2612
-- @return true or false, errors
2637
2613
--
2638
2614
function _instance :check_mxxsnippets (snippets , opt )
2639
- self :_check_limits_on_load (" check_mxxsnippets" )
2640
2615
opt = opt or {}
2641
2616
opt .target = self
2642
2617
opt .configs = self :_generate_build_configs (opt .configs , {sourcekind = " mxx" })
0 commit comments