mirror of
				https://github.com/ethereum/solidity
				synced 2023-10-03 13:03:40 +00:00 
			
		
		
		
	Merge pull request #3010 from ethereum/libsolc
Rename jsonCompiler to libsolc
This commit is contained in:
		
						commit
						1ddd4e2b06
					
				| @ -43,9 +43,10 @@ configure_project(TESTS) | ||||
| add_subdirectory(libdevcore) | ||||
| add_subdirectory(libevmasm) | ||||
| add_subdirectory(libsolidity) | ||||
| add_subdirectory(solc) | ||||
| add_subdirectory(libsolc) | ||||
| 
 | ||||
| if (NOT EMSCRIPTEN) | ||||
| 	add_subdirectory(solc) | ||||
| 	add_subdirectory(liblll) | ||||
| 	add_subdirectory(lllc) | ||||
| endif() | ||||
|  | ||||
							
								
								
									
										9
									
								
								libsolc/CMakeLists.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								libsolc/CMakeLists.txt
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,9 @@ | ||||
| if (EMSCRIPTEN) | ||||
| 	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s EXPORTED_FUNCTIONS='[\"_compileJSON\",\"_license\",\"_version\",\"_compileJSONMulti\",\"_compileJSONCallback\",\"_compileStandard\"]' -s RESERVED_FUNCTION_POINTERS=20") | ||||
| 	add_executable(soljson libsolc.cpp) | ||||
| 	target_link_libraries(soljson PRIVATE solidity) | ||||
| else() | ||||
| 	add_library(libsolc libsolc.cpp) | ||||
| 	set_target_properties(libsolc PROPERTIES OUTPUT_NAME solc) | ||||
| 	target_link_libraries(libsolc PRIVATE solidity) | ||||
| endif() | ||||
| @ -20,7 +20,7 @@ | ||||
|  * JSON interface for the solidity compiler to be used from Javascript. | ||||
|  */ | ||||
| 
 | ||||
| #include <solc/jsonCompiler.h> | ||||
| #include <libsolc/libsolc.h> | ||||
| #include <libdevcore/Common.h> | ||||
| #include <libdevcore/JSON.h> | ||||
| #include <libsolidity/interface/StandardCompiler.h> | ||||
| @ -40,7 +40,7 @@ TMPDIR=$(mktemp -d) | ||||
| 
 | ||||
|     if [[ "$SOLC_EMSCRIPTEN" = "On" ]] | ||||
|     then | ||||
|         cp "$REPO_ROOT/build/solc/soljson.js" . | ||||
|         cp "$REPO_ROOT/build/libsolc/soljson.js" . | ||||
|         npm install solc | ||||
|         cat > solc <<EOF | ||||
| #!/usr/bin/env node | ||||
|  | ||||
| @ -29,7 +29,7 @@ | ||||
| set -e | ||||
| 
 | ||||
| REPO_ROOT=$(cd $(dirname "$0")/.. && pwd) | ||||
| SOLJSON="$REPO_ROOT/build/solc/soljson.js" | ||||
| SOLJSON="$REPO_ROOT/build/libsolc/soljson.js" | ||||
| 
 | ||||
| DIR=$(mktemp -d) | ||||
| ( | ||||
|  | ||||
| @ -87,8 +87,8 @@ make -j 4 | ||||
| 
 | ||||
| cd .. | ||||
| mkdir -p upload | ||||
| cp build/solc/soljson.js upload/ | ||||
| cp build/solc/soljson.js ./ | ||||
| cp build/libsolc/soljson.js upload/ | ||||
| cp build/libsolc/soljson.js ./ | ||||
| 
 | ||||
| OUTPUT_SIZE=`ls -la soljson.js` | ||||
| 
 | ||||
|  | ||||
| @ -10,14 +10,6 @@ target_link_libraries(solc PRIVATE solidity ${Boost_PROGRAM_OPTIONS_LIBRARIES}) | ||||
| include(GNUInstallDirs) | ||||
| install(TARGETS solc DESTINATION "${CMAKE_INSTALL_BINDIR}") | ||||
| 
 | ||||
| if (EMSCRIPTEN) | ||||
| 	set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -s EXPORTED_FUNCTIONS='[\"_compileJSON\",\"_license\",\"_version\",\"_compileJSONMulti\",\"_compileJSONCallback\",\"_compileStandard\"]' -s RESERVED_FUNCTION_POINTERS=20") | ||||
| 	add_executable(soljson jsonCompiler.cpp) | ||||
| else() | ||||
| 	add_library(soljson jsonCompiler.cpp) | ||||
| endif() | ||||
| target_link_libraries(soljson PRIVATE solidity) | ||||
| 
 | ||||
| if(SOLC_LINK_STATIC AND UNIX AND NOT APPLE) | ||||
| 	# Produce solc as statically linked binary (includes C/C++ standard libraries) | ||||
| 	# This is not supported on macOS, see | ||||
|  | ||||
| @ -3,7 +3,7 @@ list(REMOVE_ITEM sources "${CMAKE_CURRENT_SOURCE_DIR}/fuzzer.cpp") | ||||
| file(GLOB_RECURSE headers "*.h") | ||||
| 
 | ||||
| add_executable(soltest ${sources} ${headers}) | ||||
| target_link_libraries(soltest PRIVATE soljson solidity lll evmasm devcore ${Boost_UNIT_TEST_FRAMEWORK_LIBRARIES}) | ||||
| target_link_libraries(soltest PRIVATE libsolc solidity lll evmasm devcore ${Boost_UNIT_TEST_FRAMEWORK_LIBRARIES}) | ||||
| 
 | ||||
| add_executable(solfuzzer fuzzer.cpp) | ||||
| target_link_libraries(solfuzzer soljson evmasm ${Boost_PROGRAM_OPTIONS_LIBRARIES}) | ||||
| target_link_libraries(solfuzzer PRIVATE libsolc evmasm ${Boost_PROGRAM_OPTIONS_LIBRARIES}) | ||||
|  | ||||
| @ -20,7 +20,7 @@ | ||||
| 
 | ||||
| #include <libevmasm/Assembly.h> | ||||
| #include <libevmasm/ConstantOptimiser.h> | ||||
| #include <solc/jsonCompiler.h> | ||||
| #include <libsolc/libsolc.h> | ||||
| 
 | ||||
| #include <json/json.h> | ||||
| 
 | ||||
|  | ||||
| @ -23,7 +23,7 @@ | ||||
| #include <boost/test/unit_test.hpp> | ||||
| #include <libdevcore/JSON.h> | ||||
| #include <libsolidity/interface/Version.h> | ||||
| #include <solc/jsonCompiler.h> | ||||
| #include <libsolc/libsolc.h> | ||||
| 
 | ||||
| #include "../Metadata.h" | ||||
| #include "../TestHelper.h" | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user