Skip to content

Commit 570f076

Browse files
committed
fix: make CMake archive portable for vcpkg
1 parent e9d486f commit 570f076

1 file changed

Lines changed: 3 additions & 22 deletions

File tree

CMakeLists.txt

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -49,28 +49,7 @@ set_target_properties(ipgeolocation_release_obj PROPERTIES
4949
VISIBILITY_INLINES_HIDDEN YES
5050
)
5151

52-
set(IPGEOLOCATION_COMBINED_OBJECT
53-
${CMAKE_CURRENT_BINARY_DIR}/ipgeolocation_combined.o)
54-
55-
add_custom_command(
56-
OUTPUT ${IPGEOLOCATION_COMBINED_OBJECT}
57-
COMMAND ${CMAKE_COMMAND} -E rm -f ${IPGEOLOCATION_COMBINED_OBJECT}
58-
COMMAND ${CMAKE_CXX_COMPILER} -nostdlib -r
59-
$<TARGET_OBJECTS:ipgeolocation_release_obj>
60-
-o ${IPGEOLOCATION_COMBINED_OBJECT}
61-
DEPENDS ipgeolocation_release_obj
62-
COMMAND_EXPAND_LISTS
63-
VERBATIM
64-
COMMENT "Combining the IPGeolocation C++ SDK objects into a single release archive object"
65-
)
66-
67-
set_source_files_properties(${IPGEOLOCATION_COMBINED_OBJECT}
68-
PROPERTIES
69-
GENERATED TRUE
70-
EXTERNAL_OBJECT TRUE
71-
)
72-
73-
add_library(ipgeolocation STATIC ${IPGEOLOCATION_COMBINED_OBJECT})
52+
add_library(ipgeolocation STATIC $<TARGET_OBJECTS:ipgeolocation_release_obj>)
7453
target_compile_features(ipgeolocation PUBLIC cxx_std_17)
7554
add_library(ipgeolocation::ipgeolocation ALIAS ipgeolocation)
7655
target_include_directories(ipgeolocation
@@ -84,6 +63,8 @@ target_link_libraries(ipgeolocation PUBLIC CURL::libcurl)
8463
set_target_properties(ipgeolocation PROPERTIES
8564
EXPORT_NAME ipgeolocation
8665
LINKER_LANGUAGE CXX
66+
CXX_VISIBILITY_PRESET hidden
67+
VISIBILITY_INLINES_HIDDEN YES
8768
)
8869

8970
configure_package_config_file(

0 commit comments

Comments
 (0)