File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,10 @@ add_library(ada ada.cpp)
1111target_compile_features (ada PUBLIC cxx_std_20)
1212target_include_directories (ada PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR} > )
1313target_include_directories (ada PUBLIC "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR} /include>" )
14-
14+ if (NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE )
15+ # We default to ON for all targets, so that we can use the library in shared libraries.
16+ set_target_properties (ada PROPERTIES POSITION_INDEPENDENT_CODE ON )
17+ endif (NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE )
1518if (MSVC )
1619 if ("${MSVC_TOOLSET_VERSION} " STREQUAL "140" )
1720 target_compile_options (ada INTERFACE /W0 /sdl)
@@ -20,9 +23,6 @@ if(MSVC)
2023 target_compile_options (ada PRIVATE /WX /W3 /sdl /w34714) # https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-4-c4714?view=vs-2019
2124 endif ()
2225else (MSVC )
23- if (NOT WIN32 )
24- target_compile_options (ada INTERFACE -fPIC)
25- endif ()
2626 message (STATUS "Assuming GCC-like compiler." )
2727 target_compile_options (ada PRIVATE -Wall -Wextra -Weffc++)
2828 if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" )
You can’t perform that action at this time.
0 commit comments