diff options
| author | ptitSeb <sebastien.chev@gmail.com> | 2022-05-22 17:49:54 +0200 |
|---|---|---|
| committer | ptitSeb <sebastien.chev@gmail.com> | 2022-05-22 17:49:54 +0200 |
| commit | 3dec81b9ebe856f3575f7aa68f8a099d8a99fc39 (patch) | |
| tree | c0e39bd806549f32809cac1103c30d3033f05a8c | |
| parent | b0fa2f5ec098658e61108e6751df381b0c5512a2 (diff) | |
| download | box64-3dec81b9ebe856f3575f7aa68f8a099d8a99fc39.tar.gz box64-3dec81b9ebe856f3575f7aa68f8a099d8a99fc39.zip | |
First attempt to get a static build (not working for now, don't use it)
| -rwxr-xr-x | CMakeLists.txt | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 2fabaa09..4768be68 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,6 +53,7 @@ option(LD80BITS "Set to ON if host device have 80bits long double (i.e. i386)" $ option(NOALIGN "Set to ON if host device doesn't need re-align (i.e. i386)" ${NOALIGN}) option(ARM_DYNAREC "Set to ON to use ARM Dynamic Recompilation" ${ARM_DYNAREC}) option(PAGE16K "Set to ON if host device have PageSize of 16K (instead of 4K)" ${PAGE16K}) +option(STATICBUILD "Set to ON to have a static build (Warning, not working)" ${STATICBUILD}) if(${CMAKE_VERSION} VERSION_LESS "3.12.2") find_package(PythonInterp 3) @@ -546,7 +547,11 @@ set_target_properties(${BOX64} PROPERTIES ENABLE_EXPORTS ON) add_dependencies(${BOX64} WRAPPERS) #add_dependencies(${BOX64} PRINTER) #target_link_libraries(${BOX64} c m dl rt pthread resolv) -set_target_properties(${BOX64} PROPERTIES LINK_FLAGS "-Wl,--no-as-needed -lc -lm -ldl -lrt -lpthread -lresolv -Wl,--as-needed -pthread") +if(STATICBUILD) + set_target_properties(${BOX64} PROPERTIES LINK_FLAGS "-static -Wl,--no-as-needed -Wl,--whole-archive -Wl,--allow-multiple-definition -lm -ldl -lrt -lpthread -lresolv -lc -Wl,-defsym,_DYNAMIC=0 -pthread") +else() + set_target_properties(${BOX64} PROPERTIES LINK_FLAGS "-Wl,--no-as-needed -lc -lm -ldl -lrt -lpthread -lresolv -Wl,--as-needed -pthread") +endif() if(DYNAREC) target_link_libraries(${BOX64} dynarec) endif() |