Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion docs/maintainers/vcpkg_configure_make.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ vcpkg_configure_make(
[OPTIONS <-DUSE_THIS_IN_ALL_BUILDS=1>...]
[OPTIONS_RELEASE <-DOPTIMIZE=1>...]
[OPTIONS_DEBUG <-DDEBUGGABLE=1>...]
[MAKE_OPTIONS <-DUSE_THIS_IN_ALL_BUILDS=1>...]
[MAKE_OPTIONS_RELEASE <-DOPTIMIZE=1>...]
[MAKE_OPTIONS_DEBUG <-DDEBUGGABLE=1>...]
[MAKE_INSTALL_OPTIONS <-DUSE_THIS_IN_ALL_BUILDS=1>...]
[MAKE_INSTALL_OPTIONS_RELEASE <-DOPTIMIZE=1>...]
[MAKE_INSTALL_OPTIONS_DEBUG <-DDEBUGGABLE=1>...]
)
```

Expand Down Expand Up @@ -64,6 +70,24 @@ Additional options passed to configure during the Release configuration. These a
### OPTIONS_DEBUG
Additional options passed to configure during the Debug configuration. These are in addition to `OPTIONS`.

### MAKE_OPTIONS
Additional options passed to make during the generation.

### MAKE_OPTIONS_RELEASE
Additional options passed to make during the Release generation. These are in addition to `MAKE_OPTIONS`.

### MAKE_OPTIONS_DEBUG
Additional options passed to make during the Debug generation. These are in addition to `MAKE_OPTIONS`.

### MAKE_INSTALL_OPTIONS
Additional options passed to make during the installation.

### MAKE_INSTALL_OPTIONS_RELEASE
Additional options passed to make during the Release installation. These are in addition to `MAKE_INSTALL_OPTIONS`.

### MAKE_INSTALL_OPTIONS_DEBUG
Additional options passed to make during the Debug installation. These are in addition to `MAKE_INSTALL_OPTIONS`.

## Notes
This command supplies many common arguments to configure. To see the full list, examine the source.

Expand All @@ -75,4 +99,4 @@ This command supplies many common arguments to configure. To see the full list,
* [libosip2](https://github.com/Microsoft/vcpkg/blob/master/ports/libosip2/portfile.cmake)

## Source
[scripts/cmake/vcpkg_configure_make.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_configure_make.cmake)
[scripts/cmake/vcpkg_configure_make.cmake](https://github.com/Microsoft/vcpkg/blob/master/scripts/cmake/vcpkg_configure_make.cmake)
50 changes: 42 additions & 8 deletions scripts/cmake/vcpkg_build_make.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
function(vcpkg_build_make)
cmake_parse_arguments(_bc "ADD_BIN_TO_PATH;ENABLE_INSTALL" "LOGFILE_ROOT" "" ${ARGN})

if (_VCPKG_MAKE_OPTIONS_DEBUG STREQUAL _VCPKG_MAKE_OPTIONS_RELEASE OR _VCPKG_MAKE_INSTALL_OPTIONS_DEBUG STREQUAL _VCPKG_MAKE_INSTALL_OPTIONS_RELEASE)
Comment thread
SeekingMeaning marked this conversation as resolved.
Outdated
message(FATAL_ERROR "Detected debug configuration is equal to release configuration, please use NO_DEBUG for vcpkg_configure_make")
endif()

if(NOT _bc_LOGFILE_ROOT)
set(_bc_LOGFILE_ROOT "build")
endif()
Expand All @@ -37,8 +41,8 @@ function(vcpkg_build_make)
endif()

set(MAKE )
set(MAKE_OPTS )
set(INSTALL_OPTS )
set(MAKE_OPTS_BASE )
set(INSTALL_OPTS_BASE )
if (_VCPKG_MAKE_GENERATOR STREQUAL "make")
if (CMAKE_HOST_WIN32)
# Compiler requriements
Expand All @@ -54,15 +58,19 @@ function(vcpkg_build_make)
# Set make command and install command
set(MAKE ${BASH} --noprofile --norc -c "${_VCPKG_PROJECT_SUBPATH}make")
# Must use absolute path to call make in windows
set(MAKE_OPTS -j ${VCPKG_CONCURRENCY})
set(INSTALL_OPTS install -j ${VCPKG_CONCURRENCY})
set(MAKE_OPTS_BASE -j ${VCPKG_CONCURRENCY})
set(MAKE_OPTS_BASE ${MAKE_OPTS_BASE} ${_VCPKG_MAKE_OPTIONS})
set(INSTALL_OPTS_BASE install -j ${VCPKG_CONCURRENCY})
set(INSTALL_OPTS_BASE ${INSTALL_OPTS_BASE} ${_VCPKG_MAKE_INSTALL_OPTIONS})
else()
# Compiler requriements
find_program(MAKE make REQUIRED)
set(MAKE make;)
# Set make command and install command
set(MAKE_OPTS -j;${VCPKG_CONCURRENCY})
set(INSTALL_OPTS install;-j;${VCPKG_CONCURRENCY})
set(MAKE_OPTS_BASE -j;${VCPKG_CONCURRENCY})
set(MAKE_OPTS_BASE ${MAKE_OPTS_BASE};${_VCPKG_MAKE_OPTIONS})
Comment thread
SeekingMeaning marked this conversation as resolved.
Outdated
set(INSTALL_OPTS_BASE install;-j;${VCPKG_CONCURRENCY})
set(INSTALL_OPTS_BASE ${INSTALL_OPTS_BASE};${_VCPKG_MAKE_INSTALL_OPTIONS})
endif()
elseif (_VCPKG_MAKE_GENERATOR STREQUAL "nmake")
find_program(NMAKE nmake REQUIRED)
Expand All @@ -72,8 +80,10 @@ function(vcpkg_build_make)
set(ENV{CL} "$ENV{CL} /MP")
# Set make command and install command
set(MAKE ${NMAKE} /NOLOGO /G /U)
set(MAKE_OPTS -f makefile all)
set(INSTALL_OPTS install)
set(MAKE_OPTS_BASE -f makefile all)
set(MAKE_OPTS_BASE ${MAKE_OPTS_BASE} ${_VCPKG_MAKE_OPTIONS})
Comment thread
SeekingMeaning marked this conversation as resolved.
Outdated
set(INSTALL_OPTS_BASE install)
set(INSTALL_OPTS_BASE ${INSTALL_OPTS_BASE} ${_VCPKG_MAKE_INSTALL_OPTIONS})
else()
message(FATAL_ERROR "${_VCPKG_MAKE_GENERATOR} not supported.")
endif()
Expand All @@ -88,13 +98,25 @@ function(vcpkg_build_make)
continue()
endif()
set(SHORT_BUILDTYPE "-dbg")
# Add options
if (CMAKE_HOST_WIN32)
set(MAKE_OPTS ${MAKE_OPTS_BASE} ${_VCPKG_MAKE_OPTIONS_DEBUG})
else()
set(MAKE_OPTS ${MAKE_OPTS_BASE};${_VCPKG_MAKE_OPTIONS_DEBUG})
Comment thread
SeekingMeaning marked this conversation as resolved.
Outdated
endif()
else()
# In NO_DEBUG mode, we only use ${TARGET_TRIPLET} directory.
if (_VCPKG_NO_DEBUG)
set(SHORT_BUILDTYPE "")
else()
set(SHORT_BUILDTYPE "-rel")
endif()
# Add options
if (CMAKE_HOST_WIN32)
set(MAKE_OPTS ${MAKE_OPTS_BASE} ${_VCPKG_MAKE_OPTIONS_RELEASE})
else()
set(MAKE_OPTS ${MAKE_OPTS_BASE};${_VCPKG_MAKE_OPTIONS_RELEASE})
endif()
endif()

if (CMAKE_HOST_WIN32)
Expand Down Expand Up @@ -148,13 +170,25 @@ function(vcpkg_build_make)
continue()
endif()
set(SHORT_BUILDTYPE "-dbg")
# Add options
if (CMAKE_HOST_WIN32)
set(INSTALL_OPTS ${INSTALL_OPTS_BASE} ${_VCPKG_MAKE_INSTALL_OPTIONS_DEBUG})
else()
set(INSTALL_OPTS ${INSTALL_OPTS_BASE};${_VCPKG_MAKE_INSTALL_OPTIONS_DEBUG})
endif()
else()
# In NO_DEBUG mode, we only use ${TARGET_TRIPLET} directory.
if (_VCPKG_NO_DEBUG)
set(SHORT_BUILDTYPE "")
else()
set(SHORT_BUILDTYPE "-rel")
endif()
# Add options
if (CMAKE_HOST_WIN32)
set(INSTALL_OPTS ${INSTALL_OPTS_BASE} ${_VCPKG_MAKE_INSTALL_OPTIONS_RELEASE})
else()
set(INSTALL_OPTS ${INSTALL_OPTS_BASE};${_VCPKG_MAKE_INSTALL_OPTIONS_RELEASE})
endif()
endif()

message(STATUS "Installing ${TARGET_TRIPLET}${SHORT_BUILDTYPE}")
Expand Down
32 changes: 31 additions & 1 deletion scripts/cmake/vcpkg_configure_make.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
## [OPTIONS <-DUSE_THIS_IN_ALL_BUILDS=1>...]
## [OPTIONS_RELEASE <-DOPTIMIZE=1>...]
## [OPTIONS_DEBUG <-DDEBUGGABLE=1>...]
## [MAKE_OPTIONS <-DUSE_THIS_IN_ALL_BUILDS=1>...]
## [MAKE_OPTIONS_RELEASE <-DOPTIMIZE=1>...]
## [MAKE_OPTIONS_DEBUG <-DDEBUGGABLE=1>...]
## [MAKE_INSTALL_OPTIONS <-DUSE_THIS_IN_ALL_BUILDS=1>...]
## [MAKE_INSTALL_OPTIONS_RELEASE <-DOPTIMIZE=1>...]
## [MAKE_INSTALL_OPTIONS_DEBUG <-DDEBUGGABLE=1>...]
## )
## ```
##
Expand Down Expand Up @@ -64,6 +70,24 @@
## ### OPTIONS_DEBUG
## Additional options passed to configure during the Debug configuration. These are in addition to `OPTIONS`.
##
## ### MAKE_OPTIONS
## Additional options passed to make during the generation.
##
## ### MAKE_OPTIONS_RELEASE
## Additional options passed to make during the Release generation. These are in addition to `MAKE_OPTIONS`.
##
## ### MAKE_OPTIONS_DEBUG
## Additional options passed to make during the Debug generation. These are in addition to `MAKE_OPTIONS`.
##
## ### MAKE_INSTALL_OPTIONS
## Additional options passed to make during the installation.
##
## ### MAKE_INSTALL_OPTIONS_RELEASE
## Additional options passed to make during the Release installation. These are in addition to `MAKE_INSTALL_OPTIONS`.
##
## ### MAKE_INSTALL_OPTIONS_DEBUG
## Additional options passed to make during the Debug installation. These are in addition to `MAKE_INSTALL_OPTIONS`.
##
## ## Notes
## This command supplies many common arguments to configure. To see the full list, examine the source.
##
Expand All @@ -77,7 +101,7 @@ function(vcpkg_configure_make)
cmake_parse_arguments(_csc
"AUTOCONFIG;DISABLE_AUTO_HOST;DISABLE_AUTO_DST;NO_DEBUG;SKIP_CONFIGURE"
"SOURCE_PATH;PROJECT_SUBPATH;GENERATOR;PRERUN_SHELL"
"OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE"
"OPTIONS;OPTIONS_DEBUG;OPTIONS_RELEASE;MAKE_OPTIONS;MAKE_OPTIONS_DEBUG;MAKE_OPTIONS_RELEASE;MAKE_INSTALL_OPTIONS;MAKE_INSTALL_OPTIONS_DEBUG;MAKE_INSTALL_OPTIONS_RELEASE"
Comment thread
SeekingMeaning marked this conversation as resolved.
Outdated
${ARGN}
)

Expand Down Expand Up @@ -369,4 +393,10 @@ function(vcpkg_configure_make)
set(_VCPKG_NO_DEBUG ${_csc_NO_DEBUG} PARENT_SCOPE)
SET(_VCPKG_PROJECT_SOURCE_PATH ${_csc_SOURCE_PATH} PARENT_SCOPE)
set(_VCPKG_PROJECT_SUBPATH ${_csc_PROJECT_SUBPATH} PARENT_SCOPE)
set(_VCPKG_MAKE_OPTIONS ${_csc_MAKE_OPTIONS} PARENT_SCOPE)
set(_VCPKG_MAKE_OPTIONS_DEBUG ${_csc_MAKE_OPTIONS_DEBUG} PARENT_SCOPE)
set(_VCPKG_MAKE_OPTIONS_RELEASE ${_csc_MAKE_OPTIONS_RELEASE} PARENT_SCOPE)
set(_VCPKG_MAKE_INSTALL_OPTIONS ${_csc_MAKE_INSTALL_OPTIONS} PARENT_SCOPE)
set(_VCPKG_MAKE_INSTALL_OPTIONS_DEBUG ${_csc_MAKE_INSTALL_OPTIONS_DEBUG} PARENT_SCOPE)
set(_VCPKG_MAKE_INSTALL_OPTIONS_RELEASE ${_csc_MAKE_INSTALL_OPTIONS_RELEASE} PARENT_SCOPE)
endfunction()