[lldb-dev] LLDB doesn't compile on OS X
Zachary Turner
zturner at google.com
Wed Feb 4 08:59:44 PST 2015
I looked into this a little. This argument is used for exactly one reason.
To figure out whether to put _d on the end of the extension module name.
One question: when you do a debug build of LLDB on MacOSX, does it still
use a release version of python? I think the answer is yes, and if so this
code was already broken anyway because it should not depend on the value of
CMAKE_BUILD_TYPE.
Somehow we need to determine which version of Python we're linking against.
And use that to pass into this script. I suspect it's something like this:
if (os is windows)
pythonver = (CMAKE_BUILD_TYPE=="Debug" || defined(_DEBUG) ? "Debug" :
"Release"
else()
pythonver = "Release"
endif()
Anyone?
On Wed, Feb 4, 2015 at 7:43 AM Zachary Turner <zturner at google.com> wrote:
> I'm not a cmake expert, but what is the correct way of detecting debug vs.
> release, even if the user has not specified CMAKE_BUILD_TYPE explicitly?
> On Wed, Feb 4, 2015 at 1:47 AM kutio <kutioo at gmail.com> wrote:
>
>> Hello guys !
>>
>> I was not able to compile the python lldb support because of scripts/
>> finishSwigWrapperClasses.py.
>>
>> I found the problem it's because the --buildConfig parameter was empty.
>> And since the commit below, this parameter is mandatory :
>>
>> git show b84a8a0216a8ee3e2b6c7e963de5bc2c78ece61d
>> commit b84a8a0216a8ee3e2b6c7e963de5bc2c78ece61d
>> Author: Zachary Turner <zturner at google.com>
>> Date: Thu Jul 17 20:36:14 2014 +0000
>>
>> Create an _d suffixed symlink when doing a debug Windows build.
>>
>> _lldb is built as an extension module on Windows. Normally to load
>> an extension module named 'foo', Python would look for the file
>> 'foo.pyd'. However, when a debug interpreter is used, Python will
>> look for the file 'foo_d.pyd'. This change checks the build
>> configuration and creates the correct symlink name based on the
>> build configuration.
>>
>> I found a workaround at the moment but this not sustainable because I
>> think this parameter was introduced for good reasons :
>>
>> ff --git a/scripts/finishSwigWrapperClasses.py b/scripts/
>> finishSwigWrapperClasses.py
>> index 0fe7dec..3fddecf 100644
>> --- a/scripts/finishSwigWrapperClasses.py
>> +++ b/scripts/finishSwigWrapperClasses.py
>> @@ -172,7 +172,7 @@ def validate_arguments( vArgv ):
>> "--srcRoot": "m",
>> "--targetDir": "m",
>> "--cfgBldDir": "o",
>> - "--buildConfig": "m",
>> + "--buildConfig": "o",
>> "--prefix": "o",
>> "--cmakeBuildConfiguration": "o",
>> "--argsFile": "o" };
>> diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
>> index b4421fc..048dc5a 100644
>> --- a/source/CMakeLists.txt
>> +++ b/source/CMakeLists.txt
>> @@ -176,7 +176,7 @@ if ( LLDB_ENABLE_PYTHON_SCRIPTS_SWIG_API_GENERATION )
>> add_custom_command( TARGET liblldb
>> POST_BUILD
>> DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/
>> finishSwigWrapperClasses.py
>> - COMMAND ${PYTHON_EXECUTABLE}
>> ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/finishSwigWrapperClasses.py
>> --buildConfig=${CMAKE_BUILD_TYPE} "--srcRoot=${LLDB_SOURCE_DIR}"
>> "--targetDir=${CMAKE_CURRENT_BINARY_DIR}/../scripts"
>> "--cfgBldDir=${CMAKE_CURRENT_BINARY_DIR}/../scripts"
>> "--prefix=${CMAKE_BINARY_DIR}" "--cmakeBuildConfiguration=${CMAKE_CFG_INTDIR}"
>> -m
>> + COMMAND ${PYTHON_EXECUTABLE}
>> ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/finishSwigWrapperClasses.py
>> "--srcRoot=${LLDB_SOURCE_DIR}" "--targetDir=${CMAKE_CURRENT_BINARY_DIR}/../scripts"
>> "--cfgBldDir=${CMAKE_CURRENT_BINARY_DIR}/../scripts"
>> "--prefix=${CMAKE_BINARY_DIR}" "--cmakeBuildConfiguration=${CMAKE_CFG_INTDIR}"
>> -m
>> COMMENT "Python script sym-linking LLDB Python API")
>> endif ()
>> endif ()
>>
>> We should understand why with OS X CMakefile this parameter is empty.
>>
>> Regards
>> _______________________________________________
>> lldb-dev mailing list
>> lldb-dev at cs.uiuc.edu
>> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20150204/2dd752ed/attachment.html>
More information about the lldb-dev
mailing list