Skip to content

Commit

Permalink
Windows: parametrize number of CPUs for parallel builds with CPU_COUN…
Browse files Browse the repository at this point in the history
…T variable (#1922)
  • Loading branch information
hobu authored and rouault committed Oct 14, 2019
1 parent fd48b27 commit 0cb59e2
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions gdal/nmake.opt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@
MSVC_VER=1900
!ENDIF

###############################################################################
# Allow setting of parallel compilation number of processors with CPU_COUNT
# variable

!IFNDEF CPU_COUNT
CPU_COUNT=%NUMBER_OF_PROCESSORS%
!ENDIF

###############################################################################
# Optional use of Visual Leak Detector (VLD) by Dan Moulding, available at
# http://vld.codeplex.com/
Expand Down Expand Up @@ -134,9 +142,9 @@ CXX_PDB_FLAGS=

!IFNDEF OPTFLAGS
!IF "$(DEBUG)" == "0"
OPTFLAGS= $(CXX_ANALYZE_FLAGS) $(CXX_PDB_FLAGS) /nologo /MP /MD /EHsc /Ox /FC /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /DNDEBUG
OPTFLAGS= $(CXX_ANALYZE_FLAGS) $(CXX_PDB_FLAGS) /nologo /MP$(CPU_COUNT) /MD /EHsc /Ox /FC /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /DNDEBUG
!ELSE
OPTFLAGS= $(CXX_ANALYZE_FLAGS) $(CXX_PDB_FLAGS) /nologo /MP /MD /EHsc /FC /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /DDEBUG
OPTFLAGS= $(CXX_ANALYZE_FLAGS) $(CXX_PDB_FLAGS) /nologo /MP$(CPU_COUNT) /MD /EHsc /FC /D_CRT_SECURE_NO_DEPRECATE /D_CRT_NONSTDC_NO_DEPRECATE /DDEBUG
!ENDIF
!ENDIF # OPTFLAGS

Expand Down

0 comments on commit 0cb59e2

Please sign in to comment.