diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2017-07-18 17:20:01 -0700 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2017-07-18 17:20:18 -0700 |
| commit | 40d2e35ca6fdf443a1b2b4d7aedf0a93cba47041 (patch) | |
| tree | 3a4446c4f8254a79c17e6fbbc0dd4ace05897944 | |
| parent | 73ed70bb33875d00606998c515a82c519ea3c6cc (diff) | |
| download | vcpkg-40d2e35ca6fdf443a1b2b4d7aedf0a93cba47041.tar.gz vcpkg-40d2e35ca6fdf443a1b2b4d7aedf0a93cba47041.zip | |
[duktape] Stamp headers with the correct DUK_F_DLL_BUILD value.
| -rw-r--r-- | ports/duktape/CONTROL | 2 | ||||
| -rw-r--r-- | ports/duktape/portfile.cmake | 19 |
2 files changed, 10 insertions, 11 deletions
diff --git a/ports/duktape/CONTROL b/ports/duktape/CONTROL index 07ae7f1fe..74b01d4cf 100644 --- a/ports/duktape/CONTROL +++ b/ports/duktape/CONTROL @@ -1,4 +1,4 @@ Source: duktape -Version: 2.0.3-1 +Version: 2.0.3-3 Description: Embeddable Javascript engine with a focus on portability and compact footprint. Build-Depends: diff --git a/ports/duktape/portfile.cmake b/ports/duktape/portfile.cmake index 14934a31a..e3e84c0de 100644 --- a/ports/duktape/portfile.cmake +++ b/ports/duktape/portfile.cmake @@ -8,13 +8,10 @@ vcpkg_download_distfile(ARCHIVE_FILE ) vcpkg_extract_source_archive(${ARCHIVE_FILE}) -if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - # Patch duk_config.h to remove 'undef DUK_F_DLL_BUILD' - vcpkg_apply_patches( - SOURCE_PATH ${SOURCE_PATH} - PATCHES "${CMAKE_CURRENT_LIST_DIR}/duk_config.h.patch" - ) -endif() +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES "${CMAKE_CURRENT_LIST_DIR}/duk_config.h.patch" +) vcpkg_configure_cmake( SOURCE_PATH ${CMAKE_PATH} @@ -23,11 +20,13 @@ vcpkg_configure_cmake( vcpkg_install_cmake() -# Revert duk_config.h to its original state -# This is always done in case the file has already been previously patched set(DUK_CONFIG_H_PATH "${CURRENT_PACKAGES_DIR}/include/duk_config.h") file(READ ${DUK_CONFIG_H_PATH} CONTENT) -string(REPLACE "// #undef DUK_F_DLL_BUILD" "#undef DUK_F_DLL_BUILD" CONTENT "${CONTENT}") +if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) + string(REPLACE "// #undef DUK_F_DLL_BUILD" "#undef DUK_F_DLL_BUILD\n#define DUK_F_DLL_BUILD 1" CONTENT "${CONTENT}") +else() + string(REPLACE "// #undef DUK_F_DLL_BUILD" "#undef DUK_F_DLL_BUILD\n#define DUK_F_DLL_BUILD 0" CONTENT "${CONTENT}") +endif() file(WRITE ${DUK_CONFIG_H_PATH} "${CONTENT}") # Remove debug include |
