91 |
91 |
92 if(BUILD_ENGINE_LIBRARY) |
92 if(BUILD_ENGINE_LIBRARY) |
93 message(STATUS "Engine will be built as library (experimental)") |
93 message(STATUS "Engine will be built as library (experimental)") |
94 set(hwengine_project ${hedgewars_SOURCE_DIR}/hedgewars/hwLibrary.pas) |
94 set(hwengine_project ${hedgewars_SOURCE_DIR}/hedgewars/hwLibrary.pas) |
95 set(engine_sources ${hwengine_project} PascalExports.pas ${engine_sources}) |
95 set(engine_sources ${hwengine_project} PascalExports.pas ${engine_sources}) |
96 set(pascal_compiler_flags_cmn "-dHWLIBRARY" "-k-no_order_inits" "-fPIC" ${pascal_compiler_flags_cmn}) |
96 set(pascal_compiler_flags_cmn "-dHWLIBRARY" ${pascal_compiler_flags_cmn}) |
|
97 |
|
98 # create position independent code, only required for x68_64 builds, similar to -fPIC |
|
99 if(CMAKE_SIZEOF_VOID_P MATCHES "8") |
|
100 set(pascal_compiler_flags_cmn "-Cg" ${pascal_compiler_flags_cmn}) |
|
101 endif(CMAKE_SIZEOF_VOID_P MATCHES "8") |
|
102 |
|
103 # due to compiling/linker issues on Max OS X 10.6 -k-no_order_inits is needed to avoid linking fail |
|
104 if(APPLE AND current_macosx_version MATCHES "10.6") |
|
105 set(pascal_compiler_flags_cmn "-k-no_order_inits" ${pascal_compiler_flags_cmn}) |
|
106 endif(APPLE AND current_macosx_version MATCHES "10.6") |
97 endif(BUILD_ENGINE_LIBRARY) |
107 endif(BUILD_ENGINE_LIBRARY) |
98 |
|
99 |
108 |
100 find_program(fpc_executable ${fpc_tryexe}) |
109 find_program(fpc_executable ${fpc_tryexe}) |
101 |
110 |
102 if(fpc_executable) |
111 if(fpc_executable) |
103 exec_program(${fpc_executable} ARGS "-iV" OUTPUT_VARIABLE fpc_output) |
112 exec_program(${fpc_executable} ARGS "-iV" OUTPUT_VARIABLE fpc_output) |