mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-09 08:40:11 -06:00
These flags are only needed for builds involving shared libraries, and can cause undesirable behavior when they are not needed. They also have variants with values like `=2`. For now, just require projects to add the flags when needed so they have full control. In the future we may be able to add an abstraction to control them, and automatically enable them when linking to shared libraries or creating them. Fixes: #27232 Issue: #27240
9 lines
344 B
CMake
9 lines
344 B
CMake
enable_language(C)
|
|
add_library(emscripten-test-lib SHARED libmod.c)
|
|
target_link_options(emscripten-test-lib PRIVATE -sSIDE_MODULE)
|
|
|
|
add_executable(exec-lib-c module.c)
|
|
target_compile_definitions(exec-lib-c PRIVATE __USE_LIBFUN)
|
|
target_link_libraries(exec-lib-c PRIVATE emscripten-test-lib)
|
|
target_link_options(exec-lib-c PRIVATE -sMAIN_MODULE)
|