From da01c918427b1d03211f7299c0bbf43c5d4997a2 Mon Sep 17 00:00:00 2001 From: Sebastian Ehlert <28669218+awvwgk@users.noreply.github.com> Date: Sun, 3 Apr 2022 12:07:38 +0200 Subject: [PATCH] Export symbols on Windows and set PIC flag for Unix --- src/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 78270a559..dce8e3054 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -94,6 +94,13 @@ set(SRC add_library(${PROJECT_NAME} ${SRC}) +set_target_properties( + ${PROJECT_NAME} + PROPERTIES + POSITION_INDEPENDENT_CODE ON + WINDOWS_EXPORT_ALL_SYMBOLS ON +) + if(CMAKE_Fortran_COMPILER_ID STREQUAL GNU AND CMAKE_Fortran_COMPILER_VERSION VERSION_LESS 10.0) target_compile_options( ${PROJECT_NAME}