Skip to content

Commit 61b15dc

Browse files
committed
fix unix not building libs
1 parent 62d4957 commit 61b15dc

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

cmake/generate_fmu.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ function(generateFMU modelIdentifier)
1919
# We will build per-version shared libraries from those object files.
2020
set(COMMON_OBJECTS "$<TARGET_OBJECTS:fmu4cpp_base>")
2121
target_include_directories(${modelIdentifier} PUBLIC "${PROJECT_SOURCE_DIR}/export/include")
22+
set_target_properties(${modelIdentifier} PROPERTIES POSITION_INDEPENDENT_CODE ON)
2223

2324
set(generatedSourcesDir "${CMAKE_BINARY_DIR}/generated")
2425

@@ -82,7 +83,7 @@ function(generateFMU modelIdentifier)
8283

8384
set(fmuOutputDir "${CMAKE_BINARY_DIR}/${fmiVersion}")
8485
set(modelOutputDir "${fmuOutputDir}/${modelIdentifier}")
85-
set(binaryOutputDir "${modelOutputDir}/binaries/${TARGET_PLATFORM}")
86+
set(binaryOutputDir "$<1:${modelOutputDir}/binaries/${TARGET_PLATFORM}>")
8687

8788

8889
add_library(${versionTarget} SHARED

0 commit comments

Comments
 (0)