Skip to content

Commit

Permalink
Merge pull request #240 from Felix-El/develop
Browse files Browse the repository at this point in the history
CMake: Fix assembler `--defsym` format issue (qcc/qnx)
  • Loading branch information
olk authored Oct 1, 2023
2 parents eb779a9 + 1a75623 commit 0108919
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -214,23 +214,26 @@ target_link_libraries(boost_context
Boost::smart_ptr
)

# ATTENTION. Some assemblers are picky to get --defsym,KEY=VALUE pairs where '=' is non-optional!
# Be sure all defines have the '=' character. Overkill solution: always put '=' throughout this module.

target_compile_definitions(boost_context
PUBLIC BOOST_CONTEXT_NO_LIB
PRIVATE BOOST_CONTEXT_SOURCE
PUBLIC BOOST_CONTEXT_NO_LIB=
PRIVATE BOOST_CONTEXT_SOURCE=
)

if(BUILD_SHARED_LIBS)
target_compile_definitions(boost_context PUBLIC BOOST_CONTEXT_DYN_LINK BOOST_CONTEXT_EXPORT=EXPORT)
target_compile_definitions(boost_context PUBLIC BOOST_CONTEXT_DYN_LINK= BOOST_CONTEXT_EXPORT=EXPORT)
else()
target_compile_definitions(boost_context PUBLIC BOOST_CONTEXT_STATIC_LINK BOOST_CONTEXT_EXPORT=)
target_compile_definitions(boost_context PUBLIC BOOST_CONTEXT_STATIC_LINK= BOOST_CONTEXT_EXPORT=)
endif()

if(BOOST_CONTEXT_IMPLEMENTATION STREQUAL "ucontext")
target_compile_definitions(boost_context PUBLIC BOOST_USE_UCONTEXT)
target_compile_definitions(boost_context PUBLIC BOOST_USE_UCONTEXT=)
endif()

if(BOOST_CONTEXT_IMPLEMENTATION STREQUAL "winfib")
target_compile_definitions(boost_context PUBLIC BOOST_USE_WINFIB)
target_compile_definitions(boost_context PUBLIC BOOST_USE_WINFIB=)
endif()

if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")
Expand Down

0 comments on commit 0108919

Please sign in to comment.