scripts/: minor changes.
authorJulian Smith <[email protected]>
Fri, 6 Oct 2023 13:19:25 +0000 (14:19 +0100)
committerSebastian Rasmussen <[email protected]>
Thu, 2 Nov 2023 12:07:51 +0000 (13:07 +0100)
scripts/jlib.py:build(): show change to command.

scripts/wrap/cpp.py: reinit_singlethreaded(): disable diagnostic as it isn't
necessary.

scripts/wrap/__main__.py: use make -j by default. We now default to `make -j N`
where `N` is the number of cpus, from Python's multiprocessing.cpu_count().

scripts/jlib.py
scripts/wrap/__main__.py
scripts/wrap/cpp.py

index ff1b5ad2ec86cf400192083afad243b5950f4b35..a6ded32f7344d501d314e7a962ea7fd51597b95a 100644 (file)
@@ -2178,7 +2178,7 @@ def build(
         except Exception:
             command0 = None
         if command != command0:
-           reasons.append( 'command has changed')
+           reasons.append( f'command has changed: {command0!r} => {command!r}')
 
     if not reasons or all_reasons:
         reason = fs_any_newer( infiles, outfiles)
index bc9746d2eb574dad809240a85ccc82e61a749ad2..10741417ead4d719e5b4f706e19ee13609c8e30b 100644 (file)
@@ -1194,7 +1194,7 @@ def _get_m_command( build_dirs, j=None):
         make = 'CXX=clang++ gmake'
 
     if j is not None:
-        if j == '0':
+        if j == 0:
             j = multiprocessing.cpu_count()
             jlib.log('Setting -j to  multiprocessing.cpu_count()={j}')
         make += f' -j {j}'
@@ -1469,7 +1469,7 @@ def build( build_dirs, swig_command, args, vs_upgrade):
     clang_info_verbose = False
     force_rebuild = False
     header_git = False
-    j = None
+    j = 0
     refcheck_if = '#ifndef NDEBUG'
     wasm = os.environ.get('OS') in ('wasm', 'wasm-mt')
     if wasm:
@@ -1520,7 +1520,7 @@ def build( build_dirs, swig_command, args, vs_upgrade):
             if not state.state_.windows:
                 jlib.log( 'Warning: --devenv was specified, but we are not on Windows so this will have no effect.')
         elif actions == '-j':
-            j = args.next()
+            j = int(args.next())
         elif actions == '--python':
             build_python = True
             build_csharp = False
index 463a48c7077078a020bf6dab9d38839ff620c349..d3e588e8d84c771f0223cfb4ca512a68c9112236 100644 (file)
@@ -1359,7 +1359,10 @@ def make_internal_functions( namespace, out_h, out_cpp, refcheck_if):
 
             FZ_FUNCTION void reinit_singlethreaded()
             {{
-                std::cerr << __FILE__ << ":" << __LINE__ << ":" << __FUNCTION__ << "(): Reinitialising as single-threaded.\\n";
+                if (0)
+                {{
+                    std::cerr << __FILE__ << ":" << __LINE__ << ":" << __FUNCTION__ << "(): Reinitialising as single-threaded.\\n";
+                }}
                 s_state.reinit( false /*multithreaded*/);
             }}
             ''')